diff --git a/librarian.yaml b/librarian.yaml index 1a538d4e020e..83bafc4ee304 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. language: nodejs -version: v0.24.0 +version: v0.25.0 repo: googleapis/google-cloud-node sources: googleapis: @@ -1089,6 +1089,13 @@ libraries: copyright_year: "2026" nodejs: default_version: v1 + - name: google-cloud-logging-api + version: 1.0.0 + apis: + - path: google/logging/v2 + copyright_year: "2026" + nodejs: + package_name: '@google-cloud/logging-api' - name: google-cloud-lustre version: 0.2.2 apis: diff --git a/packages/google-cloud-logging-api/.gitignore b/packages/google-cloud-logging-api/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/packages/google-cloud-logging-api/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-logging-api/.jsdoc.js b/packages/google-cloud-logging-api/.jsdoc.js new file mode 100644 index 000000000000..e7f5eee844be --- /dev/null +++ b/packages/google-cloud-logging-api/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2026 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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2026 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/logging-api', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-logging-api/.nycrc b/packages/google-cloud-logging-api/.nycrc new file mode 100644 index 000000000000..81a95fc94b00 --- /dev/null +++ b/packages/google-cloud-logging-api/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} \ No newline at end of file diff --git a/packages/google-cloud-logging-api/.repo-metadata.json b/packages/google-cloud-logging-api/.repo-metadata.json new file mode 100644 index 000000000000..2c00cce346d1 --- /dev/null +++ b/packages/google-cloud-logging-api/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_description": "Writes log entries and manages your Cloud Logging configuration.", + "api_id": "logging.googleapis.com", + "api_shortname": "logging", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/logging-api/latest", + "default_version": "v2", + "distribution_name": "@google-cloud/logging-api", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559764", + "language": "nodejs", + "library_type": "GAPIC_AUTO", + "name": "logging", + "name_pretty": "Cloud Logging", + "product_documentation": "https://cloud.google.com/logging/docs", + "release_level": "stable", + "repo": "googleapis/google-cloud-node" +} \ No newline at end of file diff --git a/packages/google-cloud-logging-api/README.md b/packages/google-cloud-logging-api/README.md new file mode 100644 index 000000000000..fc697a56899b --- /dev/null +++ b/packages/google-cloud-logging-api/README.md @@ -0,0 +1,108 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "The comments you see below are used to generate those parts of the template in later states." +Google Cloud Platform logo + +# [Cloud Logging API: Nodejs Client][homepage] + +[//]: # "releaseLevel" + +[![npm version](https://img.shields.io/npm/v/@google-cloud/logging-api.svg)](https://www.npmjs.org/package/@google-cloud/logging-api) + +Cloud Logging API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Logging API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/logging/latest) +* [Cloud Logging API Documentation](https://cloud.google.com/logging/docs/) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Logging API API][enable_api]. +1. [Set up authentication][auth] so you can access the + API from your local workstation. +### Installing the client library + +```bash +npm install @google-cloud/logging-api +``` + +[//]: # "partials.body" + +## Samples + +Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample. + +[//]: # "samples" + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/logging-api@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md` +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=logging.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-logging/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-logging/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-logging diff --git a/packages/google-cloud-logging-api/package.json b/packages/google-cloud-logging-api/package.json new file mode 100644 index 000000000000..ecea49fa2cab --- /dev/null +++ b/packages/google-cloud-logging-api/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/logging-api", + "version": "0.1.0", + "description": "Logging client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-logging-api", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google logging", + "logging", + "config service v2", + "logging service v2", + "metrics service v2" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha --config ../../.mocharc.cjs --no-parallel build/system-test", + "test": "c8 mocha --config ../../.mocharc.cjs build/test" + }, + "dependencies": { + "google-gax": "^5.1.1-rc.1" + }, + "devDependencies": { + "@types/mocha": "^10.0.10", + "@types/node": "^22.18.12", + "@types/sinon": "^20.0.0", + "c8": "^10.1.3", + "gapic-tools": "^1.0.3", + "gts": "^6.0.2", + "jsdoc": "^4.0.5", + "jsdoc-fresh": "^5.0.2", + "jsdoc-region-tag": "^4.0.1", + "mocha": "^11.7.4", + "pack-n-play": "^4.2.1", + "typescript": "5.8.3", + "sinon": "^20.0.0" + }, + "engines": { + "node": ">=18" + } +} diff --git a/packages/google-cloud-logging-api/protos/google/logging/type/http_request.proto b/packages/google-cloud-logging-api/protos/google/logging/type/http_request.proto new file mode 100644 index 000000000000..b31522b69c7c --- /dev/null +++ b/packages/google-cloud-logging-api/protos/google/logging/type/http_request.proto @@ -0,0 +1,95 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.type; + +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Logging.Type"; +option go_package = "google.golang.org/genproto/googleapis/logging/type;ltype"; +option java_multiple_files = true; +option java_outer_classname = "HttpRequestProto"; +option java_package = "com.google.logging.type"; +option php_namespace = "Google\\Cloud\\Logging\\Type"; +option ruby_package = "Google::Cloud::Logging::Type"; + +// A common proto for logging HTTP requests. Only contains semantics +// defined by the HTTP specification. Product-specific logging +// information MUST be defined in a separate message. +message HttpRequest { + // The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + string request_method = 1; + + // The scheme (http, https), the host name, the path and the query + // portion of the URL that was requested. + // Example: `"http://example.com/some/info?color=red"`. + string request_url = 2; + + // The size of the HTTP request message in bytes, including the request + // headers and the request body. + int64 request_size = 3; + + // The response code indicating the status of response. + // Examples: 200, 404. + int32 status = 4; + + // The size of the HTTP response message sent back to the client, in bytes, + // including the response headers and the response body. + int64 response_size = 5; + + // The user agent sent by the client. Example: + // `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET + // CLR 1.0.3705)"`. + string user_agent = 6; + + // The IP address (IPv4 or IPv6) of the client that issued the HTTP + // request. This field can include port information. Examples: + // `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + string remote_ip = 7; + + // The IP address (IPv4 or IPv6) of the origin server that the request was + // sent to. This field can include port information. Examples: + // `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. + string server_ip = 13; + + // The referer URL of the request, as defined in + // [HTTP/1.1 Header Field + // Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). + string referer = 8; + + // The request processing latency on the server, from the time the request was + // received until the response was sent. + google.protobuf.Duration latency = 14; + + // Whether or not a cache lookup was attempted. + bool cache_lookup = 11; + + // Whether or not an entity was served from cache + // (with or without validation). + bool cache_hit = 9; + + // Whether or not the response was validated with the origin server before + // being served from cache. This field is only meaningful if `cache_hit` is + // True. + bool cache_validated_with_origin_server = 10; + + // The number of HTTP response bytes inserted into cache. Set only when a + // cache fill was attempted. + int64 cache_fill_bytes = 12; + + // Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" + string protocol = 15; +} diff --git a/packages/google-cloud-logging-api/protos/google/logging/type/log_severity.proto b/packages/google-cloud-logging-api/protos/google/logging/type/log_severity.proto new file mode 100644 index 000000000000..406b8173a3aa --- /dev/null +++ b/packages/google-cloud-logging-api/protos/google/logging/type/log_severity.proto @@ -0,0 +1,71 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.type; + +option csharp_namespace = "Google.Cloud.Logging.Type"; +option go_package = "google.golang.org/genproto/googleapis/logging/type;ltype"; +option java_multiple_files = true; +option java_outer_classname = "LogSeverityProto"; +option java_package = "com.google.logging.type"; +option objc_class_prefix = "GLOG"; +option php_namespace = "Google\\Cloud\\Logging\\Type"; +option ruby_package = "Google::Cloud::Logging::Type"; + +// The severity of the event described in a log entry, expressed as one of the +// standard severity levels listed below. For your reference, the levels are +// assigned the listed numeric values. The effect of using numeric values other +// than those listed is undefined. +// +// You can filter for log entries by severity. For example, the following +// filter expression will match log entries with severities `INFO`, `NOTICE`, +// and `WARNING`: +// +// severity > DEBUG AND severity <= WARNING +// +// If you are writing log entries, you should map other severity encodings to +// one of these standard levels. For example, you might map all of Java's FINE, +// FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the +// original severity level in the log entry payload if you wish. +enum LogSeverity { + // (0) The log entry has no assigned severity level. + DEFAULT = 0; + + // (100) Debug or trace information. + DEBUG = 100; + + // (200) Routine information, such as ongoing status or performance. + INFO = 200; + + // (300) Normal but significant events, such as start up, shut down, or + // a configuration change. + NOTICE = 300; + + // (400) Warning events might cause problems. + WARNING = 400; + + // (500) Error events are likely to cause problems. + ERROR = 500; + + // (600) Critical events cause more severe problems or outages. + CRITICAL = 600; + + // (700) A person must take an action immediately. + ALERT = 700; + + // (800) One or more systems are unusable. + EMERGENCY = 800; +} diff --git a/packages/google-cloud-logging-api/protos/google/logging/v2/log_entry.proto b/packages/google-cloud-logging-api/protos/google/logging/v2/log_entry.proto new file mode 100644 index 000000000000..820b047b5735 --- /dev/null +++ b/packages/google-cloud-logging-api/protos/google/logging/v2/log_entry.proto @@ -0,0 +1,280 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.v2; + +import "google/api/field_behavior.proto"; +import "google/api/monitored_resource.proto"; +import "google/api/resource.proto"; +import "google/logging/type/http_request.proto"; +import "google/logging/type/log_severity.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb"; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.logging.v2"; +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" + pattern: "projects/{project}/logs/{log}" + pattern: "organizations/{organization}/logs/{log}" + pattern: "folders/{folder}/logs/{log}" + pattern: "billingAccounts/{billing_account}/logs/{log}" + name_field: "log_name" + }; + + // Required. The resource name of the log to which this log entry belongs: + // + // "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]" + // + // A project number may be used in place of PROJECT_ID. The project number is + // translated to its corresponding PROJECT_ID internally and the `log_name` + // field will contain PROJECT_ID in queries and exports. + // + // `[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 + // 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. + string log_name = 12 [(google.api.field_behavior) = REQUIRED]; + + // Required. The monitored resource that produced this log entry. + // + // Example: a log entry that reports a database error would be associated with + // the monitored resource designating the particular database that reported + // the error. + google.api.MonitoredResource resource = 8 + [(google.api.field_behavior) = REQUIRED]; + + // The log entry payload, which can be one of multiple types. + oneof payload { + // The log entry payload, represented as a protocol buffer. Some Google + // Cloud Platform services use this field for their log entry payloads. + // + // The following protocol buffer types are supported; user-defined types + // are not supported: + // + // "type.googleapis.com/google.cloud.audit.AuditLog" + // "type.googleapis.com/google.appengine.logging.v1.RequestLog" + google.protobuf.Any proto_payload = 2; + + // The log entry payload, represented as a Unicode string (UTF-8). + string text_payload = 3; + + // The log entry payload, represented as a structure that is + // expressed as a JSON object. + google.protobuf.Struct json_payload = 6; + } + + // Optional. The time the event described by the log entry occurred. This time + // is used to compute the log entry's age and to enforce the logs retention + // period. If this field is omitted in a new log entry, then Logging assigns + // it the current time. Timestamps have nanosecond accuracy, but trailing + // zeros in the fractional seconds might be omitted when the timestamp is + // displayed. + // + // Incoming log entries must have timestamps that don't exceed the + // [logs retention + // period](https://cloud.google.com/logging/quotas#logs_retention_periods) in + // the past, and that don't exceed 24 hours in the future. Log entries outside + // those time boundaries aren't ingested by Logging. + google.protobuf.Timestamp timestamp = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time the log entry was received by Logging. + google.protobuf.Timestamp receive_timestamp = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for the log entry. If you provide a value, + // then Logging considers other log entries in the same project, with the same + // `timestamp`, and with the same `insert_id` to be duplicates which are + // removed in a single query result. However, there are no guarantees of + // 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. + // + // In queries, the `insert_id` is also used to order log entries that have + // the same `log_name` and `timestamp` values. + string insert_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information about the HTTP request associated with this log + // entry, if applicable. + google.logging.type.HttpRequest http_request = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // 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 + // applicable. + LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The REST resource name of the trace being written to + // [Cloud Trace](https://cloud.google.com/trace) in + // association with this log entry. For example, if your trace data is stored + // in the Cloud project "my-trace-project" and if the service that is creating + // the log entry receives a trace header that includes the trace ID "12345", + // then the service should use "projects/my-tracing-project/traces/12345". + // + // The `trace` field provides the link between logs and traces. By using + // this field, you can navigate from a log entry to a trace. + string trace = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + // associated with the current operation in which the log is being written. + // For example, if a span has the REST resource name of + // "projects/some-project/traces/some-trace/spans/some-span-id", then the + // `span_id` field is "some-span-id". + // + // A + // [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + // represents a single operation within a trace. Whereas a trace may involve + // multiple different microservices running on multiple different machines, + // a span generally corresponds to a single logical operation being performed + // in a single instance of a microservice on one specific machine. Spans + // are the nodes within the tree that is a trace. + // + // Applications that are [instrumented for + // tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + // new, unique span ID on each incoming request. It is also common to create + // and record additional spans corresponding to internal processing elements + // as well as issuing requests to dependencies. + // + // The span ID is expected to be a 16-character, hexadecimal encoding of an + // 8-byte array and should not be zero. It should be unique within the trace + // and should, ideally, be generated in a manner that is uniformly random. + // + // Example values: + // + // - `000000000000004a` + // - `7a2190356c3fc94b` + // - `0000f00300090021` + // - `d39223e101960076` + string span_id = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The sampling decision of the trace associated with the log entry. + // + // True means that the trace resource name in the `trace` field was sampled + // for storage in a trace backend. False means that the trace was not sampled + // for storage when this log entry was written, or the sampling decision was + // unknown at the time. A non-sampled `trace` value is still useful as a + // request correlation identifier. The default is False. + bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL]; + + // 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 +// a log entry is associated. +message LogEntryOperation { + // Optional. An arbitrary operation identifier. Log entries with the same + // identifier are assumed to be part of the same operation. + string id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An arbitrary producer identifier. The combination of `id` and + // `producer` must be globally unique. Examples for `producer`: + // `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. + string producer = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this to True if this is the first log entry in the operation. + bool first = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this to True if this is the last log entry in the operation. + bool last = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional information about the source code location that produced the log +// entry. +message LogEntrySourceLocation { + // Optional. Source file name. Depending on the runtime environment, this + // might be a simple name or a fully-qualified name. + string file = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Line within the source file. 1-based; 0 indicates no line number + // available. + int64 line = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Human-readable name of the function or method being invoked, with + // optional context such as the class or package name. This information may be + // used in contexts such as the logs viewer, where a file and line number are + // less meaningful. The format can vary by language. For example: + // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` + // (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/packages/google-cloud-logging-api/protos/google/logging/v2/logging.proto b/packages/google-cloud-logging-api/protos/google/logging/v2/logging.proto new file mode 100644 index 000000000000..e984d6ec0d5b --- /dev/null +++ b/packages/google-cloud-logging-api/protos/google/logging/v2/logging.proto @@ -0,0 +1,483 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.logging.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/monitored_resource.proto"; +import "google/api/resource.proto"; +import "google/logging/v2/log_entry.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb"; +option java_multiple_files = true; +option java_outer_classname = "LoggingProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; +option ruby_package = "Google::Cloud::Logging::V2"; + +// Service for ingesting and querying logs. +service LoggingServiceV2 { + option (google.api.default_host) = "logging.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/logging.admin," + "https://www.googleapis.com/auth/logging.read," + "https://www.googleapis.com/auth/logging.write"; + + // 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/*}" + additional_bindings { delete: "/v2/{log_name=*/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=organizations/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=folders/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=billingAccounts/*/logs/*}" } + }; + option (google.api.method_signature) = "log_name"; + } + + // 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) + rpc WriteLogEntries(WriteLogEntriesRequest) + returns (WriteLogEntriesResponse) { + option (google.api.http) = { + post: "/v2/entries:write" + body: "*" + }; + option (google.api.method_signature) = "log_name,resource,labels,entries"; + } + + // 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). + rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse) { + option (google.api.http) = { + post: "/v2/entries:list" + body: "*" + }; + option (google.api.method_signature) = "resource_names,filter,order_by"; + } + + // Lists the descriptors for monitored resource types used by Logging. + rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) + returns (ListMonitoredResourceDescriptorsResponse) { + option (google.api.http) = { + get: "/v2/monitoredResourceDescriptors" + }; + } + + // Lists the logs in projects, organizations, folders, or billing accounts. + // Only logs that have entries are listed. + rpc ListLogs(ListLogsRequest) returns (ListLogsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*}/logs" + additional_bindings { get: "/v2/{parent=projects/*}/logs" } + additional_bindings { get: "/v2/{parent=organizations/*}/logs" } + additional_bindings { get: "/v2/{parent=folders/*}/logs" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/logs" } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Streaming read of log entries as they are ingested. Until the stream is + // terminated, it will continue reading logs. + rpc TailLogEntries(stream TailLogEntriesRequest) + returns (stream TailLogEntriesResponse) { + option (google.api.http) = { + post: "/v2/entries:tail" + body: "*" + }; + } +} + +// The parameters to DeleteLog. +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]` + // + // `[LOG_ID]` must be URL-encoded. For example, + // `"projects/my-project-id/logs/syslog"`, + // `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + // + // For more information about log names, see + // [LogEntry][google.logging.v2.LogEntry]. + string log_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Log" } + ]; +} + +// The parameters to WriteLogEntries. +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]` + // + // `[LOG_ID]` must be URL-encoded. For example: + // + // "projects/my-project-id/logs/syslog" + // "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 + // individual log entry. + string log_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "logging.googleapis.com/Log" } + ]; + + // Optional. A default monitored resource object that is assigned to all log + // entries in `entries` that do not specify a value for `resource`. Example: + // + // { "type": "gce_instance", + // "labels": { + // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + // + // See [LogEntry][google.logging.v2.LogEntry]. + google.api.MonitoredResource resource = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default labels that are added to the `labels` field of all log + // entries in `entries`. If a log entry already has a label with the same key + // as a label in this parameter, then the log entry's label is not changed. + // See [LogEntry][google.logging.v2.LogEntry]. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The log entries to send to Logging. The order of log + // entries in this list does not matter. Values supplied in this method's + // `log_name`, `resource`, and `labels` fields are copied into those log + // entries in this list that do not include values for their corresponding + // fields. For more information, see the + // [LogEntry][google.logging.v2.LogEntry] type. + // + // If the `timestamp` or `insert_id` fields are missing in log entries, then + // this method supplies the current time or a unique identifier, respectively. + // The supplied values are chosen so that, among the log entries that did not + // 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/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/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]; + + // Optional. Whether a batch's valid entries should be written even if some + // other entry failed due to a permanent error such as INVALID_ARGUMENT or + // PERMISSION_DENIED. If any entry failed, then the response status is the + // response status of one of the failed entries. The response will include + // error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + // the entries' zero-based index in the `entries`. Failed requests for which + // no entries are written will not include per-entry errors. + bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the request should expect normal response, but the + // entries won't be persisted nor exported. Useful for checking whether the + // logging API endpoints are working properly before sending valuable data. + bool dry_run = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from WriteLogEntries. +message WriteLogEntriesResponse {} + +// Error details for WriteLogEntries with partial success. +message WriteLogEntriesPartialErrors { + // When `WriteLogEntriesRequest.partial_success` is true, records the error + // status for entries that were not written due to a permanent error, keyed + // by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + // + // Failed requests for which no entries are written will not include + // per-entry errors. + map log_entry_errors = 1; +} + +// The parameters to `ListLogEntries`. +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]` + // + // 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. + // A maximum of 100 resources may be specified in a single request. + repeated string resource_names = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; + + // Optional. Only log entries that match the filter are returned. An empty + // filter matches all log entries in the resources listed in `resource_names`. + // Referencing a parent resource that is not listed in `resource_names` will + // cause the filter to return no results. The maximum length of a filter is + // 20,000 characters. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How the results should be sorted. Presently, the only permitted + // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + // option returns entries in order of increasing values of + // `LogEntry.timestamp` (oldest first), and the second option returns entries + // in order of decreasing timestamps (newest first). Entries with equal + // 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. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from `ListLogEntries`. +message ListLogEntriesResponse { + // A list of log entries. If `entries` is empty, `nextPageToken` may still be + // returned, indicating that more entries may exist. See `nextPageToken` for + // more information. + repeated LogEntry entries = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + // + // If a value for `next_page_token` appears and the `entries` field is empty, + // it means that the search found no log entries so far but it did not have + // time to search all the possible log entries. Retry the method with this + // value for `page_token` to continue the search. Alternatively, consider + // speeding up the search by changing your filter to specify a single log name + // or resource type, or to narrow the time range of the search. + string next_page_token = 2; +} + +// The parameters to ListMonitoredResourceDescriptors +message ListMonitoredResourceDescriptorsRequest { + // 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 = 1 [(google.api.field_behavior) = OPTIONAL]; + + // 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]; +} + +// Result returned from ListMonitoredResourceDescriptors. +message ListMonitoredResourceDescriptorsResponse { + // A list of resource descriptors. + repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to ListLogs. +message ListLogsRequest { + // Required. The resource name to list logs for: + // + // * `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) = { + child_type: "logging.googleapis.com/Log" + } + ]; + + // Optional. List of resource names to list logs for: + // + // * `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]` + // + // The resource name in the `parent` field is added to this list. + repeated string resource_names = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; + + // 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 = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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 = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from ListLogs. +message ListLogsResponse { + // A list of log names. For example, + // `"projects/my-project/logs/syslog"` or + // `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + repeated string log_names = 3; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `TailLogEntries`. +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]` + // + // 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]` + repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only log entries that match the filter are returned. An empty + // filter matches all log entries in the resources listed in `resource_names`. + // Referencing a parent resource that is not listed in `resource_names` will + // cause the filter to return no results. The maximum length of a filter is + // 20,000 characters. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The amount of time to buffer log entries at the server before + // being returned to prevent out of order results due to late arriving log + // entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + // milliseconds. + google.protobuf.Duration buffer_window = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from `TailLogEntries`. +message TailLogEntriesResponse { + // Information about entries that were omitted from the session. + message SuppressionInfo { + // An indicator of why entries were omitted. + enum Reason { + // Unexpected default. + REASON_UNSPECIFIED = 0; + + // Indicates suppression occurred due to relevant entries being + // received in excess of rate limits. For quotas and limits, see + // [Logging API quotas and + // limits](https://cloud.google.com/logging/quotas#api-limits). + RATE_LIMIT = 1; + + // Indicates suppression occurred due to the client not consuming + // responses quickly enough. + NOT_CONSUMED = 2; + } + + // The reason that entries were omitted from the session. + Reason reason = 1; + + // A lower bound on the count of entries omitted due to `reason`. + int32 suppressed_count = 2; + } + + // A list of log entries. Each response in the stream will order entries with + // increasing values of `LogEntry.timestamp`. Ordering is not guaranteed + // between separate responses. + repeated LogEntry entries = 1; + + // If entries that otherwise would have been included in the session were not + // sent back to the client, counts of relevant entries omitted from the + // session with the reason that they were not included. There will be at most + // one of each reason per response. The counts represent the number of + // suppressed entries since the last streamed response. + repeated SuppressionInfo suppression_info = 2; +} diff --git a/packages/google-cloud-logging-api/protos/google/logging/v2/logging_config.proto b/packages/google-cloud-logging-api/protos/google/logging/v2/logging_config.proto new file mode 100644 index 000000000000..05ed940b3972 --- /dev/null +++ b/packages/google-cloud-logging-api/protos/google/logging/v2/logging_config.proto @@ -0,0 +1,2317 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.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/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb"; +option java_multiple_files = true; +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}" +}; +option (google.api.resource_definition) = { + type: "logging.googleapis.com/FolderLocation" + pattern: "folders/{folder}/locations/{location}" +}; +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"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/logging.admin," + "https://www.googleapis.com/auth/logging.read"; + + // Lists log buckets. + rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*}/buckets" + additional_bindings { get: "/v2/{parent=projects/*/locations/*}/buckets" } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/buckets" + } + additional_bindings { get: "/v2/{parent=folders/*/locations/*}/buckets" } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*}/buckets" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a log bucket. + rpc GetBucket(GetBucketRequest) returns (LogBucket) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*}" + additional_bindings { get: "/v2/{name=projects/*/locations/*/buckets/*}" } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*}" + } + additional_bindings { get: "/v2/{name=folders/*/locations/*/buckets/*}" } + additional_bindings { + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + }; + } + + // Creates a log bucket asynchronously that can be used to store log entries. + // + // After a bucket has been created, the bucket's location cannot be changed. + rpc CreateBucketAsync(CreateBucketRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*}/buckets:createAsync" + body: "bucket" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync" + body: "bucket" + } + }; + option (google.longrunning.operation_info) = { + response_type: "LogBucket" + metadata_type: "BucketMetadata" + }; + } + + // Updates a log bucket asynchronously. + // + // 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. + rpc UpdateBucketAsync(UpdateBucketRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=*/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=folders/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + }; + option (google.longrunning.operation_info) = { + response_type: "LogBucket" + metadata_type: "BucketMetadata" + }; + } + + // 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" + body: "bucket" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/buckets" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/buckets" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/buckets" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*}/buckets" + body: "bucket" + } + }; + } + + // Updates a log bucket. + // + // 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. + rpc UpdateBucket(UpdateBucketRequest) returns (LogBucket) { + option (google.api.http) = { + patch: "/v2/{name=*/*/locations/*/buckets/*}" + body: "bucket" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=folders/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + body: "bucket" + } + }; + } + + // 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/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + }; + } + + // 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" + body: "*" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/buckets/*}:undelete" + body: "*" + } + additional_bindings { + post: "/v2/{name=organizations/*/locations/*/buckets/*}:undelete" + body: "*" + } + additional_bindings { + post: "/v2/{name=folders/*/locations/*/buckets/*}:undelete" + body: "*" + } + additional_bindings { + post: "/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete" + body: "*" + } + }; + } + + // Lists views on a log bucket. + rpc ListViews(ListViewsRequest) returns (ListViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*/buckets/*}/views" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/buckets/*}/views" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/buckets/*}/views" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*/buckets/*}/views" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a view on a log bucket.. + rpc GetView(GetViewRequest) returns (LogView) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*/views/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*/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" + body: "view" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/buckets/*}/views" + body: "view" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*/buckets/*}/views" + body: "view" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*/buckets/*}/views" + body: "view" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views" + body: "view" + } + }; + } + + // 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/*}" + body: "view" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + body: "view" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + body: "view" + } + additional_bindings { + patch: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + body: "view" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + body: "view" + } + }; + } + + // 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/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + } + }; + } + + // Lists sinks. + rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*}/sinks" + additional_bindings { get: "/v2/{parent=projects/*}/sinks" } + additional_bindings { get: "/v2/{parent=organizations/*}/sinks" } + additional_bindings { get: "/v2/{parent=folders/*}/sinks" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/sinks" } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a sink. + rpc GetSink(GetSinkRequest) returns (LogSink) { + option (google.api.http) = { + get: "/v2/{sink_name=*/*/sinks/*}" + additional_bindings { get: "/v2/{sink_name=projects/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=organizations/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=folders/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=billingAccounts/*/sinks/*}" } + }; + option (google.api.method_signature) = "sink_name"; + } + + // 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. + rpc CreateSink(CreateSinkRequest) returns (LogSink) { + option (google.api.http) = { + post: "/v2/{parent=*/*}/sinks" + body: "sink" + additional_bindings { post: "/v2/{parent=projects/*}/sinks" body: "sink" } + additional_bindings { + post: "/v2/{parent=organizations/*}/sinks" + body: "sink" + } + additional_bindings { post: "/v2/{parent=folders/*}/sinks" body: "sink" } + additional_bindings { + post: "/v2/{parent=billingAccounts/*}/sinks" + body: "sink" + } + }; + option (google.api.method_signature) = "parent,sink"; + } + + // 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. + rpc UpdateSink(UpdateSinkRequest) returns (LogSink) { + option (google.api.http) = { + put: "/v2/{sink_name=*/*/sinks/*}" + body: "sink" + additional_bindings { + put: "/v2/{sink_name=projects/*/sinks/*}" + body: "sink" + } + additional_bindings { + put: "/v2/{sink_name=organizations/*/sinks/*}" + body: "sink" + } + additional_bindings { + put: "/v2/{sink_name=folders/*/sinks/*}" + body: "sink" + } + additional_bindings { + put: "/v2/{sink_name=billingAccounts/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=projects/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=organizations/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=folders/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=billingAccounts/*/sinks/*}" + body: "sink" + } + }; + option (google.api.method_signature) = "sink_name,sink,update_mask"; + option (google.api.method_signature) = "sink_name,sink"; + } + + // Deletes a sink. If the sink has a unique `writer_identity`, then that + // service account is also deleted. + rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{sink_name=*/*/sinks/*}" + additional_bindings { delete: "/v2/{sink_name=projects/*/sinks/*}" } + additional_bindings { delete: "/v2/{sink_name=organizations/*/sinks/*}" } + additional_bindings { delete: "/v2/{sink_name=folders/*/sinks/*}" } + additional_bindings { + delete: "/v2/{sink_name=billingAccounts/*/sinks/*}" + } + }; + option (google.api.method_signature) = "sink_name"; + } + + // Asynchronously creates a linked dataset in BigQuery which makes it possible + // to use BigQuery to read the logs stored in the log bucket. A log bucket may + // currently only contain one link. + rpc CreateLink(CreateLinkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*/buckets/*}/links" + body: "link" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/buckets/*}/links" + body: "link" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*/buckets/*}/links" + body: "link" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*/buckets/*}/links" + body: "link" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" + body: "link" + } + }; + option (google.api.method_signature) = "parent,link,link_id"; + option (google.longrunning.operation_info) = { + response_type: "Link" + metadata_type: "LinkMetadata" + }; + } + + // Deletes a link. This will also delete the corresponding BigQuery linked + // dataset. + rpc DeleteLink(DeleteLinkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=*/*/locations/*/buckets/*/links/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "LinkMetadata" + }; + } + + // Lists links. + rpc ListLinks(ListLinksRequest) returns (ListLinksResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*/buckets/*}/links" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/buckets/*}/links" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/buckets/*}/links" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*/buckets/*}/links" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a link. + rpc GetLink(GetLinkRequest) returns (Link) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*/links/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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" + additional_bindings { get: "/v2/{parent=projects/*}/exclusions" } + additional_bindings { get: "/v2/{parent=organizations/*}/exclusions" } + additional_bindings { get: "/v2/{parent=folders/*}/exclusions" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/exclusions" } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the description of an exclusion in the _Default sink. + rpc GetExclusion(GetExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { + get: "/v2/{name=*/*/exclusions/*}" + additional_bindings { get: "/v2/{name=projects/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=organizations/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=folders/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=billingAccounts/*/exclusions/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // 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" + body: "exclusion" + additional_bindings { + post: "/v2/{parent=projects/*}/exclusions" + body: "exclusion" + } + additional_bindings { + post: "/v2/{parent=organizations/*}/exclusions" + body: "exclusion" + } + additional_bindings { + post: "/v2/{parent=folders/*}/exclusions" + body: "exclusion" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*}/exclusions" + body: "exclusion" + } + }; + option (google.api.method_signature) = "parent,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/*}" + body: "exclusion" + additional_bindings { + patch: "/v2/{name=projects/*/exclusions/*}" + body: "exclusion" + } + additional_bindings { + patch: "/v2/{name=organizations/*/exclusions/*}" + body: "exclusion" + } + additional_bindings { + patch: "/v2/{name=folders/*/exclusions/*}" + body: "exclusion" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/exclusions/*}" + body: "exclusion" + } + }; + option (google.api.method_signature) = "name,exclusion,update_mask"; + } + + // Deletes an exclusion in the _Default sink. + rpc DeleteExclusion(DeleteExclusionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=*/*/exclusions/*}" + additional_bindings { delete: "/v2/{name=projects/*/exclusions/*}" } + additional_bindings { delete: "/v2/{name=organizations/*/exclusions/*}" } + additional_bindings { delete: "/v2/{name=folders/*/exclusions/*}" } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/exclusions/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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. + 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 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. + rpc UpdateCmekSettings(UpdateCmekSettingsRequest) returns (CmekSettings) { + option (google.api.http) = { + patch: "/v2/{name=*/*}/cmekSettings" + body: "cmek_settings" + additional_bindings { + patch: "/v2/{name=organizations/*}/cmekSettings" + body: "cmek_settings" + } + }; + } + + // 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" + }; + } +} + +// Configuration for an indexed field. +message IndexConfig { + // Required. The LogEntry field path to index. + // + // Note that some paths are automatically indexed, and other paths are not + // eligible for indexing. See [indexing documentation]( + // https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + // for details. + // + // For example: `jsonPayload.request.status` + string field_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of data in this index. + IndexType type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the index was last modified. + // + // This is used to return the timestamp, and will be ignored if supplied + // during update. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a repository in which log entries are stored. +message LogBucket { + option (google.api.resource) = { + type: "logging.googleapis.com/LogBucket" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}" + }; + + // Output only. The resource name of the bucket. + // + // For example: + // + // `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; + + // Output only. The creation timestamp of the bucket. This is not set for any + // of the default buckets. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the bucket. + 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. + int32 retention_days = 11; + + // 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]; + + // Whether log analytics is enabled for this bucket. + // + // Once enabled, log analytics features cannot be disabled. + bool analytics_enabled = 14; + + // 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; + + // A list of indexed fields and related configuration data. + repeated IndexConfig index_configs = 17; + + // 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 log entries in a bucket. +message LogView { + option (google.api.resource) = { + type: "logging.googleapis.com/LogView" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}/views/{view}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}" + }; + + // The resource name of the view. + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket/views/my-view` + string name = 1; + + // Describes this view. + string description = 3; + + // Output only. The creation timestamp of the view. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the view. + 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 + // following: + // + // - 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, 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" + pattern: "projects/{project}/sinks/{sink}" + pattern: "organizations/{organization}/sinks/{sink}" + pattern: "folders/{folder}/sinks/{sink}" + pattern: "billingAccounts/{billing_account}/sinks/{sink}" + }; + + // Deprecated. This is unused. + enum VersionFormat { + // An unspecified format version that will default to V2. + VERSION_FORMAT_UNSPECIFIED = 0; + + // `LogEntry` version 2 format. + V2 = 1; + + // `LogEntry` version 1 format. + V1 = 2; + } + + // 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]; + + // Required. The export destination: + // + // "storage.googleapis.com/[GCS_BUCKET]" + // "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 + // [Exporting Logs with + // Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + string destination = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // 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: + // + // `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. + bool disabled = 19 [(google.api.field_behavior) = OPTIONAL]; + + // 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]; + + // Deprecated. This field is unused. + VersionFormat output_version_format = 6 [deprecated = true]; + + // 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 either set by specifying + // `custom_writer_identity` or set automatically 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 + // 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 cannot 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 + // 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 + // `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: + // + // 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. + oneof options { + // Optional. Options that affect sinks exporting data to BigQuery. + BigQueryOptions bigquery_options = 12 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. The creation timestamp of the sink. + // + // This field may not be present for older sinks. + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the sink. + // + // This field may not be present for older sinks. + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a BigQuery dataset that was created by a link. +message BigQueryDataset { + // Output only. The full resource name of the BigQuery dataset. The DATASET_ID + // will match the ID of the link, so the link must match the naming + // restrictions of BigQuery datasets (alphanumeric characters and underscores + // only). + // + // The dataset will have a resource path of + // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + string dataset_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a link connected to an analytics enabled bucket. +message Link { + option (google.api.resource) = { + type: "logging.googleapis.com/Link" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}" + }; + + // The resource name of the link. The name can have up to 100 characters. + // A valid link id (at the end of the link name) must only have alphanumeric + // characters and underscores within it. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket/links/my_link + string name = 1; + + // Describes this link. + // + // The maximum length of the description is 8000 characters. + string description = 2; + + // Output only. The creation timestamp of the link. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource lifecycle state. + LifecycleState lifecycle_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The information of a BigQuery Dataset. When a link is created, a BigQuery + // dataset is created along with it, in the same project as the LogBucket it's + // linked to. This dataset will also have BigQuery Views corresponding to the + // LogViews in the bucket. + BigQueryDataset bigquery_dataset = 5; +} + +// Options that change functionality of a sink exporting data to BigQuery. +message BigQueryOptions { + // Optional. Whether to use [BigQuery's partition + // tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By + // 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. + // + // 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 + // this field set to false. + bool uses_timestamp_column_partitioning = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The parameters to `ListBuckets`. +message ListBucketsRequest { + // Required. The parent resource whose buckets are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + // + // Note: The locations portion of the resource must be specified, but + // supplying the character `-` in place of [LOCATION_ID] will return all + // buckets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogBucket" + } + ]; + + // 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]; +} + +// The response from ListBuckets. +message ListBucketsResponse { + // A list of buckets. + repeated LogBucket buckets = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `CreateBucket`. +message CreateBucketRequest { + // Required. The resource in which to create the log bucket: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + // + // For example: + // + // `"projects/my-project/locations/global"` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogBucket" + } + ]; + + // 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 with any Location Restriction Org Policy. The name field in the + // bucket is ignored. + LogBucket bucket = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `UpdateBucket`. +message UpdateBucketRequest { + // Required. The full resource name of the bucket to update. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "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]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; + + // Required. The updated bucket. + 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. + // + // For a detailed `FieldMask` definition, see: + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + // + // For example: `updateMask=retention_days` + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `GetBucket`. +message GetBucketRequest { + // Required. The resource name of the bucket: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "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]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + +// The parameters to `DeleteBucket`. +message DeleteBucketRequest { + // Required. The full resource name of the bucket to delete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "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]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + +// The parameters to `UndeleteBucket`. +message UndeleteBucketRequest { + // Required. The full resource name of the bucket to undelete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "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]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + +// The parameters to `ListViews`. +message ListViewsRequest { + // Required. The bucket whose views are to be listed: + // + // "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. + 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]; +} + +// The response from ListViews. +message ListViewsResponse { + // A list of views. + repeated LogView views = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `CreateView`. +message CreateViewRequest { + // Required. The bucket in which to create the view + // + // `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A client-assigned identifier such as `"my-view"`. Identifiers are + // limited to 100 characters and can include only letters, digits, + // underscores, hyphens, and periods. + string view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new view. + LogView view = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `UpdateView`. +message UpdateViewRequest { + // Required. The full resource name of the view to update + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[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. + LogView view = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that specifies the fields in `view` that need + // an update. A 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 + // + // For example: `updateMask=filter` + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The parameters to `GetView`. +message GetViewRequest { + // Required. The resource name of the policy: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[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) = { type: "logging.googleapis.com/LogView" } + ]; +} + +// The parameters to `DeleteView`. +message DeleteViewRequest { + // Required. The full resource name of the view to delete: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[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) = { type: "logging.googleapis.com/LogView" } + ]; +} + +// The parameters to `ListSinks`. +message ListSinksRequest { + // Required. The parent resource whose sinks are to be listed: + // + // "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) = { + child_type: "logging.googleapis.com/LogSink" + } + ]; + + // 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]; +} + +// Result returned from `ListSinks`. +message ListSinksResponse { + // A list of sinks. + repeated LogSink sinks = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `GetSink`. +message GetSinkRequest { + // Required. The resource name of the sink: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // For example: + // + // `"projects/my-project/sinks/my-sink"` + string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; +} + +// The parameters to `CreateSink`. +message CreateSinkRequest { + // Required. The resource in which to create the sink: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + // + // For examples: + // + // `"projects/my-project"` + // `"organizations/123456789"` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogSink" + } + ]; + + // Required. The new sink, whose `name` parameter is a sink identifier that + // is not already in use. + LogSink sink = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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 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 + // more information, see `writer_identity` in + // [LogSink][google.logging.v2.LogSink]. + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The parameters to `UpdateSink`. +message UpdateSinkRequest { + // Required. The full resource name of the sink to update, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // For example: + // + // `"projects/my-project/sinks/my-sink"` + string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; + + // Required. The updated sink, whose name is the same identifier that appears + // as part of `sink_name`. + LogSink sink = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + // for a description of this field. When updating a sink, the effect of this + // field on the value of `writer_identity` in the updated sink depends on both + // the old and new values of this field: + // + // + If the old and new values of this field are both false or both true, + // then there is no change to the sink's `writer_identity`. + // + If the old value is false and the new value is true, then + // `writer_identity` is changed to a unique service account. + // + It is an error if the old value is true and the new value is + // set to false or defaulted to false. + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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 + // for backwards compatibility purposes: + // + // `destination,filter,includeChildren` + // + // At some point in the future, behavior will be removed and specifying an + // 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 + // + // For example: `updateMask=filter` + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The parameters to `DeleteSink`. +message DeleteSinkRequest { + // Required. The full resource name of the sink to delete, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // For example: + // + // `"projects/my-project/sinks/my-sink"` + string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; +} + +// The parameters to CreateLink. +message CreateLinkRequest { + // Required. The full resource name of the bucket to create a link for. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "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]" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Link" + } + ]; + + // Required. The new link. + Link link = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the link. The link_id can have up to 100 + // characters. A valid link_id must only have alphanumeric characters and + // underscores within it. + string link_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to DeleteLink. +message DeleteLinkRequest { + // Required. The full resource name of the link to delete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Link" } + ]; +} + +// The parameters to ListLinks. +message ListLinksRequest { + // Required. The parent resource whose links are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + // "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]/ + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Link" + } + ]; + + // 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. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListLinks. +message ListLinksResponse { + // A list of links. + repeated Link links = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to GetLink. +message GetLinkRequest { + // Required. The resource name of the link: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Link" } + ]; +} + +// 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" + pattern: "projects/{project}/exclusions/{exclusion}" + pattern: "organizations/{organization}/exclusions/{exclusion}" + pattern: "folders/{folder}/exclusions/{exclusion}" + pattern: "billingAccounts/{billing_account}/exclusions/{exclusion}" + }; + + // Required. A client-assigned identifier, such as + // `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + // can include only letters, digits, underscores, hyphens, and periods. First + // character has to be alphanumeric. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A description of this exclusion. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. An [advanced logs + // filter](https://cloud.google.com/logging/docs/view/advanced-queries) that + // 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=ERROR" + // + // The maximum length of the filter is 20000 characters. + string filter = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The resource name of the Log Bucket that owns the Log Metric. + // Only Log Buckets in projects are supported. The bucket has to be in the + // same project as the metric. + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket` + // + // If empty, then the Log Metric is considered a non-Bucket Log Metric. + string bucket_name = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to True, then this metric is disabled and it does not + // generate any points. + bool disabled = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The metric descriptor associated with the logs-based metric. + // If unspecified, it uses a default metric descriptor with a DELTA metric + // kind, INT64 value type, with no labels and a unit of "1". Such a metric + // counts the number of log entries matching the `filter` expression. + // + // The `name`, `type`, and `description` fields in the `metric_descriptor` + // are output only, and is constructed using the `name` and `description` + // field in the LogMetric. + // + // To create a logs-based metric that records a distribution of log values, a + // DELTA metric kind with a DISTRIBUTION value type must be used along with + // a `value_extractor` expression in the LogMetric. + // + // Each label in the metric descriptor must have a matching label + // name as the key and an extractor expression as the value in the + // `label_extractors` map. + // + // The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + // be updated once initially configured. New labels can be added in the + // `metric_descriptor`, but existing labels cannot be modified except for + // their description. + google.api.MetricDescriptor metric_descriptor = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A `value_extractor` is required when using a distribution + // logs-based metric to extract the values to record from a log entry. + // Two functions are supported for value extraction: `EXTRACT(field)` or + // `REGEXP_EXTRACT(field, regex)`. The arguments are: + // + // 1. field: The name of the log entry field from which the value is to be + // extracted. + // 2. regex: A regular expression using the Google RE2 syntax + // (https://github.com/google/re2/wiki/Syntax) with a single capture + // group to extract data from the specified log entry field. The value + // of the field is converted to a string before applying the regex. + // It is an error to specify a regex that does not include exactly one + // capture group. + // + // The result of the extraction must be convertible to a double type, as the + // distribution always records double values. If either the extraction or + // the conversion to double fails, then those values are not recorded in the + // distribution. + // + // Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + string value_extractor = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A map from a label key string to an extractor expression which is + // used to extract data from a log entry field and assign as the label value. + // Each label key specified in the LabelDescriptor must have an associated + // extractor expression in this map. The syntax of the extractor expression + // is the same as for the `value_extractor` field. + // + // The extracted value is converted to the type defined in the label + // descriptor. If either the extraction or the type conversion fails, + // the label will have a default value. The default value for a string + // label is an empty string, for an integer label its 0, and for a boolean + // label its `false`. + // + // Note that there are upper bounds on the maximum number of labels and the + // number of active time series that are allowed in a project. + map label_extractors = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The `bucket_options` are required when the logs-based metric is + // using a DISTRIBUTION value type and it describes the bucket boundaries + // used to create a histogram of the extracted values. + google.api.Distribution.BucketOptions bucket_options = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The creation timestamp of the metric. + // + // This field may not be present for older metrics. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the metric. + // + // This field may not be present for older metrics. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated. The API version that created or updated this metric. + // The v2 format is used by default and cannot be changed. + ApiVersion version = 4 [deprecated = true]; +} + +// The parameters to ListLogMetrics. +message ListLogMetricsRequest { + // Required. The name of the project containing the metrics: + // + // "projects/[PROJECT_ID]" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // 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]; +} + +// Result returned from ListLogMetrics. +message ListLogMetricsResponse { + // A list of logs-based metrics. + repeated LogMetric metrics = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to GetLogMetric. +message GetLogMetricRequest { + // Required. The resource name of the desired metric: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + string metric_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogMetric" + } + ]; +} + +// The parameters to CreateLogMetric. +message CreateLogMetricRequest { + // Required. The resource name of the project in which to create the metric: + // + // "projects/[PROJECT_ID]" + // + // The new metric must be provided in the request. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogMetric" + } + ]; + + // Required. The new logs-based metric, which must not have an identifier that + // already exists. + LogMetric metric = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to UpdateLogMetric. +message UpdateLogMetricRequest { + // Required. The resource name of the metric to update: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + // + // The updated metric must be provided in the request and it's + // `name` field must be the same as `[METRIC_ID]` If the metric + // does not exist in `[PROJECT_ID]`, then a new metric is created. + string metric_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogMetric" + } + ]; + + // Required. The updated metric. + LogMetric metric = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to DeleteLogMetric. +message DeleteLogMetricRequest { + // Required. The resource name of the metric to delete: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + string metric_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogMetric" + } + ]; +} diff --git a/packages/google-cloud-logging-api/protos/protos.d.ts b/packages/google-cloud-logging-api/protos/protos.d.ts new file mode 100644 index 000000000000..f38aaea6fba9 --- /dev/null +++ b/packages/google-cloud-logging-api/protos/protos.d.ts @@ -0,0 +1,19677 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @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.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @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.protobuf.Duration; + + /** + * Verifies a Duration 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 Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @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.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_LEGACY = 900, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto optionDependency */ + optionDependency?: (string[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto optionDependency. */ + public optionDependency: string[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @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.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** DescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** DescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @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.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @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.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @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.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @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.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @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.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @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.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + + /** EnumDescriptorProto visibility */ + visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** EnumDescriptorProto visibility. */ + public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @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.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @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.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @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.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @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.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @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.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @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.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @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.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @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.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @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.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @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.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeatureSupport. */ + interface IFeatureSupport { + + /** FeatureSupport editionIntroduced */ + editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport editionDeprecated */ + editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSupport deprecationWarning */ + deprecationWarning?: (string|null); + + /** FeatureSupport editionRemoved */ + editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSupport. */ + class FeatureSupport implements IFeatureSupport { + + /** + * Constructs a new FeatureSupport. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); + + /** FeatureSupport editionIntroduced. */ + public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport editionDeprecated. */ + public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSupport deprecationWarning. */ + public deprecationWarning: string; + + /** FeatureSupport editionRemoved. */ + public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSupport instance + */ + public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @param message FeatureSupport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSupport + * @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.protobuf.FieldOptions.FeatureSupport; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSupport + * @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.protobuf.FieldOptions.FeatureSupport; + + /** + * Verifies a FeatureSupport 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 FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSupport + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @param message FeatureSupport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSupport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSupport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @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.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @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.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions featureSupport */ + featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions featureSupport. */ + public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @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.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @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.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @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.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + + /** FeatureSet enforceNamingStyle */ + enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); + + /** FeatureSet defaultSymbolVisibility */ + defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** FeatureSet enforceNamingStyle. */ + public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); + + /** FeatureSet defaultSymbolVisibility. */ + public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @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.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @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.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + + /** EnforceNamingStyle enum. */ + enum EnforceNamingStyle { + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + STYLE2024 = 1, + STYLE_LEGACY = 2 + } + + /** Properties of a VisibilityFeature. */ + interface IVisibilityFeature { + } + + /** Represents a VisibilityFeature. */ + class VisibilityFeature implements IVisibilityFeature { + + /** + * Constructs a new VisibilityFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns VisibilityFeature instance + */ + public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @param message VisibilityFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VisibilityFeature + * @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.protobuf.FeatureSet.VisibilityFeature; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VisibilityFeature + * @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.protobuf.FeatureSet.VisibilityFeature; + + /** + * Verifies a VisibilityFeature 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 VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VisibilityFeature + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @param message VisibilityFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VisibilityFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VisibilityFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VisibilityFeature { + + /** DefaultSymbolVisibility enum. */ + enum DefaultSymbolVisibility { + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + EXPORT_ALL = 1, + EXPORT_TOP_LEVEL = 2, + LOCAL_ALL = 3, + STRICT = 4 + } + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @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.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @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.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault overridableFeatures */ + overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures */ + fixedFeatures?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault overridableFeatures. */ + public overridableFeatures?: (google.protobuf.IFeatureSet|null); + + /** FeatureSetEditionDefault fixedFeatures. */ + public fixedFeatures?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @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.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @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.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location 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 Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @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.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation 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 Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** SymbolVisibility enum. */ + enum SymbolVisibility { + VISIBILITY_UNSET = 0, + VISIBILITY_LOCAL = 1, + VISIBILITY_EXPORT = 2 + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @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.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @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.protobuf.Struct; + + /** + * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @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.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @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.protobuf.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @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.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @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.protobuf.ListValue; + + /** + * Verifies a ListValue 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 ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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.protobuf.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @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.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @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.protobuf.Timestamp; + + /** + * Verifies a Timestamp 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @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.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @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.protobuf.Empty; + + /** + * Verifies an Empty 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 Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @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.protobuf.FieldMask; + + /** + * Verifies a FieldMask 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 FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace logging. */ + namespace logging { + + /** Namespace type. */ + namespace type { + + /** Properties of a HttpRequest. */ + interface IHttpRequest { + + /** HttpRequest requestMethod */ + requestMethod?: (string|null); + + /** HttpRequest requestUrl */ + requestUrl?: (string|null); + + /** HttpRequest requestSize */ + requestSize?: (number|Long|string|null); + + /** HttpRequest status */ + status?: (number|null); + + /** HttpRequest responseSize */ + responseSize?: (number|Long|string|null); + + /** HttpRequest userAgent */ + userAgent?: (string|null); + + /** HttpRequest remoteIp */ + remoteIp?: (string|null); + + /** HttpRequest serverIp */ + serverIp?: (string|null); + + /** HttpRequest referer */ + referer?: (string|null); + + /** HttpRequest latency */ + latency?: (google.protobuf.IDuration|null); + + /** HttpRequest cacheLookup */ + cacheLookup?: (boolean|null); + + /** HttpRequest cacheHit */ + cacheHit?: (boolean|null); + + /** HttpRequest cacheValidatedWithOriginServer */ + cacheValidatedWithOriginServer?: (boolean|null); + + /** HttpRequest cacheFillBytes */ + cacheFillBytes?: (number|Long|string|null); + + /** HttpRequest protocol */ + protocol?: (string|null); + } + + /** Represents a HttpRequest. */ + class HttpRequest implements IHttpRequest { + + /** + * Constructs a new HttpRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.type.IHttpRequest); + + /** HttpRequest requestMethod. */ + public requestMethod: string; + + /** HttpRequest requestUrl. */ + public requestUrl: string; + + /** HttpRequest requestSize. */ + public requestSize: (number|Long|string); + + /** HttpRequest status. */ + public status: number; + + /** HttpRequest responseSize. */ + public responseSize: (number|Long|string); + + /** HttpRequest userAgent. */ + public userAgent: string; + + /** HttpRequest remoteIp. */ + public remoteIp: string; + + /** HttpRequest serverIp. */ + public serverIp: string; + + /** HttpRequest referer. */ + public referer: string; + + /** HttpRequest latency. */ + public latency?: (google.protobuf.IDuration|null); + + /** HttpRequest cacheLookup. */ + public cacheLookup: boolean; + + /** HttpRequest cacheHit. */ + public cacheHit: boolean; + + /** HttpRequest cacheValidatedWithOriginServer. */ + public cacheValidatedWithOriginServer: boolean; + + /** HttpRequest cacheFillBytes. */ + public cacheFillBytes: (number|Long|string); + + /** HttpRequest protocol. */ + public protocol: string; + + /** + * Creates a new HttpRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRequest instance + */ + public static create(properties?: google.logging.type.IHttpRequest): google.logging.type.HttpRequest; + + /** + * Encodes the specified HttpRequest message. Does not implicitly {@link google.logging.type.HttpRequest.verify|verify} messages. + * @param message HttpRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.type.IHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.logging.type.HttpRequest.verify|verify} messages. + * @param message HttpRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.type.IHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRequest + * @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.type.HttpRequest; + + /** + * Decodes a HttpRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRequest + * @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.type.HttpRequest; + + /** + * Verifies a HttpRequest 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 HttpRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.type.HttpRequest; + + /** + * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. + * @param message HttpRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.type.HttpRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** LogSeverity enum. */ + enum LogSeverity { + DEFAULT = 0, + DEBUG = 100, + INFO = 200, + NOTICE = 300, + WARNING = 400, + ERROR = 500, + CRITICAL = 600, + ALERT = 700, + EMERGENCY = 800 + } + } + + /** Namespace v2. */ + namespace v2 { + + /** Properties of a LogEntry. */ + interface ILogEntry { + + /** LogEntry logName */ + logName?: (string|null); + + /** LogEntry resource */ + resource?: (google.api.IMonitoredResource|null); + + /** LogEntry protoPayload */ + protoPayload?: (google.protobuf.IAny|null); + + /** LogEntry textPayload */ + textPayload?: (string|null); + + /** LogEntry jsonPayload */ + jsonPayload?: (google.protobuf.IStruct|null); + + /** LogEntry timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); + + /** LogEntry receiveTimestamp */ + receiveTimestamp?: (google.protobuf.ITimestamp|null); + + /** LogEntry severity */ + severity?: (google.logging.type.LogSeverity|keyof typeof google.logging.type.LogSeverity|null); + + /** LogEntry insertId */ + insertId?: (string|null); + + /** LogEntry httpRequest */ + httpRequest?: (google.logging.type.IHttpRequest|null); + + /** LogEntry labels */ + labels?: ({ [k: string]: string }|null); + + /** LogEntry operation */ + operation?: (google.logging.v2.ILogEntryOperation|null); + + /** LogEntry trace */ + trace?: (string|null); + + /** LogEntry spanId */ + spanId?: (string|null); + + /** LogEntry traceSampled */ + traceSampled?: (boolean|null); + + /** LogEntry sourceLocation */ + sourceLocation?: (google.logging.v2.ILogEntrySourceLocation|null); + + /** LogEntry split */ + split?: (google.logging.v2.ILogSplit|null); + } + + /** Represents a LogEntry. */ + class LogEntry implements ILogEntry { + + /** + * Constructs a new LogEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogEntry); + + /** LogEntry logName. */ + public logName: string; + + /** LogEntry resource. */ + public resource?: (google.api.IMonitoredResource|null); + + /** LogEntry protoPayload. */ + public protoPayload?: (google.protobuf.IAny|null); + + /** LogEntry textPayload. */ + public textPayload?: (string|null); + + /** LogEntry jsonPayload. */ + public jsonPayload?: (google.protobuf.IStruct|null); + + /** LogEntry timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); + + /** LogEntry receiveTimestamp. */ + public receiveTimestamp?: (google.protobuf.ITimestamp|null); + + /** LogEntry severity. */ + public severity: (google.logging.type.LogSeverity|keyof typeof google.logging.type.LogSeverity); + + /** LogEntry insertId. */ + public insertId: string; + + /** LogEntry httpRequest. */ + public httpRequest?: (google.logging.type.IHttpRequest|null); + + /** LogEntry labels. */ + public labels: { [k: string]: string }; + + /** LogEntry operation. */ + public operation?: (google.logging.v2.ILogEntryOperation|null); + + /** LogEntry trace. */ + public trace: string; + + /** LogEntry spanId. */ + public spanId: string; + + /** LogEntry traceSampled. */ + public traceSampled: boolean; + + /** LogEntry sourceLocation. */ + public sourceLocation?: (google.logging.v2.ILogEntrySourceLocation|null); + + /** LogEntry split. */ + public split?: (google.logging.v2.ILogSplit|null); + + /** LogEntry payload. */ + public payload?: ("protoPayload"|"textPayload"|"jsonPayload"); + + /** + * Creates a new LogEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns LogEntry instance + */ + public static create(properties?: google.logging.v2.ILogEntry): google.logging.v2.LogEntry; + + /** + * Encodes the specified LogEntry message. Does not implicitly {@link google.logging.v2.LogEntry.verify|verify} messages. + * @param message LogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.logging.v2.LogEntry.verify|verify} messages. + * @param message LogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogEntry + * @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.LogEntry; + + /** + * Decodes a LogEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogEntry + * @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.LogEntry; + + /** + * Verifies a LogEntry 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 LogEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogEntry + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogEntry; + + /** + * Creates a plain object from a LogEntry message. Also converts values to other types if specified. + * @param message LogEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogEntryOperation. */ + interface ILogEntryOperation { + + /** LogEntryOperation id */ + id?: (string|null); + + /** LogEntryOperation producer */ + producer?: (string|null); + + /** LogEntryOperation first */ + first?: (boolean|null); + + /** LogEntryOperation last */ + last?: (boolean|null); + } + + /** Represents a LogEntryOperation. */ + class LogEntryOperation implements ILogEntryOperation { + + /** + * Constructs a new LogEntryOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogEntryOperation); + + /** LogEntryOperation id. */ + public id: string; + + /** LogEntryOperation producer. */ + public producer: string; + + /** LogEntryOperation first. */ + public first: boolean; + + /** LogEntryOperation last. */ + public last: boolean; + + /** + * Creates a new LogEntryOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns LogEntryOperation instance + */ + public static create(properties?: google.logging.v2.ILogEntryOperation): google.logging.v2.LogEntryOperation; + + /** + * Encodes the specified LogEntryOperation message. Does not implicitly {@link google.logging.v2.LogEntryOperation.verify|verify} messages. + * @param message LogEntryOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogEntryOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogEntryOperation message, length delimited. Does not implicitly {@link google.logging.v2.LogEntryOperation.verify|verify} messages. + * @param message LogEntryOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogEntryOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogEntryOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogEntryOperation + * @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.LogEntryOperation; + + /** + * Decodes a LogEntryOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogEntryOperation + * @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.LogEntryOperation; + + /** + * Verifies a LogEntryOperation 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 LogEntryOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogEntryOperation + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogEntryOperation; + + /** + * Creates a plain object from a LogEntryOperation message. Also converts values to other types if specified. + * @param message LogEntryOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogEntryOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogEntryOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogEntryOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogEntrySourceLocation. */ + interface ILogEntrySourceLocation { + + /** LogEntrySourceLocation file */ + file?: (string|null); + + /** LogEntrySourceLocation line */ + line?: (number|Long|string|null); + + /** LogEntrySourceLocation function */ + "function"?: (string|null); + } + + /** Represents a LogEntrySourceLocation. */ + class LogEntrySourceLocation implements ILogEntrySourceLocation { + + /** + * Constructs a new LogEntrySourceLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogEntrySourceLocation); + + /** LogEntrySourceLocation file. */ + public file: string; + + /** LogEntrySourceLocation line. */ + public line: (number|Long|string); + + /** LogEntrySourceLocation function. */ + public function: string; + + /** + * Creates a new LogEntrySourceLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns LogEntrySourceLocation instance + */ + public static create(properties?: google.logging.v2.ILogEntrySourceLocation): google.logging.v2.LogEntrySourceLocation; + + /** + * Encodes the specified LogEntrySourceLocation message. Does not implicitly {@link google.logging.v2.LogEntrySourceLocation.verify|verify} messages. + * @param message LogEntrySourceLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogEntrySourceLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogEntrySourceLocation message, length delimited. Does not implicitly {@link google.logging.v2.LogEntrySourceLocation.verify|verify} messages. + * @param message LogEntrySourceLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogEntrySourceLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogEntrySourceLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogEntrySourceLocation + * @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.LogEntrySourceLocation; + + /** + * Decodes a LogEntrySourceLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogEntrySourceLocation + * @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.LogEntrySourceLocation; + + /** + * Verifies a LogEntrySourceLocation 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 LogEntrySourceLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogEntrySourceLocation + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogEntrySourceLocation; + + /** + * Creates a plain object from a LogEntrySourceLocation message. Also converts values to other types if specified. + * @param message LogEntrySourceLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogEntrySourceLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogEntrySourceLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogEntrySourceLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogSplit. */ + interface ILogSplit { + + /** LogSplit uid */ + uid?: (string|null); + + /** LogSplit index */ + index?: (number|null); + + /** LogSplit totalSplits */ + totalSplits?: (number|null); + } + + /** Represents a LogSplit. */ + class LogSplit implements ILogSplit { + + /** + * Constructs a new LogSplit. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogSplit); + + /** LogSplit uid. */ + public uid: string; + + /** LogSplit index. */ + public index: number; + + /** LogSplit totalSplits. */ + public totalSplits: number; + + /** + * Creates a new LogSplit instance using the specified properties. + * @param [properties] Properties to set + * @returns LogSplit instance + */ + public static create(properties?: google.logging.v2.ILogSplit): google.logging.v2.LogSplit; + + /** + * Encodes the specified LogSplit message. Does not implicitly {@link google.logging.v2.LogSplit.verify|verify} messages. + * @param message LogSplit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogSplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogSplit message, length delimited. Does not implicitly {@link google.logging.v2.LogSplit.verify|verify} messages. + * @param message LogSplit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogSplit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogSplit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogSplit + * @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.LogSplit; + + /** + * Decodes a LogSplit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogSplit + * @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.LogSplit; + + /** + * Verifies a LogSplit 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 LogSplit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogSplit + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogSplit; + + /** + * Creates a plain object from a LogSplit message. Also converts values to other types if specified. + * @param message LogSplit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogSplit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogSplit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogSplit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a LoggingServiceV2 */ + class LoggingServiceV2 extends $protobuf.rpc.Service { + + /** + * Constructs a new LoggingServiceV2 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 LoggingServiceV2 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): LoggingServiceV2; + + /** + * Calls DeleteLog. + * @param request DeleteLogRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteLog(request: google.logging.v2.IDeleteLogRequest, callback: google.logging.v2.LoggingServiceV2.DeleteLogCallback): void; + + /** + * Calls DeleteLog. + * @param request DeleteLogRequest message or plain object + * @returns Promise + */ + public deleteLog(request: google.logging.v2.IDeleteLogRequest): Promise; + + /** + * Calls WriteLogEntries. + * @param request WriteLogEntriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WriteLogEntriesResponse + */ + public writeLogEntries(request: google.logging.v2.IWriteLogEntriesRequest, callback: google.logging.v2.LoggingServiceV2.WriteLogEntriesCallback): void; + + /** + * Calls WriteLogEntries. + * @param request WriteLogEntriesRequest message or plain object + * @returns Promise + */ + public writeLogEntries(request: google.logging.v2.IWriteLogEntriesRequest): Promise; + + /** + * Calls ListLogEntries. + * @param request ListLogEntriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLogEntriesResponse + */ + public listLogEntries(request: google.logging.v2.IListLogEntriesRequest, callback: google.logging.v2.LoggingServiceV2.ListLogEntriesCallback): void; + + /** + * Calls ListLogEntries. + * @param request ListLogEntriesRequest message or plain object + * @returns Promise + */ + public listLogEntries(request: google.logging.v2.IListLogEntriesRequest): Promise; + + /** + * Calls ListMonitoredResourceDescriptors. + * @param request ListMonitoredResourceDescriptorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMonitoredResourceDescriptorsResponse + */ + public listMonitoredResourceDescriptors(request: google.logging.v2.IListMonitoredResourceDescriptorsRequest, callback: google.logging.v2.LoggingServiceV2.ListMonitoredResourceDescriptorsCallback): void; + + /** + * Calls ListMonitoredResourceDescriptors. + * @param request ListMonitoredResourceDescriptorsRequest message or plain object + * @returns Promise + */ + public listMonitoredResourceDescriptors(request: google.logging.v2.IListMonitoredResourceDescriptorsRequest): Promise; + + /** + * Calls ListLogs. + * @param request ListLogsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLogsResponse + */ + public listLogs(request: google.logging.v2.IListLogsRequest, callback: google.logging.v2.LoggingServiceV2.ListLogsCallback): void; + + /** + * Calls ListLogs. + * @param request ListLogsRequest message or plain object + * @returns Promise + */ + public listLogs(request: google.logging.v2.IListLogsRequest): Promise; + + /** + * Calls TailLogEntries. + * @param request TailLogEntriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TailLogEntriesResponse + */ + public tailLogEntries(request: google.logging.v2.ITailLogEntriesRequest, callback: google.logging.v2.LoggingServiceV2.TailLogEntriesCallback): void; + + /** + * Calls TailLogEntries. + * @param request TailLogEntriesRequest message or plain object + * @returns Promise + */ + public tailLogEntries(request: google.logging.v2.ITailLogEntriesRequest): Promise; + } + + namespace LoggingServiceV2 { + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|deleteLog}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteLogCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|writeLogEntries}. + * @param error Error, if any + * @param [response] WriteLogEntriesResponse + */ + type WriteLogEntriesCallback = (error: (Error|null), response?: google.logging.v2.WriteLogEntriesResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|listLogEntries}. + * @param error Error, if any + * @param [response] ListLogEntriesResponse + */ + type ListLogEntriesCallback = (error: (Error|null), response?: google.logging.v2.ListLogEntriesResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|listMonitoredResourceDescriptors}. + * @param error Error, if any + * @param [response] ListMonitoredResourceDescriptorsResponse + */ + type ListMonitoredResourceDescriptorsCallback = (error: (Error|null), response?: google.logging.v2.ListMonitoredResourceDescriptorsResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|listLogs}. + * @param error Error, if any + * @param [response] ListLogsResponse + */ + type ListLogsCallback = (error: (Error|null), response?: google.logging.v2.ListLogsResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|tailLogEntries}. + * @param error Error, if any + * @param [response] TailLogEntriesResponse + */ + type TailLogEntriesCallback = (error: (Error|null), response?: google.logging.v2.TailLogEntriesResponse) => void; + } + + /** Properties of a DeleteLogRequest. */ + interface IDeleteLogRequest { + + /** DeleteLogRequest logName */ + logName?: (string|null); + } + + /** Represents a DeleteLogRequest. */ + class DeleteLogRequest implements IDeleteLogRequest { + + /** + * Constructs a new DeleteLogRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteLogRequest); + + /** DeleteLogRequest logName. */ + public logName: string; + + /** + * Creates a new DeleteLogRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLogRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteLogRequest): google.logging.v2.DeleteLogRequest; + + /** + * Encodes the specified DeleteLogRequest message. Does not implicitly {@link google.logging.v2.DeleteLogRequest.verify|verify} messages. + * @param message DeleteLogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteLogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLogRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogRequest.verify|verify} messages. + * @param message DeleteLogRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteLogRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLogRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLogRequest + * @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.DeleteLogRequest; + + /** + * Decodes a DeleteLogRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLogRequest + * @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.DeleteLogRequest; + + /** + * Verifies a DeleteLogRequest 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 DeleteLogRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLogRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteLogRequest; + + /** + * Creates a plain object from a DeleteLogRequest message. Also converts values to other types if specified. + * @param message DeleteLogRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteLogRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLogRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteLogRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WriteLogEntriesRequest. */ + interface IWriteLogEntriesRequest { + + /** WriteLogEntriesRequest logName */ + logName?: (string|null); + + /** WriteLogEntriesRequest resource */ + resource?: (google.api.IMonitoredResource|null); + + /** WriteLogEntriesRequest labels */ + labels?: ({ [k: string]: string }|null); + + /** WriteLogEntriesRequest entries */ + entries?: (google.logging.v2.ILogEntry[]|null); + + /** WriteLogEntriesRequest partialSuccess */ + partialSuccess?: (boolean|null); + + /** WriteLogEntriesRequest dryRun */ + dryRun?: (boolean|null); + } + + /** Represents a WriteLogEntriesRequest. */ + class WriteLogEntriesRequest implements IWriteLogEntriesRequest { + + /** + * Constructs a new WriteLogEntriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IWriteLogEntriesRequest); + + /** WriteLogEntriesRequest logName. */ + public logName: string; + + /** WriteLogEntriesRequest resource. */ + public resource?: (google.api.IMonitoredResource|null); + + /** WriteLogEntriesRequest labels. */ + public labels: { [k: string]: string }; + + /** WriteLogEntriesRequest entries. */ + public entries: google.logging.v2.ILogEntry[]; + + /** WriteLogEntriesRequest partialSuccess. */ + public partialSuccess: boolean; + + /** WriteLogEntriesRequest dryRun. */ + public dryRun: boolean; + + /** + * Creates a new WriteLogEntriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteLogEntriesRequest instance + */ + public static create(properties?: google.logging.v2.IWriteLogEntriesRequest): google.logging.v2.WriteLogEntriesRequest; + + /** + * Encodes the specified WriteLogEntriesRequest message. Does not implicitly {@link google.logging.v2.WriteLogEntriesRequest.verify|verify} messages. + * @param message WriteLogEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IWriteLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesRequest.verify|verify} messages. + * @param message WriteLogEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IWriteLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteLogEntriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteLogEntriesRequest + * @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.WriteLogEntriesRequest; + + /** + * Decodes a WriteLogEntriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteLogEntriesRequest + * @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.WriteLogEntriesRequest; + + /** + * Verifies a WriteLogEntriesRequest 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 WriteLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteLogEntriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.WriteLogEntriesRequest; + + /** + * Creates a plain object from a WriteLogEntriesRequest message. Also converts values to other types if specified. + * @param message WriteLogEntriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.WriteLogEntriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteLogEntriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteLogEntriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WriteLogEntriesResponse. */ + interface IWriteLogEntriesResponse { + } + + /** Represents a WriteLogEntriesResponse. */ + class WriteLogEntriesResponse implements IWriteLogEntriesResponse { + + /** + * Constructs a new WriteLogEntriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IWriteLogEntriesResponse); + + /** + * Creates a new WriteLogEntriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteLogEntriesResponse instance + */ + public static create(properties?: google.logging.v2.IWriteLogEntriesResponse): google.logging.v2.WriteLogEntriesResponse; + + /** + * Encodes the specified WriteLogEntriesResponse message. Does not implicitly {@link google.logging.v2.WriteLogEntriesResponse.verify|verify} messages. + * @param message WriteLogEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IWriteLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesResponse.verify|verify} messages. + * @param message WriteLogEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IWriteLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteLogEntriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteLogEntriesResponse + * @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.WriteLogEntriesResponse; + + /** + * Decodes a WriteLogEntriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteLogEntriesResponse + * @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.WriteLogEntriesResponse; + + /** + * Verifies a WriteLogEntriesResponse 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 WriteLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteLogEntriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.WriteLogEntriesResponse; + + /** + * Creates a plain object from a WriteLogEntriesResponse message. Also converts values to other types if specified. + * @param message WriteLogEntriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.WriteLogEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteLogEntriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteLogEntriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WriteLogEntriesPartialErrors. */ + interface IWriteLogEntriesPartialErrors { + + /** WriteLogEntriesPartialErrors logEntryErrors */ + logEntryErrors?: ({ [k: string]: google.rpc.IStatus }|null); + } + + /** Represents a WriteLogEntriesPartialErrors. */ + class WriteLogEntriesPartialErrors implements IWriteLogEntriesPartialErrors { + + /** + * Constructs a new WriteLogEntriesPartialErrors. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IWriteLogEntriesPartialErrors); + + /** WriteLogEntriesPartialErrors logEntryErrors. */ + public logEntryErrors: { [k: string]: google.rpc.IStatus }; + + /** + * Creates a new WriteLogEntriesPartialErrors instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteLogEntriesPartialErrors instance + */ + public static create(properties?: google.logging.v2.IWriteLogEntriesPartialErrors): google.logging.v2.WriteLogEntriesPartialErrors; + + /** + * Encodes the specified WriteLogEntriesPartialErrors message. Does not implicitly {@link google.logging.v2.WriteLogEntriesPartialErrors.verify|verify} messages. + * @param message WriteLogEntriesPartialErrors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IWriteLogEntriesPartialErrors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WriteLogEntriesPartialErrors message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesPartialErrors.verify|verify} messages. + * @param message WriteLogEntriesPartialErrors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IWriteLogEntriesPartialErrors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WriteLogEntriesPartialErrors message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteLogEntriesPartialErrors + * @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.WriteLogEntriesPartialErrors; + + /** + * Decodes a WriteLogEntriesPartialErrors message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteLogEntriesPartialErrors + * @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.WriteLogEntriesPartialErrors; + + /** + * Verifies a WriteLogEntriesPartialErrors 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 WriteLogEntriesPartialErrors message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteLogEntriesPartialErrors + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.WriteLogEntriesPartialErrors; + + /** + * Creates a plain object from a WriteLogEntriesPartialErrors message. Also converts values to other types if specified. + * @param message WriteLogEntriesPartialErrors + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.WriteLogEntriesPartialErrors, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WriteLogEntriesPartialErrors to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteLogEntriesPartialErrors + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogEntriesRequest. */ + interface IListLogEntriesRequest { + + /** ListLogEntriesRequest resourceNames */ + resourceNames?: (string[]|null); + + /** ListLogEntriesRequest filter */ + filter?: (string|null); + + /** ListLogEntriesRequest orderBy */ + orderBy?: (string|null); + + /** ListLogEntriesRequest pageSize */ + pageSize?: (number|null); + + /** ListLogEntriesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListLogEntriesRequest. */ + class ListLogEntriesRequest implements IListLogEntriesRequest { + + /** + * Constructs a new ListLogEntriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogEntriesRequest); + + /** ListLogEntriesRequest resourceNames. */ + public resourceNames: string[]; + + /** ListLogEntriesRequest filter. */ + public filter: string; + + /** ListLogEntriesRequest orderBy. */ + public orderBy: string; + + /** ListLogEntriesRequest pageSize. */ + public pageSize: number; + + /** ListLogEntriesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListLogEntriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogEntriesRequest instance + */ + public static create(properties?: google.logging.v2.IListLogEntriesRequest): google.logging.v2.ListLogEntriesRequest; + + /** + * Encodes the specified ListLogEntriesRequest message. Does not implicitly {@link google.logging.v2.ListLogEntriesRequest.verify|verify} messages. + * @param message ListLogEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogEntriesRequest.verify|verify} messages. + * @param message ListLogEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogEntriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogEntriesRequest + * @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.ListLogEntriesRequest; + + /** + * Decodes a ListLogEntriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogEntriesRequest + * @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.ListLogEntriesRequest; + + /** + * Verifies a ListLogEntriesRequest 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 ListLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogEntriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogEntriesRequest; + + /** + * Creates a plain object from a ListLogEntriesRequest message. Also converts values to other types if specified. + * @param message ListLogEntriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLogEntriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogEntriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogEntriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogEntriesResponse. */ + interface IListLogEntriesResponse { + + /** ListLogEntriesResponse entries */ + entries?: (google.logging.v2.ILogEntry[]|null); + + /** ListLogEntriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLogEntriesResponse. */ + class ListLogEntriesResponse implements IListLogEntriesResponse { + + /** + * Constructs a new ListLogEntriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogEntriesResponse); + + /** ListLogEntriesResponse entries. */ + public entries: google.logging.v2.ILogEntry[]; + + /** ListLogEntriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLogEntriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogEntriesResponse instance + */ + public static create(properties?: google.logging.v2.IListLogEntriesResponse): google.logging.v2.ListLogEntriesResponse; + + /** + * Encodes the specified ListLogEntriesResponse message. Does not implicitly {@link google.logging.v2.ListLogEntriesResponse.verify|verify} messages. + * @param message ListLogEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogEntriesResponse.verify|verify} messages. + * @param message ListLogEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogEntriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogEntriesResponse + * @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.ListLogEntriesResponse; + + /** + * Decodes a ListLogEntriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogEntriesResponse + * @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.ListLogEntriesResponse; + + /** + * Verifies a ListLogEntriesResponse 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 ListLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogEntriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogEntriesResponse; + + /** + * Creates a plain object from a ListLogEntriesResponse message. Also converts values to other types if specified. + * @param message ListLogEntriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLogEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogEntriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogEntriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMonitoredResourceDescriptorsRequest. */ + interface IListMonitoredResourceDescriptorsRequest { + + /** ListMonitoredResourceDescriptorsRequest pageSize */ + pageSize?: (number|null); + + /** ListMonitoredResourceDescriptorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMonitoredResourceDescriptorsRequest. */ + class ListMonitoredResourceDescriptorsRequest implements IListMonitoredResourceDescriptorsRequest { + + /** + * Constructs a new ListMonitoredResourceDescriptorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListMonitoredResourceDescriptorsRequest); + + /** ListMonitoredResourceDescriptorsRequest pageSize. */ + public pageSize: number; + + /** ListMonitoredResourceDescriptorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMonitoredResourceDescriptorsRequest instance + */ + public static create(properties?: google.logging.v2.IListMonitoredResourceDescriptorsRequest): google.logging.v2.ListMonitoredResourceDescriptorsRequest; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. + * @param message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListMonitoredResourceDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. + * @param message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListMonitoredResourceDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMonitoredResourceDescriptorsRequest + * @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.ListMonitoredResourceDescriptorsRequest; + + /** + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMonitoredResourceDescriptorsRequest + * @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.ListMonitoredResourceDescriptorsRequest; + + /** + * Verifies a ListMonitoredResourceDescriptorsRequest 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 ListMonitoredResourceDescriptorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMonitoredResourceDescriptorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListMonitoredResourceDescriptorsRequest; + + /** + * Creates a plain object from a ListMonitoredResourceDescriptorsRequest message. Also converts values to other types if specified. + * @param message ListMonitoredResourceDescriptorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListMonitoredResourceDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMonitoredResourceDescriptorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMonitoredResourceDescriptorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMonitoredResourceDescriptorsResponse. */ + interface IListMonitoredResourceDescriptorsResponse { + + /** ListMonitoredResourceDescriptorsResponse resourceDescriptors */ + resourceDescriptors?: (google.api.IMonitoredResourceDescriptor[]|null); + + /** ListMonitoredResourceDescriptorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMonitoredResourceDescriptorsResponse. */ + class ListMonitoredResourceDescriptorsResponse implements IListMonitoredResourceDescriptorsResponse { + + /** + * Constructs a new ListMonitoredResourceDescriptorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListMonitoredResourceDescriptorsResponse); + + /** ListMonitoredResourceDescriptorsResponse resourceDescriptors. */ + public resourceDescriptors: google.api.IMonitoredResourceDescriptor[]; + + /** ListMonitoredResourceDescriptorsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMonitoredResourceDescriptorsResponse instance + */ + public static create(properties?: google.logging.v2.IListMonitoredResourceDescriptorsResponse): google.logging.v2.ListMonitoredResourceDescriptorsResponse; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. + * @param message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListMonitoredResourceDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. + * @param message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListMonitoredResourceDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMonitoredResourceDescriptorsResponse + * @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.ListMonitoredResourceDescriptorsResponse; + + /** + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMonitoredResourceDescriptorsResponse + * @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.ListMonitoredResourceDescriptorsResponse; + + /** + * Verifies a ListMonitoredResourceDescriptorsResponse 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 ListMonitoredResourceDescriptorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMonitoredResourceDescriptorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListMonitoredResourceDescriptorsResponse; + + /** + * Creates a plain object from a ListMonitoredResourceDescriptorsResponse message. Also converts values to other types if specified. + * @param message ListMonitoredResourceDescriptorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListMonitoredResourceDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMonitoredResourceDescriptorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMonitoredResourceDescriptorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogsRequest. */ + interface IListLogsRequest { + + /** ListLogsRequest parent */ + parent?: (string|null); + + /** ListLogsRequest resourceNames */ + resourceNames?: (string[]|null); + + /** ListLogsRequest pageSize */ + pageSize?: (number|null); + + /** ListLogsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListLogsRequest. */ + class ListLogsRequest implements IListLogsRequest { + + /** + * Constructs a new ListLogsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogsRequest); + + /** ListLogsRequest parent. */ + public parent: string; + + /** ListLogsRequest resourceNames. */ + public resourceNames: string[]; + + /** ListLogsRequest pageSize. */ + public pageSize: number; + + /** ListLogsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListLogsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogsRequest instance + */ + public static create(properties?: google.logging.v2.IListLogsRequest): google.logging.v2.ListLogsRequest; + + /** + * Encodes the specified ListLogsRequest message. Does not implicitly {@link google.logging.v2.ListLogsRequest.verify|verify} messages. + * @param message ListLogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogsRequest.verify|verify} messages. + * @param message ListLogsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLogsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogsRequest + * @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.ListLogsRequest; + + /** + * Decodes a ListLogsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogsRequest + * @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.ListLogsRequest; + + /** + * Verifies a ListLogsRequest 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 ListLogsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogsRequest; + + /** + * Creates a plain object from a ListLogsRequest message. Also converts values to other types if specified. + * @param message ListLogsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLogsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogsResponse. */ + interface IListLogsResponse { + + /** ListLogsResponse logNames */ + logNames?: (string[]|null); + + /** ListLogsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLogsResponse. */ + class ListLogsResponse implements IListLogsResponse { + + /** + * Constructs a new ListLogsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogsResponse); + + /** ListLogsResponse logNames. */ + public logNames: string[]; + + /** ListLogsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLogsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogsResponse instance + */ + public static create(properties?: google.logging.v2.IListLogsResponse): google.logging.v2.ListLogsResponse; + + /** + * Encodes the specified ListLogsResponse message. Does not implicitly {@link google.logging.v2.ListLogsResponse.verify|verify} messages. + * @param message ListLogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLogsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogsResponse.verify|verify} messages. + * @param message ListLogsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLogsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLogsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLogsResponse + * @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.ListLogsResponse; + + /** + * Decodes a ListLogsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLogsResponse + * @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.ListLogsResponse; + + /** + * Verifies a ListLogsResponse 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 ListLogsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogsResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogsResponse; + + /** + * Creates a plain object from a ListLogsResponse message. Also converts values to other types if specified. + * @param message ListLogsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLogsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TailLogEntriesRequest. */ + interface ITailLogEntriesRequest { + + /** TailLogEntriesRequest resourceNames */ + resourceNames?: (string[]|null); + + /** TailLogEntriesRequest filter */ + filter?: (string|null); + + /** TailLogEntriesRequest bufferWindow */ + bufferWindow?: (google.protobuf.IDuration|null); + } + + /** Represents a TailLogEntriesRequest. */ + class TailLogEntriesRequest implements ITailLogEntriesRequest { + + /** + * Constructs a new TailLogEntriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ITailLogEntriesRequest); + + /** TailLogEntriesRequest resourceNames. */ + public resourceNames: string[]; + + /** TailLogEntriesRequest filter. */ + public filter: string; + + /** TailLogEntriesRequest bufferWindow. */ + public bufferWindow?: (google.protobuf.IDuration|null); + + /** + * Creates a new TailLogEntriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TailLogEntriesRequest instance + */ + public static create(properties?: google.logging.v2.ITailLogEntriesRequest): google.logging.v2.TailLogEntriesRequest; + + /** + * Encodes the specified TailLogEntriesRequest message. Does not implicitly {@link google.logging.v2.TailLogEntriesRequest.verify|verify} messages. + * @param message TailLogEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ITailLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TailLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesRequest.verify|verify} messages. + * @param message TailLogEntriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ITailLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TailLogEntriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TailLogEntriesRequest + * @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.TailLogEntriesRequest; + + /** + * Decodes a TailLogEntriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TailLogEntriesRequest + * @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.TailLogEntriesRequest; + + /** + * Verifies a TailLogEntriesRequest 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 TailLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TailLogEntriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.TailLogEntriesRequest; + + /** + * Creates a plain object from a TailLogEntriesRequest message. Also converts values to other types if specified. + * @param message TailLogEntriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.TailLogEntriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TailLogEntriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TailLogEntriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TailLogEntriesResponse. */ + interface ITailLogEntriesResponse { + + /** TailLogEntriesResponse entries */ + entries?: (google.logging.v2.ILogEntry[]|null); + + /** TailLogEntriesResponse suppressionInfo */ + suppressionInfo?: (google.logging.v2.TailLogEntriesResponse.ISuppressionInfo[]|null); + } + + /** Represents a TailLogEntriesResponse. */ + class TailLogEntriesResponse implements ITailLogEntriesResponse { + + /** + * Constructs a new TailLogEntriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ITailLogEntriesResponse); + + /** TailLogEntriesResponse entries. */ + public entries: google.logging.v2.ILogEntry[]; + + /** TailLogEntriesResponse suppressionInfo. */ + public suppressionInfo: google.logging.v2.TailLogEntriesResponse.ISuppressionInfo[]; + + /** + * Creates a new TailLogEntriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TailLogEntriesResponse instance + */ + public static create(properties?: google.logging.v2.ITailLogEntriesResponse): google.logging.v2.TailLogEntriesResponse; + + /** + * Encodes the specified TailLogEntriesResponse message. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.verify|verify} messages. + * @param message TailLogEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ITailLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TailLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.verify|verify} messages. + * @param message TailLogEntriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ITailLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TailLogEntriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TailLogEntriesResponse + * @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.TailLogEntriesResponse; + + /** + * Decodes a TailLogEntriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TailLogEntriesResponse + * @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.TailLogEntriesResponse; + + /** + * Verifies a TailLogEntriesResponse 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 TailLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TailLogEntriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.TailLogEntriesResponse; + + /** + * Creates a plain object from a TailLogEntriesResponse message. Also converts values to other types if specified. + * @param message TailLogEntriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.TailLogEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TailLogEntriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TailLogEntriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TailLogEntriesResponse { + + /** Properties of a SuppressionInfo. */ + interface ISuppressionInfo { + + /** SuppressionInfo reason */ + reason?: (google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason|keyof typeof google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason|null); + + /** SuppressionInfo suppressedCount */ + suppressedCount?: (number|null); + } + + /** Represents a SuppressionInfo. */ + class SuppressionInfo implements ISuppressionInfo { + + /** + * Constructs a new SuppressionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.TailLogEntriesResponse.ISuppressionInfo); + + /** SuppressionInfo reason. */ + public reason: (google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason|keyof typeof google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason); + + /** SuppressionInfo suppressedCount. */ + public suppressedCount: number; + + /** + * Creates a new SuppressionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SuppressionInfo instance + */ + public static create(properties?: google.logging.v2.TailLogEntriesResponse.ISuppressionInfo): google.logging.v2.TailLogEntriesResponse.SuppressionInfo; + + /** + * Encodes the specified SuppressionInfo message. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify|verify} messages. + * @param message SuppressionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.TailLogEntriesResponse.ISuppressionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuppressionInfo message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify|verify} messages. + * @param message SuppressionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.TailLogEntriesResponse.ISuppressionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuppressionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuppressionInfo + * @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.TailLogEntriesResponse.SuppressionInfo; + + /** + * Decodes a SuppressionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuppressionInfo + * @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.TailLogEntriesResponse.SuppressionInfo; + + /** + * Verifies a SuppressionInfo 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 SuppressionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuppressionInfo + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.TailLogEntriesResponse.SuppressionInfo; + + /** + * Creates a plain object from a SuppressionInfo message. Also converts values to other types if specified. + * @param message SuppressionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.TailLogEntriesResponse.SuppressionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuppressionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SuppressionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SuppressionInfo { + + /** Reason enum. */ + enum Reason { + REASON_UNSPECIFIED = 0, + RATE_LIMIT = 1, + NOT_CONSUMED = 2 + } + } + } + + /** Represents a ConfigServiceV2 */ + class ConfigServiceV2 extends $protobuf.rpc.Service { + + /** + * Constructs a new ConfigServiceV2 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 ConfigServiceV2 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): ConfigServiceV2; + + /** + * Calls ListBuckets. + * @param request ListBucketsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBucketsResponse + */ + public listBuckets(request: google.logging.v2.IListBucketsRequest, callback: google.logging.v2.ConfigServiceV2.ListBucketsCallback): void; + + /** + * Calls ListBuckets. + * @param request ListBucketsRequest message or plain object + * @returns Promise + */ + public listBuckets(request: google.logging.v2.IListBucketsRequest): Promise; + + /** + * Calls GetBucket. + * @param request GetBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogBucket + */ + public getBucket(request: google.logging.v2.IGetBucketRequest, callback: google.logging.v2.ConfigServiceV2.GetBucketCallback): void; + + /** + * Calls GetBucket. + * @param request GetBucketRequest message or plain object + * @returns Promise + */ + public getBucket(request: google.logging.v2.IGetBucketRequest): Promise; + + /** + * Calls CreateBucketAsync. + * @param request CreateBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBucketAsync(request: google.logging.v2.ICreateBucketRequest, callback: google.logging.v2.ConfigServiceV2.CreateBucketAsyncCallback): void; + + /** + * Calls CreateBucketAsync. + * @param request CreateBucketRequest message or plain object + * @returns Promise + */ + public createBucketAsync(request: google.logging.v2.ICreateBucketRequest): Promise; + + /** + * Calls UpdateBucketAsync. + * @param request UpdateBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBucketAsync(request: google.logging.v2.IUpdateBucketRequest, callback: google.logging.v2.ConfigServiceV2.UpdateBucketAsyncCallback): void; + + /** + * Calls UpdateBucketAsync. + * @param request UpdateBucketRequest message or plain object + * @returns Promise + */ + public updateBucketAsync(request: google.logging.v2.IUpdateBucketRequest): Promise; + + /** + * Calls CreateBucket. + * @param request CreateBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogBucket + */ + public createBucket(request: google.logging.v2.ICreateBucketRequest, callback: google.logging.v2.ConfigServiceV2.CreateBucketCallback): void; + + /** + * Calls CreateBucket. + * @param request CreateBucketRequest message or plain object + * @returns Promise + */ + public createBucket(request: google.logging.v2.ICreateBucketRequest): Promise; + + /** + * Calls UpdateBucket. + * @param request UpdateBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogBucket + */ + public updateBucket(request: google.logging.v2.IUpdateBucketRequest, callback: google.logging.v2.ConfigServiceV2.UpdateBucketCallback): void; + + /** + * Calls UpdateBucket. + * @param request UpdateBucketRequest message or plain object + * @returns Promise + */ + public updateBucket(request: google.logging.v2.IUpdateBucketRequest): Promise; + + /** + * Calls DeleteBucket. + * @param request DeleteBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBucket(request: google.logging.v2.IDeleteBucketRequest, callback: google.logging.v2.ConfigServiceV2.DeleteBucketCallback): void; + + /** + * Calls DeleteBucket. + * @param request DeleteBucketRequest message or plain object + * @returns Promise + */ + public deleteBucket(request: google.logging.v2.IDeleteBucketRequest): Promise; + + /** + * Calls UndeleteBucket. + * @param request UndeleteBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public undeleteBucket(request: google.logging.v2.IUndeleteBucketRequest, callback: google.logging.v2.ConfigServiceV2.UndeleteBucketCallback): void; + + /** + * Calls UndeleteBucket. + * @param request UndeleteBucketRequest message or plain object + * @returns Promise + */ + public undeleteBucket(request: google.logging.v2.IUndeleteBucketRequest): Promise; + + /** + * Calls ListViews. + * @param request ListViewsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListViewsResponse + */ + public listViews(request: google.logging.v2.IListViewsRequest, callback: google.logging.v2.ConfigServiceV2.ListViewsCallback): void; + + /** + * Calls ListViews. + * @param request ListViewsRequest message or plain object + * @returns Promise + */ + public listViews(request: google.logging.v2.IListViewsRequest): Promise; + + /** + * Calls GetView. + * @param request GetViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogView + */ + public getView(request: google.logging.v2.IGetViewRequest, callback: google.logging.v2.ConfigServiceV2.GetViewCallback): void; + + /** + * Calls GetView. + * @param request GetViewRequest message or plain object + * @returns Promise + */ + public getView(request: google.logging.v2.IGetViewRequest): Promise; + + /** + * Calls CreateView. + * @param request CreateViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogView + */ + public createView(request: google.logging.v2.ICreateViewRequest, callback: google.logging.v2.ConfigServiceV2.CreateViewCallback): void; + + /** + * Calls CreateView. + * @param request CreateViewRequest message or plain object + * @returns Promise + */ + public createView(request: google.logging.v2.ICreateViewRequest): Promise; + + /** + * Calls UpdateView. + * @param request UpdateViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogView + */ + public updateView(request: google.logging.v2.IUpdateViewRequest, callback: google.logging.v2.ConfigServiceV2.UpdateViewCallback): void; + + /** + * Calls UpdateView. + * @param request UpdateViewRequest message or plain object + * @returns Promise + */ + public updateView(request: google.logging.v2.IUpdateViewRequest): Promise; + + /** + * Calls DeleteView. + * @param request DeleteViewRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteView(request: google.logging.v2.IDeleteViewRequest, callback: google.logging.v2.ConfigServiceV2.DeleteViewCallback): void; + + /** + * Calls DeleteView. + * @param request DeleteViewRequest message or plain object + * @returns Promise + */ + public deleteView(request: google.logging.v2.IDeleteViewRequest): Promise; + + /** + * Calls ListSinks. + * @param request ListSinksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSinksResponse + */ + public listSinks(request: google.logging.v2.IListSinksRequest, callback: google.logging.v2.ConfigServiceV2.ListSinksCallback): void; + + /** + * Calls ListSinks. + * @param request ListSinksRequest message or plain object + * @returns Promise + */ + public listSinks(request: google.logging.v2.IListSinksRequest): Promise; + + /** + * Calls GetSink. + * @param request GetSinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogSink + */ + public getSink(request: google.logging.v2.IGetSinkRequest, callback: google.logging.v2.ConfigServiceV2.GetSinkCallback): void; + + /** + * Calls GetSink. + * @param request GetSinkRequest message or plain object + * @returns Promise + */ + public getSink(request: google.logging.v2.IGetSinkRequest): Promise; + + /** + * Calls CreateSink. + * @param request CreateSinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogSink + */ + public createSink(request: google.logging.v2.ICreateSinkRequest, callback: google.logging.v2.ConfigServiceV2.CreateSinkCallback): void; + + /** + * Calls CreateSink. + * @param request CreateSinkRequest message or plain object + * @returns Promise + */ + public createSink(request: google.logging.v2.ICreateSinkRequest): Promise; + + /** + * Calls UpdateSink. + * @param request UpdateSinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogSink + */ + public updateSink(request: google.logging.v2.IUpdateSinkRequest, callback: google.logging.v2.ConfigServiceV2.UpdateSinkCallback): void; + + /** + * Calls UpdateSink. + * @param request UpdateSinkRequest message or plain object + * @returns Promise + */ + public updateSink(request: google.logging.v2.IUpdateSinkRequest): Promise; + + /** + * Calls DeleteSink. + * @param request DeleteSinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSink(request: google.logging.v2.IDeleteSinkRequest, callback: google.logging.v2.ConfigServiceV2.DeleteSinkCallback): void; + + /** + * Calls DeleteSink. + * @param request DeleteSinkRequest message or plain object + * @returns Promise + */ + public deleteSink(request: google.logging.v2.IDeleteSinkRequest): Promise; + + /** + * Calls CreateLink. + * @param request CreateLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createLink(request: google.logging.v2.ICreateLinkRequest, callback: google.logging.v2.ConfigServiceV2.CreateLinkCallback): void; + + /** + * Calls CreateLink. + * @param request CreateLinkRequest message or plain object + * @returns Promise + */ + public createLink(request: google.logging.v2.ICreateLinkRequest): Promise; + + /** + * Calls DeleteLink. + * @param request DeleteLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteLink(request: google.logging.v2.IDeleteLinkRequest, callback: google.logging.v2.ConfigServiceV2.DeleteLinkCallback): void; + + /** + * Calls DeleteLink. + * @param request DeleteLinkRequest message or plain object + * @returns Promise + */ + public deleteLink(request: google.logging.v2.IDeleteLinkRequest): Promise; + + /** + * Calls ListLinks. + * @param request ListLinksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLinksResponse + */ + public listLinks(request: google.logging.v2.IListLinksRequest, callback: google.logging.v2.ConfigServiceV2.ListLinksCallback): void; + + /** + * Calls ListLinks. + * @param request ListLinksRequest message or plain object + * @returns Promise + */ + public listLinks(request: google.logging.v2.IListLinksRequest): Promise; + + /** + * Calls GetLink. + * @param request GetLinkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Link + */ + public getLink(request: google.logging.v2.IGetLinkRequest, callback: google.logging.v2.ConfigServiceV2.GetLinkCallback): void; + + /** + * Calls GetLink. + * @param request GetLinkRequest message or plain object + * @returns Promise + */ + public getLink(request: google.logging.v2.IGetLinkRequest): Promise; + + /** + * Calls ListExclusions. + * @param request ListExclusionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListExclusionsResponse + */ + public listExclusions(request: google.logging.v2.IListExclusionsRequest, callback: google.logging.v2.ConfigServiceV2.ListExclusionsCallback): void; + + /** + * Calls ListExclusions. + * @param request ListExclusionsRequest message or plain object + * @returns Promise + */ + public listExclusions(request: google.logging.v2.IListExclusionsRequest): Promise; + + /** + * Calls GetExclusion. + * @param request GetExclusionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogExclusion + */ + public getExclusion(request: google.logging.v2.IGetExclusionRequest, callback: google.logging.v2.ConfigServiceV2.GetExclusionCallback): void; + + /** + * Calls GetExclusion. + * @param request GetExclusionRequest message or plain object + * @returns Promise + */ + public getExclusion(request: google.logging.v2.IGetExclusionRequest): Promise; + + /** + * Calls CreateExclusion. + * @param request CreateExclusionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogExclusion + */ + public createExclusion(request: google.logging.v2.ICreateExclusionRequest, callback: google.logging.v2.ConfigServiceV2.CreateExclusionCallback): void; + + /** + * Calls CreateExclusion. + * @param request CreateExclusionRequest message or plain object + * @returns Promise + */ + public createExclusion(request: google.logging.v2.ICreateExclusionRequest): Promise; + + /** + * Calls UpdateExclusion. + * @param request UpdateExclusionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogExclusion + */ + public updateExclusion(request: google.logging.v2.IUpdateExclusionRequest, callback: google.logging.v2.ConfigServiceV2.UpdateExclusionCallback): void; + + /** + * Calls UpdateExclusion. + * @param request UpdateExclusionRequest message or plain object + * @returns Promise + */ + public updateExclusion(request: google.logging.v2.IUpdateExclusionRequest): Promise; + + /** + * Calls DeleteExclusion. + * @param request DeleteExclusionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteExclusion(request: google.logging.v2.IDeleteExclusionRequest, callback: google.logging.v2.ConfigServiceV2.DeleteExclusionCallback): void; + + /** + * Calls DeleteExclusion. + * @param request DeleteExclusionRequest message or plain object + * @returns Promise + */ + public deleteExclusion(request: google.logging.v2.IDeleteExclusionRequest): Promise; + + /** + * Calls GetCmekSettings. + * @param request GetCmekSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CmekSettings + */ + public getCmekSettings(request: google.logging.v2.IGetCmekSettingsRequest, callback: google.logging.v2.ConfigServiceV2.GetCmekSettingsCallback): void; + + /** + * Calls GetCmekSettings. + * @param request GetCmekSettingsRequest message or plain object + * @returns Promise + */ + public getCmekSettings(request: google.logging.v2.IGetCmekSettingsRequest): Promise; + + /** + * Calls UpdateCmekSettings. + * @param request UpdateCmekSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CmekSettings + */ + public updateCmekSettings(request: google.logging.v2.IUpdateCmekSettingsRequest, callback: google.logging.v2.ConfigServiceV2.UpdateCmekSettingsCallback): void; + + /** + * Calls UpdateCmekSettings. + * @param request UpdateCmekSettingsRequest message or plain object + * @returns Promise + */ + public updateCmekSettings(request: google.logging.v2.IUpdateCmekSettingsRequest): Promise; + + /** + * 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 { + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listBuckets}. + * @param error Error, if any + * @param [response] ListBucketsResponse + */ + type ListBucketsCallback = (error: (Error|null), response?: google.logging.v2.ListBucketsResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getBucket}. + * @param error Error, if any + * @param [response] LogBucket + */ + type GetBucketCallback = (error: (Error|null), response?: google.logging.v2.LogBucket) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createBucketAsync}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBucketAsyncCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateBucketAsync}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBucketAsyncCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createBucket}. + * @param error Error, if any + * @param [response] LogBucket + */ + type CreateBucketCallback = (error: (Error|null), response?: google.logging.v2.LogBucket) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateBucket}. + * @param error Error, if any + * @param [response] LogBucket + */ + type UpdateBucketCallback = (error: (Error|null), response?: google.logging.v2.LogBucket) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteBucket}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBucketCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|undeleteBucket}. + * @param error Error, if any + * @param [response] Empty + */ + type UndeleteBucketCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listViews}. + * @param error Error, if any + * @param [response] ListViewsResponse + */ + type ListViewsCallback = (error: (Error|null), response?: google.logging.v2.ListViewsResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getView}. + * @param error Error, if any + * @param [response] LogView + */ + type GetViewCallback = (error: (Error|null), response?: google.logging.v2.LogView) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createView}. + * @param error Error, if any + * @param [response] LogView + */ + type CreateViewCallback = (error: (Error|null), response?: google.logging.v2.LogView) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateView}. + * @param error Error, if any + * @param [response] LogView + */ + type UpdateViewCallback = (error: (Error|null), response?: google.logging.v2.LogView) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteView}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteViewCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listSinks}. + * @param error Error, if any + * @param [response] ListSinksResponse + */ + type ListSinksCallback = (error: (Error|null), response?: google.logging.v2.ListSinksResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getSink}. + * @param error Error, if any + * @param [response] LogSink + */ + type GetSinkCallback = (error: (Error|null), response?: google.logging.v2.LogSink) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createSink}. + * @param error Error, if any + * @param [response] LogSink + */ + type CreateSinkCallback = (error: (Error|null), response?: google.logging.v2.LogSink) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateSink}. + * @param error Error, if any + * @param [response] LogSink + */ + type UpdateSinkCallback = (error: (Error|null), response?: google.logging.v2.LogSink) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteSink}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSinkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createLink}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateLinkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteLink}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteLinkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listLinks}. + * @param error Error, if any + * @param [response] ListLinksResponse + */ + type ListLinksCallback = (error: (Error|null), response?: google.logging.v2.ListLinksResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getLink}. + * @param error Error, if any + * @param [response] Link + */ + type GetLinkCallback = (error: (Error|null), response?: google.logging.v2.Link) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listExclusions}. + * @param error Error, if any + * @param [response] ListExclusionsResponse + */ + type ListExclusionsCallback = (error: (Error|null), response?: google.logging.v2.ListExclusionsResponse) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getExclusion}. + * @param error Error, if any + * @param [response] LogExclusion + */ + type GetExclusionCallback = (error: (Error|null), response?: google.logging.v2.LogExclusion) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createExclusion}. + * @param error Error, if any + * @param [response] LogExclusion + */ + type CreateExclusionCallback = (error: (Error|null), response?: google.logging.v2.LogExclusion) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateExclusion}. + * @param error Error, if any + * @param [response] LogExclusion + */ + type UpdateExclusionCallback = (error: (Error|null), response?: google.logging.v2.LogExclusion) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteExclusion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteExclusionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getCmekSettings}. + * @param error Error, if any + * @param [response] CmekSettings + */ + type GetCmekSettingsCallback = (error: (Error|null), response?: google.logging.v2.CmekSettings) => void; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateCmekSettings}. + * @param error Error, if any + * @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 an IndexConfig. */ + interface IIndexConfig { + + /** IndexConfig fieldPath */ + fieldPath?: (string|null); + + /** IndexConfig type */ + type?: (google.logging.v2.IndexType|keyof typeof google.logging.v2.IndexType|null); + + /** IndexConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an IndexConfig. */ + class IndexConfig implements IIndexConfig { + + /** + * Constructs a new IndexConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IIndexConfig); + + /** IndexConfig fieldPath. */ + public fieldPath: string; + + /** IndexConfig type. */ + public type: (google.logging.v2.IndexType|keyof typeof google.logging.v2.IndexType); + + /** IndexConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new IndexConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexConfig instance + */ + public static create(properties?: google.logging.v2.IIndexConfig): google.logging.v2.IndexConfig; + + /** + * Encodes the specified IndexConfig message. Does not implicitly {@link google.logging.v2.IndexConfig.verify|verify} messages. + * @param message IndexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IIndexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndexConfig message, length delimited. Does not implicitly {@link google.logging.v2.IndexConfig.verify|verify} messages. + * @param message IndexConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IIndexConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndexConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexConfig + * @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.IndexConfig; + + /** + * Decodes an IndexConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexConfig + * @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.IndexConfig; + + /** + * Verifies an IndexConfig 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 IndexConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexConfig + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.IndexConfig; + + /** + * Creates a plain object from an IndexConfig message. Also converts values to other types if specified. + * @param message IndexConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.IndexConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndexConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndexConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogBucket. */ + interface ILogBucket { + + /** LogBucket name */ + name?: (string|null); + + /** LogBucket description */ + description?: (string|null); + + /** LogBucket createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** LogBucket updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** LogBucket retentionDays */ + retentionDays?: (number|null); + + /** LogBucket locked */ + locked?: (boolean|null); + + /** LogBucket lifecycleState */ + lifecycleState?: (google.logging.v2.LifecycleState|keyof typeof google.logging.v2.LifecycleState|null); + + /** LogBucket analyticsEnabled */ + analyticsEnabled?: (boolean|null); + + /** LogBucket restrictedFields */ + restrictedFields?: (string[]|null); + + /** LogBucket indexConfigs */ + indexConfigs?: (google.logging.v2.IIndexConfig[]|null); + + /** LogBucket cmekSettings */ + cmekSettings?: (google.logging.v2.ICmekSettings|null); + } + + /** Represents a LogBucket. */ + class LogBucket implements ILogBucket { + + /** + * Constructs a new LogBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogBucket); + + /** LogBucket name. */ + public name: string; + + /** LogBucket description. */ + public description: string; + + /** LogBucket createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** LogBucket updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** LogBucket retentionDays. */ + public retentionDays: number; + + /** LogBucket locked. */ + public locked: boolean; + + /** LogBucket lifecycleState. */ + public lifecycleState: (google.logging.v2.LifecycleState|keyof typeof google.logging.v2.LifecycleState); + + /** LogBucket analyticsEnabled. */ + public analyticsEnabled: boolean; + + /** LogBucket restrictedFields. */ + public restrictedFields: string[]; + + /** LogBucket indexConfigs. */ + public indexConfigs: google.logging.v2.IIndexConfig[]; + + /** LogBucket cmekSettings. */ + public cmekSettings?: (google.logging.v2.ICmekSettings|null); + + /** + * Creates a new LogBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns LogBucket instance + */ + public static create(properties?: google.logging.v2.ILogBucket): google.logging.v2.LogBucket; + + /** + * Encodes the specified LogBucket message. Does not implicitly {@link google.logging.v2.LogBucket.verify|verify} messages. + * @param message LogBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogBucket message, length delimited. Does not implicitly {@link google.logging.v2.LogBucket.verify|verify} messages. + * @param message LogBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogBucket + * @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.LogBucket; + + /** + * Decodes a LogBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogBucket + * @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.LogBucket; + + /** + * Verifies a LogBucket 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 LogBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogBucket + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogBucket; + + /** + * Creates a plain object from a LogBucket message. Also converts values to other types if specified. + * @param message LogBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogView. */ + interface ILogView { + + /** LogView name */ + name?: (string|null); + + /** LogView description */ + description?: (string|null); + + /** LogView createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** LogView updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** LogView filter */ + filter?: (string|null); + } + + /** Represents a LogView. */ + class LogView implements ILogView { + + /** + * Constructs a new LogView. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogView); + + /** LogView name. */ + public name: string; + + /** LogView description. */ + public description: string; + + /** LogView createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** LogView updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** LogView filter. */ + public filter: string; + + /** + * Creates a new LogView instance using the specified properties. + * @param [properties] Properties to set + * @returns LogView instance + */ + public static create(properties?: google.logging.v2.ILogView): google.logging.v2.LogView; + + /** + * Encodes the specified LogView message. Does not implicitly {@link google.logging.v2.LogView.verify|verify} messages. + * @param message LogView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogView message, length delimited. Does not implicitly {@link google.logging.v2.LogView.verify|verify} messages. + * @param message LogView message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogView, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogView message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogView + * @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.LogView; + + /** + * Decodes a LogView message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogView + * @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.LogView; + + /** + * Verifies a LogView 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 LogView message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogView + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogView; + + /** + * Creates a plain object from a LogView message. Also converts values to other types if specified. + * @param message LogView + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogView, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogView to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogView + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogSink. */ + interface ILogSink { + + /** LogSink name */ + name?: (string|null); + + /** LogSink destination */ + destination?: (string|null); + + /** LogSink filter */ + filter?: (string|null); + + /** LogSink description */ + description?: (string|null); + + /** LogSink disabled */ + disabled?: (boolean|null); + + /** LogSink exclusions */ + exclusions?: (google.logging.v2.ILogExclusion[]|null); + + /** LogSink outputVersionFormat */ + outputVersionFormat?: (google.logging.v2.LogSink.VersionFormat|keyof typeof google.logging.v2.LogSink.VersionFormat|null); + + /** LogSink writerIdentity */ + writerIdentity?: (string|null); + + /** LogSink includeChildren */ + includeChildren?: (boolean|null); + + /** LogSink bigqueryOptions */ + bigqueryOptions?: (google.logging.v2.IBigQueryOptions|null); + + /** LogSink createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** LogSink updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a LogSink. */ + class LogSink implements ILogSink { + + /** + * Constructs a new LogSink. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogSink); + + /** LogSink name. */ + public name: string; + + /** LogSink destination. */ + public destination: string; + + /** LogSink filter. */ + public filter: string; + + /** LogSink description. */ + public description: string; + + /** LogSink disabled. */ + public disabled: boolean; + + /** LogSink exclusions. */ + public exclusions: google.logging.v2.ILogExclusion[]; + + /** LogSink outputVersionFormat. */ + public outputVersionFormat: (google.logging.v2.LogSink.VersionFormat|keyof typeof google.logging.v2.LogSink.VersionFormat); + + /** LogSink writerIdentity. */ + public writerIdentity: string; + + /** LogSink includeChildren. */ + public includeChildren: boolean; + + /** LogSink bigqueryOptions. */ + public bigqueryOptions?: (google.logging.v2.IBigQueryOptions|null); + + /** LogSink createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** LogSink updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** LogSink options. */ + public options?: "bigqueryOptions"; + + /** + * Creates a new LogSink instance using the specified properties. + * @param [properties] Properties to set + * @returns LogSink instance + */ + public static create(properties?: google.logging.v2.ILogSink): google.logging.v2.LogSink; + + /** + * Encodes the specified LogSink message. Does not implicitly {@link google.logging.v2.LogSink.verify|verify} messages. + * @param message LogSink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogSink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogSink message, length delimited. Does not implicitly {@link google.logging.v2.LogSink.verify|verify} messages. + * @param message LogSink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogSink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogSink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogSink + * @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.LogSink; + + /** + * Decodes a LogSink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogSink + * @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.LogSink; + + /** + * Verifies a LogSink 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 LogSink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogSink + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogSink; + + /** + * Creates a plain object from a LogSink message. Also converts values to other types if specified. + * @param message LogSink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogSink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogSink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogSink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogSink { + + /** VersionFormat enum. */ + enum VersionFormat { + VERSION_FORMAT_UNSPECIFIED = 0, + V2 = 1, + V1 = 2 + } + } + + /** Properties of a BigQueryDataset. */ + interface IBigQueryDataset { + + /** BigQueryDataset datasetId */ + datasetId?: (string|null); + } + + /** Represents a BigQueryDataset. */ + class BigQueryDataset implements IBigQueryDataset { + + /** + * Constructs a new BigQueryDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IBigQueryDataset); + + /** BigQueryDataset datasetId. */ + public datasetId: string; + + /** + * Creates a new BigQueryDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDataset instance + */ + public static create(properties?: google.logging.v2.IBigQueryDataset): google.logging.v2.BigQueryDataset; + + /** + * Encodes the specified BigQueryDataset message. Does not implicitly {@link google.logging.v2.BigQueryDataset.verify|verify} messages. + * @param message BigQueryDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IBigQueryDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDataset message, length delimited. Does not implicitly {@link google.logging.v2.BigQueryDataset.verify|verify} messages. + * @param message BigQueryDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IBigQueryDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDataset + * @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.BigQueryDataset; + + /** + * Decodes a BigQueryDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDataset + * @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.BigQueryDataset; + + /** + * Verifies a BigQueryDataset 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 BigQueryDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDataset + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.BigQueryDataset; + + /** + * Creates a plain object from a BigQueryDataset message. Also converts values to other types if specified. + * @param message BigQueryDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.BigQueryDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Link. */ + interface ILink { + + /** Link name */ + name?: (string|null); + + /** Link description */ + description?: (string|null); + + /** Link createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Link lifecycleState */ + lifecycleState?: (google.logging.v2.LifecycleState|keyof typeof google.logging.v2.LifecycleState|null); + + /** Link bigqueryDataset */ + bigqueryDataset?: (google.logging.v2.IBigQueryDataset|null); + } + + /** Represents a Link. */ + class Link implements ILink { + + /** + * Constructs a new Link. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILink); + + /** Link name. */ + public name: string; + + /** Link description. */ + public description: string; + + /** Link createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Link lifecycleState. */ + public lifecycleState: (google.logging.v2.LifecycleState|keyof typeof google.logging.v2.LifecycleState); + + /** Link bigqueryDataset. */ + public bigqueryDataset?: (google.logging.v2.IBigQueryDataset|null); + + /** + * Creates a new Link instance using the specified properties. + * @param [properties] Properties to set + * @returns Link instance + */ + public static create(properties?: google.logging.v2.ILink): google.logging.v2.Link; + + /** + * Encodes the specified Link message. Does not implicitly {@link google.logging.v2.Link.verify|verify} messages. + * @param message Link message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Link message, length delimited. Does not implicitly {@link google.logging.v2.Link.verify|verify} messages. + * @param message Link message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Link message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Link + * @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.Link; + + /** + * Decodes a Link message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Link + * @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.Link; + + /** + * Verifies a Link 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 Link message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Link + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.Link; + + /** + * Creates a plain object from a Link message. Also converts values to other types if specified. + * @param message Link + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.Link, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Link to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Link + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryOptions. */ + interface IBigQueryOptions { + + /** BigQueryOptions usePartitionedTables */ + usePartitionedTables?: (boolean|null); + + /** BigQueryOptions usesTimestampColumnPartitioning */ + usesTimestampColumnPartitioning?: (boolean|null); + } + + /** Represents a BigQueryOptions. */ + class BigQueryOptions implements IBigQueryOptions { + + /** + * Constructs a new BigQueryOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IBigQueryOptions); + + /** BigQueryOptions usePartitionedTables. */ + public usePartitionedTables: boolean; + + /** BigQueryOptions usesTimestampColumnPartitioning. */ + public usesTimestampColumnPartitioning: boolean; + + /** + * Creates a new BigQueryOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryOptions instance + */ + public static create(properties?: google.logging.v2.IBigQueryOptions): google.logging.v2.BigQueryOptions; + + /** + * Encodes the specified BigQueryOptions message. Does not implicitly {@link google.logging.v2.BigQueryOptions.verify|verify} messages. + * @param message BigQueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IBigQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryOptions message, length delimited. Does not implicitly {@link google.logging.v2.BigQueryOptions.verify|verify} messages. + * @param message BigQueryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IBigQueryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryOptions + * @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.BigQueryOptions; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryOptions + * @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.BigQueryOptions; + + /** + * Verifies a BigQueryOptions 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 BigQueryOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryOptions + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.BigQueryOptions; + + /** + * Creates a plain object from a BigQueryOptions message. Also converts values to other types if specified. + * @param message BigQueryOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.BigQueryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBucketsRequest. */ + interface IListBucketsRequest { + + /** ListBucketsRequest parent */ + parent?: (string|null); + + /** ListBucketsRequest pageToken */ + pageToken?: (string|null); + + /** ListBucketsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListBucketsRequest. */ + class ListBucketsRequest implements IListBucketsRequest { + + /** + * Constructs a new ListBucketsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListBucketsRequest); + + /** ListBucketsRequest parent. */ + public parent: string; + + /** ListBucketsRequest pageToken. */ + public pageToken: string; + + /** ListBucketsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListBucketsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBucketsRequest instance + */ + public static create(properties?: google.logging.v2.IListBucketsRequest): google.logging.v2.ListBucketsRequest; + + /** + * Encodes the specified ListBucketsRequest message. Does not implicitly {@link google.logging.v2.ListBucketsRequest.verify|verify} messages. + * @param message ListBucketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListBucketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBucketsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListBucketsRequest.verify|verify} messages. + * @param message ListBucketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListBucketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBucketsRequest + * @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.ListBucketsRequest; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBucketsRequest + * @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.ListBucketsRequest; + + /** + * Verifies a ListBucketsRequest 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 ListBucketsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBucketsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListBucketsRequest; + + /** + * Creates a plain object from a ListBucketsRequest message. Also converts values to other types if specified. + * @param message ListBucketsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListBucketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBucketsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBucketsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBucketsResponse. */ + interface IListBucketsResponse { + + /** ListBucketsResponse buckets */ + buckets?: (google.logging.v2.ILogBucket[]|null); + + /** ListBucketsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBucketsResponse. */ + class ListBucketsResponse implements IListBucketsResponse { + + /** + * Constructs a new ListBucketsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListBucketsResponse); + + /** ListBucketsResponse buckets. */ + public buckets: google.logging.v2.ILogBucket[]; + + /** ListBucketsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBucketsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBucketsResponse instance + */ + public static create(properties?: google.logging.v2.IListBucketsResponse): google.logging.v2.ListBucketsResponse; + + /** + * Encodes the specified ListBucketsResponse message. Does not implicitly {@link google.logging.v2.ListBucketsResponse.verify|verify} messages. + * @param message ListBucketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListBucketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBucketsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListBucketsResponse.verify|verify} messages. + * @param message ListBucketsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListBucketsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBucketsResponse + * @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.ListBucketsResponse; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBucketsResponse + * @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.ListBucketsResponse; + + /** + * Verifies a ListBucketsResponse 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 ListBucketsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBucketsResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListBucketsResponse; + + /** + * Creates a plain object from a ListBucketsResponse message. Also converts values to other types if specified. + * @param message ListBucketsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListBucketsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBucketsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBucketsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBucketRequest. */ + interface ICreateBucketRequest { + + /** CreateBucketRequest parent */ + parent?: (string|null); + + /** CreateBucketRequest bucketId */ + bucketId?: (string|null); + + /** CreateBucketRequest bucket */ + bucket?: (google.logging.v2.ILogBucket|null); + } + + /** Represents a CreateBucketRequest. */ + class CreateBucketRequest implements ICreateBucketRequest { + + /** + * Constructs a new CreateBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateBucketRequest); + + /** CreateBucketRequest parent. */ + public parent: string; + + /** CreateBucketRequest bucketId. */ + public bucketId: string; + + /** CreateBucketRequest bucket. */ + public bucket?: (google.logging.v2.ILogBucket|null); + + /** + * Creates a new CreateBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBucketRequest instance + */ + public static create(properties?: google.logging.v2.ICreateBucketRequest): google.logging.v2.CreateBucketRequest; + + /** + * Encodes the specified CreateBucketRequest message. Does not implicitly {@link google.logging.v2.CreateBucketRequest.verify|verify} messages. + * @param message CreateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICreateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateBucketRequest.verify|verify} messages. + * @param message CreateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICreateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBucketRequest + * @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.CreateBucketRequest; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBucketRequest + * @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.CreateBucketRequest; + + /** + * Verifies a CreateBucketRequest 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 CreateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateBucketRequest; + + /** + * Creates a plain object from a CreateBucketRequest message. Also converts values to other types if specified. + * @param message CreateBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CreateBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBucketRequest. */ + interface IUpdateBucketRequest { + + /** UpdateBucketRequest name */ + name?: (string|null); + + /** UpdateBucketRequest bucket */ + bucket?: (google.logging.v2.ILogBucket|null); + + /** UpdateBucketRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBucketRequest. */ + class UpdateBucketRequest implements IUpdateBucketRequest { + + /** + * Constructs a new UpdateBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUpdateBucketRequest); + + /** UpdateBucketRequest name. */ + public name: string; + + /** UpdateBucketRequest bucket. */ + public bucket?: (google.logging.v2.ILogBucket|null); + + /** UpdateBucketRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBucketRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateBucketRequest): google.logging.v2.UpdateBucketRequest; + + /** + * Encodes the specified UpdateBucketRequest message. Does not implicitly {@link google.logging.v2.UpdateBucketRequest.verify|verify} messages. + * @param message UpdateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUpdateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateBucketRequest.verify|verify} messages. + * @param message UpdateBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUpdateBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBucketRequest + * @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.UpdateBucketRequest; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBucketRequest + * @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.UpdateBucketRequest; + + /** + * Verifies an UpdateBucketRequest 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 UpdateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateBucketRequest; + + /** + * Creates a plain object from an UpdateBucketRequest message. Also converts values to other types if specified. + * @param message UpdateBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBucketRequest. */ + interface IGetBucketRequest { + + /** GetBucketRequest name */ + name?: (string|null); + } + + /** Represents a GetBucketRequest. */ + class GetBucketRequest implements IGetBucketRequest { + + /** + * Constructs a new GetBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetBucketRequest); + + /** GetBucketRequest name. */ + public name: string; + + /** + * Creates a new GetBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBucketRequest instance + */ + public static create(properties?: google.logging.v2.IGetBucketRequest): google.logging.v2.GetBucketRequest; + + /** + * Encodes the specified GetBucketRequest message. Does not implicitly {@link google.logging.v2.GetBucketRequest.verify|verify} messages. + * @param message GetBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetBucketRequest.verify|verify} messages. + * @param message GetBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBucketRequest + * @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.GetBucketRequest; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBucketRequest + * @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.GetBucketRequest; + + /** + * Verifies a GetBucketRequest 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 GetBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetBucketRequest; + + /** + * Creates a plain object from a GetBucketRequest message. Also converts values to other types if specified. + * @param message GetBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBucketRequest. */ + interface IDeleteBucketRequest { + + /** DeleteBucketRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBucketRequest. */ + class DeleteBucketRequest implements IDeleteBucketRequest { + + /** + * Constructs a new DeleteBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteBucketRequest); + + /** DeleteBucketRequest name. */ + public name: string; + + /** + * Creates a new DeleteBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBucketRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteBucketRequest): google.logging.v2.DeleteBucketRequest; + + /** + * Encodes the specified DeleteBucketRequest message. Does not implicitly {@link google.logging.v2.DeleteBucketRequest.verify|verify} messages. + * @param message DeleteBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteBucketRequest.verify|verify} messages. + * @param message DeleteBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBucketRequest + * @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.DeleteBucketRequest; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBucketRequest + * @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.DeleteBucketRequest; + + /** + * Verifies a DeleteBucketRequest 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 DeleteBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteBucketRequest; + + /** + * Creates a plain object from a DeleteBucketRequest message. Also converts values to other types if specified. + * @param message DeleteBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeleteBucketRequest. */ + interface IUndeleteBucketRequest { + + /** UndeleteBucketRequest name */ + name?: (string|null); + } + + /** Represents an UndeleteBucketRequest. */ + class UndeleteBucketRequest implements IUndeleteBucketRequest { + + /** + * Constructs a new UndeleteBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUndeleteBucketRequest); + + /** UndeleteBucketRequest name. */ + public name: string; + + /** + * Creates a new UndeleteBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeleteBucketRequest instance + */ + public static create(properties?: google.logging.v2.IUndeleteBucketRequest): google.logging.v2.UndeleteBucketRequest; + + /** + * Encodes the specified UndeleteBucketRequest message. Does not implicitly {@link google.logging.v2.UndeleteBucketRequest.verify|verify} messages. + * @param message UndeleteBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUndeleteBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeleteBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.UndeleteBucketRequest.verify|verify} messages. + * @param message UndeleteBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUndeleteBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeleteBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeleteBucketRequest + * @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.UndeleteBucketRequest; + + /** + * Decodes an UndeleteBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeleteBucketRequest + * @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.UndeleteBucketRequest; + + /** + * Verifies an UndeleteBucketRequest 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 UndeleteBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeleteBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UndeleteBucketRequest; + + /** + * Creates a plain object from an UndeleteBucketRequest message. Also converts values to other types if specified. + * @param message UndeleteBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UndeleteBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeleteBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeleteBucketRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListViewsRequest. */ + interface IListViewsRequest { + + /** ListViewsRequest parent */ + parent?: (string|null); + + /** ListViewsRequest pageToken */ + pageToken?: (string|null); + + /** ListViewsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListViewsRequest. */ + class ListViewsRequest implements IListViewsRequest { + + /** + * Constructs a new ListViewsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListViewsRequest); + + /** ListViewsRequest parent. */ + public parent: string; + + /** ListViewsRequest pageToken. */ + public pageToken: string; + + /** ListViewsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListViewsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListViewsRequest instance + */ + public static create(properties?: google.logging.v2.IListViewsRequest): google.logging.v2.ListViewsRequest; + + /** + * Encodes the specified ListViewsRequest message. Does not implicitly {@link google.logging.v2.ListViewsRequest.verify|verify} messages. + * @param message ListViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListViewsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListViewsRequest.verify|verify} messages. + * @param message ListViewsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListViewsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListViewsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListViewsRequest + * @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.ListViewsRequest; + + /** + * Decodes a ListViewsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListViewsRequest + * @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.ListViewsRequest; + + /** + * Verifies a ListViewsRequest 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 ListViewsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListViewsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListViewsRequest; + + /** + * Creates a plain object from a ListViewsRequest message. Also converts values to other types if specified. + * @param message ListViewsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListViewsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListViewsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListViewsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListViewsResponse. */ + interface IListViewsResponse { + + /** ListViewsResponse views */ + views?: (google.logging.v2.ILogView[]|null); + + /** ListViewsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListViewsResponse. */ + class ListViewsResponse implements IListViewsResponse { + + /** + * Constructs a new ListViewsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListViewsResponse); + + /** ListViewsResponse views. */ + public views: google.logging.v2.ILogView[]; + + /** ListViewsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListViewsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListViewsResponse instance + */ + public static create(properties?: google.logging.v2.IListViewsResponse): google.logging.v2.ListViewsResponse; + + /** + * Encodes the specified ListViewsResponse message. Does not implicitly {@link google.logging.v2.ListViewsResponse.verify|verify} messages. + * @param message ListViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListViewsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListViewsResponse.verify|verify} messages. + * @param message ListViewsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListViewsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListViewsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListViewsResponse + * @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.ListViewsResponse; + + /** + * Decodes a ListViewsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListViewsResponse + * @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.ListViewsResponse; + + /** + * Verifies a ListViewsResponse 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 ListViewsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListViewsResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListViewsResponse; + + /** + * Creates a plain object from a ListViewsResponse message. Also converts values to other types if specified. + * @param message ListViewsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListViewsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListViewsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListViewsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateViewRequest. */ + interface ICreateViewRequest { + + /** CreateViewRequest parent */ + parent?: (string|null); + + /** CreateViewRequest viewId */ + viewId?: (string|null); + + /** CreateViewRequest view */ + view?: (google.logging.v2.ILogView|null); + } + + /** Represents a CreateViewRequest. */ + class CreateViewRequest implements ICreateViewRequest { + + /** + * Constructs a new CreateViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateViewRequest); + + /** CreateViewRequest parent. */ + public parent: string; + + /** CreateViewRequest viewId. */ + public viewId: string; + + /** CreateViewRequest view. */ + public view?: (google.logging.v2.ILogView|null); + + /** + * Creates a new CreateViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateViewRequest instance + */ + public static create(properties?: google.logging.v2.ICreateViewRequest): google.logging.v2.CreateViewRequest; + + /** + * Encodes the specified CreateViewRequest message. Does not implicitly {@link google.logging.v2.CreateViewRequest.verify|verify} messages. + * @param message CreateViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICreateViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateViewRequest.verify|verify} messages. + * @param message CreateViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICreateViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateViewRequest + * @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.CreateViewRequest; + + /** + * Decodes a CreateViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateViewRequest + * @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.CreateViewRequest; + + /** + * Verifies a CreateViewRequest 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 CreateViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateViewRequest; + + /** + * Creates a plain object from a CreateViewRequest message. Also converts values to other types if specified. + * @param message CreateViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CreateViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateViewRequest. */ + interface IUpdateViewRequest { + + /** UpdateViewRequest name */ + name?: (string|null); + + /** UpdateViewRequest view */ + view?: (google.logging.v2.ILogView|null); + + /** UpdateViewRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateViewRequest. */ + class UpdateViewRequest implements IUpdateViewRequest { + + /** + * Constructs a new UpdateViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUpdateViewRequest); + + /** UpdateViewRequest name. */ + public name: string; + + /** UpdateViewRequest view. */ + public view?: (google.logging.v2.ILogView|null); + + /** UpdateViewRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateViewRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateViewRequest): google.logging.v2.UpdateViewRequest; + + /** + * Encodes the specified UpdateViewRequest message. Does not implicitly {@link google.logging.v2.UpdateViewRequest.verify|verify} messages. + * @param message UpdateViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUpdateViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateViewRequest.verify|verify} messages. + * @param message UpdateViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUpdateViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateViewRequest + * @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.UpdateViewRequest; + + /** + * Decodes an UpdateViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateViewRequest + * @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.UpdateViewRequest; + + /** + * Verifies an UpdateViewRequest 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 UpdateViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateViewRequest; + + /** + * Creates a plain object from an UpdateViewRequest message. Also converts values to other types if specified. + * @param message UpdateViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetViewRequest. */ + interface IGetViewRequest { + + /** GetViewRequest name */ + name?: (string|null); + } + + /** Represents a GetViewRequest. */ + class GetViewRequest implements IGetViewRequest { + + /** + * Constructs a new GetViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetViewRequest); + + /** GetViewRequest name. */ + public name: string; + + /** + * Creates a new GetViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetViewRequest instance + */ + public static create(properties?: google.logging.v2.IGetViewRequest): google.logging.v2.GetViewRequest; + + /** + * Encodes the specified GetViewRequest message. Does not implicitly {@link google.logging.v2.GetViewRequest.verify|verify} messages. + * @param message GetViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetViewRequest.verify|verify} messages. + * @param message GetViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetViewRequest + * @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.GetViewRequest; + + /** + * Decodes a GetViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetViewRequest + * @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.GetViewRequest; + + /** + * Verifies a GetViewRequest 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 GetViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetViewRequest; + + /** + * Creates a plain object from a GetViewRequest message. Also converts values to other types if specified. + * @param message GetViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteViewRequest. */ + interface IDeleteViewRequest { + + /** DeleteViewRequest name */ + name?: (string|null); + } + + /** Represents a DeleteViewRequest. */ + class DeleteViewRequest implements IDeleteViewRequest { + + /** + * Constructs a new DeleteViewRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteViewRequest); + + /** DeleteViewRequest name. */ + public name: string; + + /** + * Creates a new DeleteViewRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteViewRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteViewRequest): google.logging.v2.DeleteViewRequest; + + /** + * Encodes the specified DeleteViewRequest message. Does not implicitly {@link google.logging.v2.DeleteViewRequest.verify|verify} messages. + * @param message DeleteViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteViewRequest.verify|verify} messages. + * @param message DeleteViewRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteViewRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteViewRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteViewRequest + * @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.DeleteViewRequest; + + /** + * Decodes a DeleteViewRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteViewRequest + * @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.DeleteViewRequest; + + /** + * Verifies a DeleteViewRequest 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 DeleteViewRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteViewRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteViewRequest; + + /** + * Creates a plain object from a DeleteViewRequest message. Also converts values to other types if specified. + * @param message DeleteViewRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteViewRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteViewRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteViewRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSinksRequest. */ + interface IListSinksRequest { + + /** ListSinksRequest parent */ + parent?: (string|null); + + /** ListSinksRequest pageToken */ + pageToken?: (string|null); + + /** ListSinksRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListSinksRequest. */ + class ListSinksRequest implements IListSinksRequest { + + /** + * Constructs a new ListSinksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListSinksRequest); + + /** ListSinksRequest parent. */ + public parent: string; + + /** ListSinksRequest pageToken. */ + public pageToken: string; + + /** ListSinksRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListSinksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSinksRequest instance + */ + public static create(properties?: google.logging.v2.IListSinksRequest): google.logging.v2.ListSinksRequest; + + /** + * Encodes the specified ListSinksRequest message. Does not implicitly {@link google.logging.v2.ListSinksRequest.verify|verify} messages. + * @param message ListSinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListSinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSinksRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListSinksRequest.verify|verify} messages. + * @param message ListSinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListSinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSinksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSinksRequest + * @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.ListSinksRequest; + + /** + * Decodes a ListSinksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSinksRequest + * @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.ListSinksRequest; + + /** + * Verifies a ListSinksRequest 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 ListSinksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSinksRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListSinksRequest; + + /** + * Creates a plain object from a ListSinksRequest message. Also converts values to other types if specified. + * @param message ListSinksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListSinksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSinksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSinksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSinksResponse. */ + interface IListSinksResponse { + + /** ListSinksResponse sinks */ + sinks?: (google.logging.v2.ILogSink[]|null); + + /** ListSinksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSinksResponse. */ + class ListSinksResponse implements IListSinksResponse { + + /** + * Constructs a new ListSinksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListSinksResponse); + + /** ListSinksResponse sinks. */ + public sinks: google.logging.v2.ILogSink[]; + + /** ListSinksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSinksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSinksResponse instance + */ + public static create(properties?: google.logging.v2.IListSinksResponse): google.logging.v2.ListSinksResponse; + + /** + * Encodes the specified ListSinksResponse message. Does not implicitly {@link google.logging.v2.ListSinksResponse.verify|verify} messages. + * @param message ListSinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListSinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSinksResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListSinksResponse.verify|verify} messages. + * @param message ListSinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListSinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSinksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSinksResponse + * @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.ListSinksResponse; + + /** + * Decodes a ListSinksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSinksResponse + * @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.ListSinksResponse; + + /** + * Verifies a ListSinksResponse 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 ListSinksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSinksResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListSinksResponse; + + /** + * Creates a plain object from a ListSinksResponse message. Also converts values to other types if specified. + * @param message ListSinksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListSinksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSinksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSinksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSinkRequest. */ + interface IGetSinkRequest { + + /** GetSinkRequest sinkName */ + sinkName?: (string|null); + } + + /** Represents a GetSinkRequest. */ + class GetSinkRequest implements IGetSinkRequest { + + /** + * Constructs a new GetSinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetSinkRequest); + + /** GetSinkRequest sinkName. */ + public sinkName: string; + + /** + * Creates a new GetSinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSinkRequest instance + */ + public static create(properties?: google.logging.v2.IGetSinkRequest): google.logging.v2.GetSinkRequest; + + /** + * Encodes the specified GetSinkRequest message. Does not implicitly {@link google.logging.v2.GetSinkRequest.verify|verify} messages. + * @param message GetSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetSinkRequest.verify|verify} messages. + * @param message GetSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSinkRequest + * @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.GetSinkRequest; + + /** + * Decodes a GetSinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSinkRequest + * @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.GetSinkRequest; + + /** + * Verifies a GetSinkRequest 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 GetSinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetSinkRequest; + + /** + * Creates a plain object from a GetSinkRequest message. Also converts values to other types if specified. + * @param message GetSinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetSinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSinkRequest. */ + interface ICreateSinkRequest { + + /** CreateSinkRequest parent */ + parent?: (string|null); + + /** CreateSinkRequest sink */ + sink?: (google.logging.v2.ILogSink|null); + + /** CreateSinkRequest uniqueWriterIdentity */ + uniqueWriterIdentity?: (boolean|null); + } + + /** Represents a CreateSinkRequest. */ + class CreateSinkRequest implements ICreateSinkRequest { + + /** + * Constructs a new CreateSinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateSinkRequest); + + /** CreateSinkRequest parent. */ + public parent: string; + + /** CreateSinkRequest sink. */ + public sink?: (google.logging.v2.ILogSink|null); + + /** CreateSinkRequest uniqueWriterIdentity. */ + public uniqueWriterIdentity: boolean; + + /** + * Creates a new CreateSinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSinkRequest instance + */ + public static create(properties?: google.logging.v2.ICreateSinkRequest): google.logging.v2.CreateSinkRequest; + + /** + * Encodes the specified CreateSinkRequest message. Does not implicitly {@link google.logging.v2.CreateSinkRequest.verify|verify} messages. + * @param message CreateSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICreateSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateSinkRequest.verify|verify} messages. + * @param message CreateSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICreateSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSinkRequest + * @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.CreateSinkRequest; + + /** + * Decodes a CreateSinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSinkRequest + * @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.CreateSinkRequest; + + /** + * Verifies a CreateSinkRequest 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 CreateSinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateSinkRequest; + + /** + * Creates a plain object from a CreateSinkRequest message. Also converts values to other types if specified. + * @param message CreateSinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CreateSinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSinkRequest. */ + interface IUpdateSinkRequest { + + /** UpdateSinkRequest sinkName */ + sinkName?: (string|null); + + /** UpdateSinkRequest sink */ + sink?: (google.logging.v2.ILogSink|null); + + /** UpdateSinkRequest uniqueWriterIdentity */ + uniqueWriterIdentity?: (boolean|null); + + /** UpdateSinkRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSinkRequest. */ + class UpdateSinkRequest implements IUpdateSinkRequest { + + /** + * Constructs a new UpdateSinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUpdateSinkRequest); + + /** UpdateSinkRequest sinkName. */ + public sinkName: string; + + /** UpdateSinkRequest sink. */ + public sink?: (google.logging.v2.ILogSink|null); + + /** UpdateSinkRequest uniqueWriterIdentity. */ + public uniqueWriterIdentity: boolean; + + /** UpdateSinkRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSinkRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateSinkRequest): google.logging.v2.UpdateSinkRequest; + + /** + * Encodes the specified UpdateSinkRequest message. Does not implicitly {@link google.logging.v2.UpdateSinkRequest.verify|verify} messages. + * @param message UpdateSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUpdateSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateSinkRequest.verify|verify} messages. + * @param message UpdateSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUpdateSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSinkRequest + * @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.UpdateSinkRequest; + + /** + * Decodes an UpdateSinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSinkRequest + * @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.UpdateSinkRequest; + + /** + * Verifies an UpdateSinkRequest 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 UpdateSinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateSinkRequest; + + /** + * Creates a plain object from an UpdateSinkRequest message. Also converts values to other types if specified. + * @param message UpdateSinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateSinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSinkRequest. */ + interface IDeleteSinkRequest { + + /** DeleteSinkRequest sinkName */ + sinkName?: (string|null); + } + + /** Represents a DeleteSinkRequest. */ + class DeleteSinkRequest implements IDeleteSinkRequest { + + /** + * Constructs a new DeleteSinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteSinkRequest); + + /** DeleteSinkRequest sinkName. */ + public sinkName: string; + + /** + * Creates a new DeleteSinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSinkRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteSinkRequest): google.logging.v2.DeleteSinkRequest; + + /** + * Encodes the specified DeleteSinkRequest message. Does not implicitly {@link google.logging.v2.DeleteSinkRequest.verify|verify} messages. + * @param message DeleteSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteSinkRequest.verify|verify} messages. + * @param message DeleteSinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteSinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSinkRequest + * @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.DeleteSinkRequest; + + /** + * Decodes a DeleteSinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSinkRequest + * @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.DeleteSinkRequest; + + /** + * Verifies a DeleteSinkRequest 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 DeleteSinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteSinkRequest; + + /** + * Creates a plain object from a DeleteSinkRequest message. Also converts values to other types if specified. + * @param message DeleteSinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteSinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateLinkRequest. */ + interface ICreateLinkRequest { + + /** CreateLinkRequest parent */ + parent?: (string|null); + + /** CreateLinkRequest link */ + link?: (google.logging.v2.ILink|null); + + /** CreateLinkRequest linkId */ + linkId?: (string|null); + } + + /** Represents a CreateLinkRequest. */ + class CreateLinkRequest implements ICreateLinkRequest { + + /** + * Constructs a new CreateLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateLinkRequest); + + /** CreateLinkRequest parent. */ + public parent: string; + + /** CreateLinkRequest link. */ + public link?: (google.logging.v2.ILink|null); + + /** CreateLinkRequest linkId. */ + public linkId: string; + + /** + * Creates a new CreateLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateLinkRequest instance + */ + public static create(properties?: google.logging.v2.ICreateLinkRequest): google.logging.v2.CreateLinkRequest; + + /** + * Encodes the specified CreateLinkRequest message. Does not implicitly {@link google.logging.v2.CreateLinkRequest.verify|verify} messages. + * @param message CreateLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICreateLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateLinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLinkRequest.verify|verify} messages. + * @param message CreateLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICreateLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateLinkRequest + * @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.CreateLinkRequest; + + /** + * Decodes a CreateLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateLinkRequest + * @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.CreateLinkRequest; + + /** + * Verifies a CreateLinkRequest 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 CreateLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateLinkRequest; + + /** + * Creates a plain object from a CreateLinkRequest message. Also converts values to other types if specified. + * @param message CreateLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CreateLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteLinkRequest. */ + interface IDeleteLinkRequest { + + /** DeleteLinkRequest name */ + name?: (string|null); + } + + /** Represents a DeleteLinkRequest. */ + class DeleteLinkRequest implements IDeleteLinkRequest { + + /** + * Constructs a new DeleteLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteLinkRequest); + + /** DeleteLinkRequest name. */ + public name: string; + + /** + * Creates a new DeleteLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLinkRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteLinkRequest): google.logging.v2.DeleteLinkRequest; + + /** + * Encodes the specified DeleteLinkRequest message. Does not implicitly {@link google.logging.v2.DeleteLinkRequest.verify|verify} messages. + * @param message DeleteLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLinkRequest.verify|verify} messages. + * @param message DeleteLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLinkRequest + * @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.DeleteLinkRequest; + + /** + * Decodes a DeleteLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLinkRequest + * @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.DeleteLinkRequest; + + /** + * Verifies a DeleteLinkRequest 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 DeleteLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteLinkRequest; + + /** + * Creates a plain object from a DeleteLinkRequest message. Also converts values to other types if specified. + * @param message DeleteLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLinksRequest. */ + interface IListLinksRequest { + + /** ListLinksRequest parent */ + parent?: (string|null); + + /** ListLinksRequest pageToken */ + pageToken?: (string|null); + + /** ListLinksRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListLinksRequest. */ + class ListLinksRequest implements IListLinksRequest { + + /** + * Constructs a new ListLinksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLinksRequest); + + /** ListLinksRequest parent. */ + public parent: string; + + /** ListLinksRequest pageToken. */ + public pageToken: string; + + /** ListLinksRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListLinksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLinksRequest instance + */ + public static create(properties?: google.logging.v2.IListLinksRequest): google.logging.v2.ListLinksRequest; + + /** + * Encodes the specified ListLinksRequest message. Does not implicitly {@link google.logging.v2.ListLinksRequest.verify|verify} messages. + * @param message ListLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLinksRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLinksRequest.verify|verify} messages. + * @param message ListLinksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLinksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLinksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLinksRequest + * @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.ListLinksRequest; + + /** + * Decodes a ListLinksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLinksRequest + * @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.ListLinksRequest; + + /** + * Verifies a ListLinksRequest 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 ListLinksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLinksRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLinksRequest; + + /** + * Creates a plain object from a ListLinksRequest message. Also converts values to other types if specified. + * @param message ListLinksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLinksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLinksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLinksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLinksResponse. */ + interface IListLinksResponse { + + /** ListLinksResponse links */ + links?: (google.logging.v2.ILink[]|null); + + /** ListLinksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLinksResponse. */ + class ListLinksResponse implements IListLinksResponse { + + /** + * Constructs a new ListLinksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLinksResponse); + + /** ListLinksResponse links. */ + public links: google.logging.v2.ILink[]; + + /** ListLinksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListLinksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLinksResponse instance + */ + public static create(properties?: google.logging.v2.IListLinksResponse): google.logging.v2.ListLinksResponse; + + /** + * Encodes the specified ListLinksResponse message. Does not implicitly {@link google.logging.v2.ListLinksResponse.verify|verify} messages. + * @param message ListLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLinksResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLinksResponse.verify|verify} messages. + * @param message ListLinksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLinksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLinksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLinksResponse + * @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.ListLinksResponse; + + /** + * Decodes a ListLinksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLinksResponse + * @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.ListLinksResponse; + + /** + * Verifies a ListLinksResponse 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 ListLinksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLinksResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLinksResponse; + + /** + * Creates a plain object from a ListLinksResponse message. Also converts values to other types if specified. + * @param message ListLinksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListLinksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLinksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLinksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLinkRequest. */ + interface IGetLinkRequest { + + /** GetLinkRequest name */ + name?: (string|null); + } + + /** Represents a GetLinkRequest. */ + class GetLinkRequest implements IGetLinkRequest { + + /** + * Constructs a new GetLinkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetLinkRequest); + + /** GetLinkRequest name. */ + public name: string; + + /** + * Creates a new GetLinkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLinkRequest instance + */ + public static create(properties?: google.logging.v2.IGetLinkRequest): google.logging.v2.GetLinkRequest; + + /** + * Encodes the specified GetLinkRequest message. Does not implicitly {@link google.logging.v2.GetLinkRequest.verify|verify} messages. + * @param message GetLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLinkRequest.verify|verify} messages. + * @param message GetLinkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetLinkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLinkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLinkRequest + * @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.GetLinkRequest; + + /** + * Decodes a GetLinkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLinkRequest + * @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.GetLinkRequest; + + /** + * Verifies a GetLinkRequest 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 GetLinkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLinkRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetLinkRequest; + + /** + * Creates a plain object from a GetLinkRequest message. Also converts values to other types if specified. + * @param message GetLinkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetLinkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLinkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLinkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogExclusion. */ + interface ILogExclusion { + + /** LogExclusion name */ + name?: (string|null); + + /** LogExclusion description */ + description?: (string|null); + + /** LogExclusion filter */ + filter?: (string|null); + + /** LogExclusion disabled */ + disabled?: (boolean|null); + + /** LogExclusion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** LogExclusion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a LogExclusion. */ + class LogExclusion implements ILogExclusion { + + /** + * Constructs a new LogExclusion. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogExclusion); + + /** LogExclusion name. */ + public name: string; + + /** LogExclusion description. */ + public description: string; + + /** LogExclusion filter. */ + public filter: string; + + /** LogExclusion disabled. */ + public disabled: boolean; + + /** LogExclusion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** LogExclusion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new LogExclusion instance using the specified properties. + * @param [properties] Properties to set + * @returns LogExclusion instance + */ + public static create(properties?: google.logging.v2.ILogExclusion): google.logging.v2.LogExclusion; + + /** + * Encodes the specified LogExclusion message. Does not implicitly {@link google.logging.v2.LogExclusion.verify|verify} messages. + * @param message LogExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILogExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogExclusion message, length delimited. Does not implicitly {@link google.logging.v2.LogExclusion.verify|verify} messages. + * @param message LogExclusion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogExclusion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogExclusion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogExclusion + * @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.LogExclusion; + + /** + * Decodes a LogExclusion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogExclusion + * @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.LogExclusion; + + /** + * Verifies a LogExclusion 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 LogExclusion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogExclusion + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogExclusion; + + /** + * Creates a plain object from a LogExclusion message. Also converts values to other types if specified. + * @param message LogExclusion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LogExclusion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogExclusion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogExclusion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExclusionsRequest. */ + interface IListExclusionsRequest { + + /** ListExclusionsRequest parent */ + parent?: (string|null); + + /** ListExclusionsRequest pageToken */ + pageToken?: (string|null); + + /** ListExclusionsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListExclusionsRequest. */ + class ListExclusionsRequest implements IListExclusionsRequest { + + /** + * Constructs a new ListExclusionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListExclusionsRequest); + + /** ListExclusionsRequest parent. */ + public parent: string; + + /** ListExclusionsRequest pageToken. */ + public pageToken: string; + + /** ListExclusionsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListExclusionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExclusionsRequest instance + */ + public static create(properties?: google.logging.v2.IListExclusionsRequest): google.logging.v2.ListExclusionsRequest; + + /** + * Encodes the specified ListExclusionsRequest message. Does not implicitly {@link google.logging.v2.ListExclusionsRequest.verify|verify} messages. + * @param message ListExclusionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListExclusionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExclusionsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListExclusionsRequest.verify|verify} messages. + * @param message ListExclusionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListExclusionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExclusionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExclusionsRequest + * @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.ListExclusionsRequest; + + /** + * Decodes a ListExclusionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExclusionsRequest + * @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.ListExclusionsRequest; + + /** + * Verifies a ListExclusionsRequest 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 ListExclusionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExclusionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListExclusionsRequest; + + /** + * Creates a plain object from a ListExclusionsRequest message. Also converts values to other types if specified. + * @param message ListExclusionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListExclusionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExclusionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExclusionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListExclusionsResponse. */ + interface IListExclusionsResponse { + + /** ListExclusionsResponse exclusions */ + exclusions?: (google.logging.v2.ILogExclusion[]|null); + + /** ListExclusionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListExclusionsResponse. */ + class ListExclusionsResponse implements IListExclusionsResponse { + + /** + * Constructs a new ListExclusionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListExclusionsResponse); + + /** ListExclusionsResponse exclusions. */ + public exclusions: google.logging.v2.ILogExclusion[]; + + /** ListExclusionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListExclusionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExclusionsResponse instance + */ + public static create(properties?: google.logging.v2.IListExclusionsResponse): google.logging.v2.ListExclusionsResponse; + + /** + * Encodes the specified ListExclusionsResponse message. Does not implicitly {@link google.logging.v2.ListExclusionsResponse.verify|verify} messages. + * @param message ListExclusionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IListExclusionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExclusionsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListExclusionsResponse.verify|verify} messages. + * @param message ListExclusionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListExclusionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExclusionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExclusionsResponse + * @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.ListExclusionsResponse; + + /** + * Decodes a ListExclusionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExclusionsResponse + * @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.ListExclusionsResponse; + + /** + * Verifies a ListExclusionsResponse 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 ListExclusionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExclusionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListExclusionsResponse; + + /** + * Creates a plain object from a ListExclusionsResponse message. Also converts values to other types if specified. + * @param message ListExclusionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.ListExclusionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExclusionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListExclusionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetExclusionRequest. */ + interface IGetExclusionRequest { + + /** GetExclusionRequest name */ + name?: (string|null); + } + + /** Represents a GetExclusionRequest. */ + class GetExclusionRequest implements IGetExclusionRequest { + + /** + * Constructs a new GetExclusionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetExclusionRequest); + + /** GetExclusionRequest name. */ + public name: string; + + /** + * Creates a new GetExclusionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExclusionRequest instance + */ + public static create(properties?: google.logging.v2.IGetExclusionRequest): google.logging.v2.GetExclusionRequest; + + /** + * Encodes the specified GetExclusionRequest message. Does not implicitly {@link google.logging.v2.GetExclusionRequest.verify|verify} messages. + * @param message GetExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetExclusionRequest.verify|verify} messages. + * @param message GetExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExclusionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExclusionRequest + * @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.GetExclusionRequest; + + /** + * Decodes a GetExclusionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExclusionRequest + * @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.GetExclusionRequest; + + /** + * Verifies a GetExclusionRequest 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 GetExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExclusionRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetExclusionRequest; + + /** + * Creates a plain object from a GetExclusionRequest message. Also converts values to other types if specified. + * @param message GetExclusionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetExclusionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExclusionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetExclusionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateExclusionRequest. */ + interface ICreateExclusionRequest { + + /** CreateExclusionRequest parent */ + parent?: (string|null); + + /** CreateExclusionRequest exclusion */ + exclusion?: (google.logging.v2.ILogExclusion|null); + } + + /** Represents a CreateExclusionRequest. */ + class CreateExclusionRequest implements ICreateExclusionRequest { + + /** + * Constructs a new CreateExclusionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateExclusionRequest); + + /** CreateExclusionRequest parent. */ + public parent: string; + + /** CreateExclusionRequest exclusion. */ + public exclusion?: (google.logging.v2.ILogExclusion|null); + + /** + * Creates a new CreateExclusionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateExclusionRequest instance + */ + public static create(properties?: google.logging.v2.ICreateExclusionRequest): google.logging.v2.CreateExclusionRequest; + + /** + * Encodes the specified CreateExclusionRequest message. Does not implicitly {@link google.logging.v2.CreateExclusionRequest.verify|verify} messages. + * @param message CreateExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICreateExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateExclusionRequest.verify|verify} messages. + * @param message CreateExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICreateExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateExclusionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateExclusionRequest + * @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.CreateExclusionRequest; + + /** + * Decodes a CreateExclusionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateExclusionRequest + * @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.CreateExclusionRequest; + + /** + * Verifies a CreateExclusionRequest 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 CreateExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateExclusionRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CreateExclusionRequest; + + /** + * Creates a plain object from a CreateExclusionRequest message. Also converts values to other types if specified. + * @param message CreateExclusionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CreateExclusionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateExclusionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateExclusionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateExclusionRequest. */ + interface IUpdateExclusionRequest { + + /** UpdateExclusionRequest name */ + name?: (string|null); + + /** UpdateExclusionRequest exclusion */ + exclusion?: (google.logging.v2.ILogExclusion|null); + + /** UpdateExclusionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateExclusionRequest. */ + class UpdateExclusionRequest implements IUpdateExclusionRequest { + + /** + * Constructs a new UpdateExclusionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUpdateExclusionRequest); + + /** UpdateExclusionRequest name. */ + public name: string; + + /** UpdateExclusionRequest exclusion. */ + public exclusion?: (google.logging.v2.ILogExclusion|null); + + /** UpdateExclusionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateExclusionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateExclusionRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateExclusionRequest): google.logging.v2.UpdateExclusionRequest; + + /** + * Encodes the specified UpdateExclusionRequest message. Does not implicitly {@link google.logging.v2.UpdateExclusionRequest.verify|verify} messages. + * @param message UpdateExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUpdateExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateExclusionRequest.verify|verify} messages. + * @param message UpdateExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUpdateExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateExclusionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateExclusionRequest + * @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.UpdateExclusionRequest; + + /** + * Decodes an UpdateExclusionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateExclusionRequest + * @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.UpdateExclusionRequest; + + /** + * Verifies an UpdateExclusionRequest 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 UpdateExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateExclusionRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateExclusionRequest; + + /** + * Creates a plain object from an UpdateExclusionRequest message. Also converts values to other types if specified. + * @param message UpdateExclusionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateExclusionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateExclusionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateExclusionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteExclusionRequest. */ + interface IDeleteExclusionRequest { + + /** DeleteExclusionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteExclusionRequest. */ + class DeleteExclusionRequest implements IDeleteExclusionRequest { + + /** + * Constructs a new DeleteExclusionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IDeleteExclusionRequest); + + /** DeleteExclusionRequest name. */ + public name: string; + + /** + * Creates a new DeleteExclusionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExclusionRequest instance + */ + public static create(properties?: google.logging.v2.IDeleteExclusionRequest): google.logging.v2.DeleteExclusionRequest; + + /** + * Encodes the specified DeleteExclusionRequest message. Does not implicitly {@link google.logging.v2.DeleteExclusionRequest.verify|verify} messages. + * @param message DeleteExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IDeleteExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteExclusionRequest.verify|verify} messages. + * @param message DeleteExclusionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IDeleteExclusionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExclusionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExclusionRequest + * @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.DeleteExclusionRequest; + + /** + * Decodes a DeleteExclusionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExclusionRequest + * @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.DeleteExclusionRequest; + + /** + * Verifies a DeleteExclusionRequest 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 DeleteExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExclusionRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.DeleteExclusionRequest; + + /** + * Creates a plain object from a DeleteExclusionRequest message. Also converts values to other types if specified. + * @param message DeleteExclusionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.DeleteExclusionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExclusionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteExclusionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCmekSettingsRequest. */ + interface IGetCmekSettingsRequest { + + /** GetCmekSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetCmekSettingsRequest. */ + class GetCmekSettingsRequest implements IGetCmekSettingsRequest { + + /** + * Constructs a new GetCmekSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetCmekSettingsRequest); + + /** GetCmekSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetCmekSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCmekSettingsRequest instance + */ + public static create(properties?: google.logging.v2.IGetCmekSettingsRequest): google.logging.v2.GetCmekSettingsRequest; + + /** + * Encodes the specified GetCmekSettingsRequest message. Does not implicitly {@link google.logging.v2.GetCmekSettingsRequest.verify|verify} messages. + * @param message GetCmekSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IGetCmekSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCmekSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetCmekSettingsRequest.verify|verify} messages. + * @param message GetCmekSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IGetCmekSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCmekSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCmekSettingsRequest + * @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.GetCmekSettingsRequest; + + /** + * Decodes a GetCmekSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCmekSettingsRequest + * @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.GetCmekSettingsRequest; + + /** + * Verifies a GetCmekSettingsRequest 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 GetCmekSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCmekSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetCmekSettingsRequest; + + /** + * Creates a plain object from a GetCmekSettingsRequest message. Also converts values to other types if specified. + * @param message GetCmekSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.GetCmekSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCmekSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCmekSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCmekSettingsRequest. */ + interface IUpdateCmekSettingsRequest { + + /** UpdateCmekSettingsRequest name */ + name?: (string|null); + + /** UpdateCmekSettingsRequest cmekSettings */ + cmekSettings?: (google.logging.v2.ICmekSettings|null); + + /** UpdateCmekSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCmekSettingsRequest. */ + class UpdateCmekSettingsRequest implements IUpdateCmekSettingsRequest { + + /** + * Constructs a new UpdateCmekSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IUpdateCmekSettingsRequest); + + /** UpdateCmekSettingsRequest name. */ + public name: string; + + /** UpdateCmekSettingsRequest cmekSettings. */ + public cmekSettings?: (google.logging.v2.ICmekSettings|null); + + /** UpdateCmekSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCmekSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCmekSettingsRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateCmekSettingsRequest): google.logging.v2.UpdateCmekSettingsRequest; + + /** + * Encodes the specified UpdateCmekSettingsRequest message. Does not implicitly {@link google.logging.v2.UpdateCmekSettingsRequest.verify|verify} messages. + * @param message UpdateCmekSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IUpdateCmekSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCmekSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateCmekSettingsRequest.verify|verify} messages. + * @param message UpdateCmekSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IUpdateCmekSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCmekSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCmekSettingsRequest + * @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.UpdateCmekSettingsRequest; + + /** + * Decodes an UpdateCmekSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCmekSettingsRequest + * @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.UpdateCmekSettingsRequest; + + /** + * Verifies an UpdateCmekSettingsRequest 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 UpdateCmekSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCmekSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.UpdateCmekSettingsRequest; + + /** + * Creates a plain object from an UpdateCmekSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateCmekSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.UpdateCmekSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCmekSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCmekSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CmekSettings. */ + interface ICmekSettings { + + /** CmekSettings name */ + name?: (string|null); + + /** CmekSettings kmsKeyName */ + kmsKeyName?: (string|null); + + /** CmekSettings kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** CmekSettings serviceAccountId */ + serviceAccountId?: (string|null); + } + + /** Represents a CmekSettings. */ + class CmekSettings implements ICmekSettings { + + /** + * Constructs a new CmekSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICmekSettings); + + /** CmekSettings name. */ + public name: string; + + /** CmekSettings kmsKeyName. */ + public kmsKeyName: string; + + /** CmekSettings kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** CmekSettings serviceAccountId. */ + public serviceAccountId: string; + + /** + * Creates a new CmekSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CmekSettings instance + */ + public static create(properties?: google.logging.v2.ICmekSettings): google.logging.v2.CmekSettings; + + /** + * Encodes the specified CmekSettings message. Does not implicitly {@link google.logging.v2.CmekSettings.verify|verify} messages. + * @param message CmekSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ICmekSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CmekSettings message, length delimited. Does not implicitly {@link google.logging.v2.CmekSettings.verify|verify} messages. + * @param message CmekSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ICmekSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CmekSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CmekSettings + * @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.CmekSettings; + + /** + * Decodes a CmekSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CmekSettings + * @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.CmekSettings; + + /** + * Verifies a CmekSettings 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 CmekSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CmekSettings + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CmekSettings; + + /** + * Creates a plain object from a CmekSettings message. Also converts values to other types if specified. + * @param message CmekSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.CmekSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CmekSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CmekSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSettingsRequest. */ + interface IGetSettingsRequest { + + /** GetSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetSettingsRequest. */ + class GetSettingsRequest implements IGetSettingsRequest { + + /** + * Constructs a new GetSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetSettingsRequest); + + /** GetSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSettingsRequest instance + */ + public static create(properties?: google.logging.v2.IGetSettingsRequest): google.logging.v2.GetSettingsRequest; + + /** + * 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 static encode(message: google.logging.v2.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static encodeDelimited(message: google.logging.v2.IGetSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.GetSettingsRequest; + + /** + * 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 static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.GetSettingsRequest; + + /** + * Verifies a GetSettingsRequest 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 GetSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.GetSettingsRequest; + + /** + * 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 static toObject(message: google.logging.v2.GetSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 { + + /** + * Constructs a new UpdateSettingsRequest. + * @param [properties] Properties to set + */ + 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); + + /** + * Creates a new UpdateSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSettingsRequest instance + */ + public static create(properties?: google.logging.v2.IUpdateSettingsRequest): google.logging.v2.UpdateSettingsRequest; + + /** + * 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 + */ + public static encode(message: google.logging.v2.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 + */ + public static encodeDelimited(message: google.logging.v2.IUpdateSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.logging.v2.UpdateSettingsRequest; + + /** + * 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 + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.logging.v2.UpdateSettingsRequest; + + /** + * Verifies an UpdateSettingsRequest 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 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; + + /** + * 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 }; + + /** + * Converts this UpdateSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Settings. */ + interface ISettings { + + /** Settings name */ + name?: (string|null); + + /** Settings kmsKeyName */ + kmsKeyName?: (string|null); + + /** Settings kmsServiceAccountId */ + kmsServiceAccountId?: (string|null); + + /** Settings storageLocation */ + storageLocation?: (string|null); + + /** Settings disableDefaultSink */ + disableDefaultSink?: (boolean|null); + } + + /** Represents a Settings. */ + class Settings implements ISettings { + + /** + * Constructs a new Settings. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ISettings); + + /** Settings name. */ + public name: string; + + /** Settings kmsKeyName. */ + public kmsKeyName: string; + + /** Settings kmsServiceAccountId. */ + public kmsServiceAccountId: string; + + /** Settings storageLocation. */ + public storageLocation: string; + + /** Settings disableDefaultSink. */ + public disableDefaultSink: boolean; + + /** + * Creates a new Settings instance using the specified properties. + * @param [properties] Properties to set + * @returns Settings instance + */ + public static create(properties?: google.logging.v2.ISettings): google.logging.v2.Settings; + + /** + * 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.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.Settings; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.Settings; + + /** + * 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 Settings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Settings + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.Settings; + + /** + * 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.Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Settings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Settings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyLogEntriesRequest. */ + interface ICopyLogEntriesRequest { + + /** CopyLogEntriesRequest name */ + name?: (string|null); + + /** CopyLogEntriesRequest filter */ + filter?: (string|null); + + /** CopyLogEntriesRequest destination */ + destination?: (string|null); + } + + /** Represents a CopyLogEntriesRequest. */ + class CopyLogEntriesRequest implements ICopyLogEntriesRequest { + + /** + * Constructs a new CopyLogEntriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICopyLogEntriesRequest); + + /** CopyLogEntriesRequest name. */ + public name: string; + + /** CopyLogEntriesRequest filter. */ + public filter: string; + + /** CopyLogEntriesRequest destination. */ + public destination: string; + + /** + * Creates a new CopyLogEntriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyLogEntriesRequest instance + */ + public static create(properties?: google.logging.v2.ICopyLogEntriesRequest): google.logging.v2.CopyLogEntriesRequest; + + /** + * 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.ICopyLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.ICopyLogEntriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CopyLogEntriesRequest; + + /** + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CopyLogEntriesRequest; + + /** + * 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 CopyLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyLogEntriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CopyLogEntriesRequest; + + /** + * 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.CopyLogEntriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyLogEntriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyLogEntriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyLogEntriesMetadata. */ + interface ICopyLogEntriesMetadata { + + /** CopyLogEntriesMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|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 CopyLogEntriesMetadata. */ + class CopyLogEntriesMetadata implements ICopyLogEntriesMetadata { + + /** + * Constructs a new CopyLogEntriesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICopyLogEntriesMetadata); + + /** CopyLogEntriesMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** 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 CopyLogEntriesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyLogEntriesMetadata instance + */ + public static create(properties?: google.logging.v2.ICopyLogEntriesMetadata): google.logging.v2.CopyLogEntriesMetadata; + + /** + * 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.ICopyLogEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.ICopyLogEntriesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CopyLogEntriesMetadata; + + /** + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CopyLogEntriesMetadata; + + /** + * 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 CopyLogEntriesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyLogEntriesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CopyLogEntriesMetadata; + + /** + * 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.CopyLogEntriesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyLogEntriesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyLogEntriesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CopyLogEntriesResponse. */ + interface ICopyLogEntriesResponse { + + /** CopyLogEntriesResponse logEntriesCopiedCount */ + logEntriesCopiedCount?: (number|Long|string|null); + } + + /** Represents a CopyLogEntriesResponse. */ + class CopyLogEntriesResponse implements ICopyLogEntriesResponse { + + /** + * Constructs a new CopyLogEntriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICopyLogEntriesResponse); + + /** CopyLogEntriesResponse logEntriesCopiedCount. */ + public logEntriesCopiedCount: (number|Long|string); + + /** + * Creates a new CopyLogEntriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CopyLogEntriesResponse instance + */ + public static create(properties?: google.logging.v2.ICopyLogEntriesResponse): google.logging.v2.CopyLogEntriesResponse; + + /** + * 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.ICopyLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.ICopyLogEntriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CopyLogEntriesResponse; + + /** + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CopyLogEntriesResponse; + + /** + * 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 CopyLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CopyLogEntriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.CopyLogEntriesResponse; + + /** + * 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.CopyLogEntriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CopyLogEntriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CopyLogEntriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BucketMetadata. */ + interface IBucketMetadata { + + /** BucketMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** BucketMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** BucketMetadata state */ + state?: (google.logging.v2.OperationState|keyof typeof google.logging.v2.OperationState|null); + + /** BucketMetadata createBucketRequest */ + createBucketRequest?: (google.logging.v2.ICreateBucketRequest|null); + + /** BucketMetadata updateBucketRequest */ + updateBucketRequest?: (google.logging.v2.IUpdateBucketRequest|null); + } + + /** Represents a BucketMetadata. */ + class BucketMetadata implements IBucketMetadata { + + /** + * Constructs a new BucketMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IBucketMetadata); + + /** BucketMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** BucketMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** BucketMetadata state. */ + public state: (google.logging.v2.OperationState|keyof typeof google.logging.v2.OperationState); + + /** BucketMetadata createBucketRequest. */ + public createBucketRequest?: (google.logging.v2.ICreateBucketRequest|null); + + /** BucketMetadata updateBucketRequest. */ + public updateBucketRequest?: (google.logging.v2.IUpdateBucketRequest|null); + + /** BucketMetadata request. */ + public request?: ("createBucketRequest"|"updateBucketRequest"); + + /** + * Creates a new BucketMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BucketMetadata instance + */ + public static create(properties?: google.logging.v2.IBucketMetadata): google.logging.v2.BucketMetadata; + + /** + * Encodes the specified BucketMetadata message. Does not implicitly {@link google.logging.v2.BucketMetadata.verify|verify} messages. + * @param message BucketMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.IBucketMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BucketMetadata message, length delimited. Does not implicitly {@link google.logging.v2.BucketMetadata.verify|verify} messages. + * @param message BucketMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IBucketMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BucketMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BucketMetadata + * @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.BucketMetadata; + + /** + * Decodes a BucketMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BucketMetadata + * @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.BucketMetadata; + + /** + * Verifies a BucketMetadata 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 BucketMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BucketMetadata + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.BucketMetadata; + + /** + * Creates a plain object from a BucketMetadata message. Also converts values to other types if specified. + * @param message BucketMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.BucketMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BucketMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BucketMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkMetadata. */ + interface ILinkMetadata { + + /** LinkMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** LinkMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** LinkMetadata state */ + state?: (google.logging.v2.OperationState|keyof typeof google.logging.v2.OperationState|null); + + /** LinkMetadata createLinkRequest */ + createLinkRequest?: (google.logging.v2.ICreateLinkRequest|null); + + /** LinkMetadata deleteLinkRequest */ + deleteLinkRequest?: (google.logging.v2.IDeleteLinkRequest|null); + } + + /** Represents a LinkMetadata. */ + class LinkMetadata implements ILinkMetadata { + + /** + * Constructs a new LinkMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILinkMetadata); + + /** LinkMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** LinkMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** LinkMetadata state. */ + public state: (google.logging.v2.OperationState|keyof typeof google.logging.v2.OperationState); + + /** LinkMetadata createLinkRequest. */ + public createLinkRequest?: (google.logging.v2.ICreateLinkRequest|null); + + /** LinkMetadata deleteLinkRequest. */ + public deleteLinkRequest?: (google.logging.v2.IDeleteLinkRequest|null); + + /** LinkMetadata request. */ + public request?: ("createLinkRequest"|"deleteLinkRequest"); + + /** + * Creates a new LinkMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkMetadata instance + */ + public static create(properties?: google.logging.v2.ILinkMetadata): google.logging.v2.LinkMetadata; + + /** + * Encodes the specified LinkMetadata message. Does not implicitly {@link google.logging.v2.LinkMetadata.verify|verify} messages. + * @param message LinkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkMetadata message, length delimited. Does not implicitly {@link google.logging.v2.LinkMetadata.verify|verify} messages. + * @param message LinkMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILinkMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkMetadata + * @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.LinkMetadata; + + /** + * Decodes a LinkMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkMetadata + * @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.LinkMetadata; + + /** + * Verifies a LinkMetadata 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 LinkMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkMetadata + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LinkMetadata; + + /** + * Creates a plain object from a LinkMetadata message. Also converts values to other types if specified. + * @param message LinkMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LinkMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 + } + + /** LifecycleState enum. */ + enum LifecycleState { + LIFECYCLE_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DELETE_REQUESTED = 2, + UPDATING = 3, + CREATING = 4, + FAILED = 5 + } + + /** IndexType enum. */ + enum IndexType { + INDEX_TYPE_UNSPECIFIED = 0, + INDEX_TYPE_STRING = 1, + INDEX_TYPE_INTEGER = 2 + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata logAnalyticsEnabled */ + logAnalyticsEnabled?: (boolean|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILocationMetadata); + + /** LocationMetadata logAnalyticsEnabled. */ + public logAnalyticsEnabled: boolean; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.logging.v2.ILocationMetadata): google.logging.v2.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.logging.v2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.logging.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.logging.v2.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @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.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @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.LocationMetadata; + + /** + * Verifies a LocationMetadata 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 LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.logging.v2.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a MetricsServiceV2 */ + class MetricsServiceV2 extends $protobuf.rpc.Service { + + /** + * 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(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * 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; + + /** + * Calls ListLogMetrics. + * @param request ListLogMetricsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListLogMetricsResponse + */ + public listLogMetrics(request: google.logging.v2.IListLogMetricsRequest, callback: google.logging.v2.MetricsServiceV2.ListLogMetricsCallback): void; + + /** + * Calls ListLogMetrics. + * @param request ListLogMetricsRequest message or plain object + * @returns Promise + */ + public listLogMetrics(request: google.logging.v2.IListLogMetricsRequest): Promise; + + /** + * Calls GetLogMetric. + * @param request GetLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogMetric + */ + public getLogMetric(request: google.logging.v2.IGetLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.GetLogMetricCallback): void; + + /** + * Calls GetLogMetric. + * @param request GetLogMetricRequest message or plain object + * @returns Promise + */ + public getLogMetric(request: google.logging.v2.IGetLogMetricRequest): Promise; + + /** + * Calls CreateLogMetric. + * @param request CreateLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogMetric + */ + public createLogMetric(request: google.logging.v2.ICreateLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.CreateLogMetricCallback): void; + + /** + * Calls CreateLogMetric. + * @param request CreateLogMetricRequest message or plain object + * @returns Promise + */ + public createLogMetric(request: google.logging.v2.ICreateLogMetricRequest): Promise; + + /** + * Calls UpdateLogMetric. + * @param request UpdateLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LogMetric + */ + public updateLogMetric(request: google.logging.v2.IUpdateLogMetricRequest, callback: google.logging.v2.MetricsServiceV2.UpdateLogMetricCallback): void; + + /** + * Calls UpdateLogMetric. + * @param request UpdateLogMetricRequest message or plain object + * @returns Promise + */ + public updateLogMetric(request: google.logging.v2.IUpdateLogMetricRequest): Promise; + + /** + * Calls DeleteLogMetric. + * @param request DeleteLogMetricRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + 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; + } + + namespace MetricsServiceV2 { + + /** + * 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; + + /** + * 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; + } + + /** Properties of a LogMetric. */ + interface ILogMetric { + + /** LogMetric name */ + name?: (string|null); + + /** LogMetric description */ + description?: (string|null); + + /** LogMetric filter */ + filter?: (string|null); + + /** LogMetric bucketName */ + bucketName?: (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 LogMetric. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ILogMetric); + + /** LogMetric name. */ + public name: string; + + /** LogMetric description. */ + public description: string; + + /** LogMetric filter. */ + public filter: string; + + /** LogMetric bucketName. */ + public bucketName: 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 LogMetric instance using the specified properties. + * @param [properties] Properties to set + * @returns LogMetric instance + */ + public static create(properties?: google.logging.v2.ILogMetric): google.logging.v2.LogMetric; + + /** + * 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.ILogMetric, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.ILogMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.LogMetric; + + /** + * Decodes a LogMetric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.LogMetric; + + /** + * 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 a LogMetric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogMetric + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.LogMetric; + + /** + * 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.LogMetric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogMetric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogMetric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogMetric { + + /** ApiVersion enum. */ + enum ApiVersion { + V2 = 0, + V1 = 1 + } + } + + /** 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 ListLogMetricsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogMetricsRequest); + + /** ListLogMetricsRequest parent. */ + public parent: string; + + /** ListLogMetricsRequest pageToken. */ + public pageToken: string; + + /** ListLogMetricsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListLogMetricsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLogMetricsRequest instance + */ + public static create(properties?: google.logging.v2.IListLogMetricsRequest): google.logging.v2.ListLogMetricsRequest; + + /** + * 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.IListLogMetricsRequest, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.logging.v2.IListLogMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.ListLogMetricsRequest; + + /** + * Decodes a ListLogMetricsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.ListLogMetricsRequest; + + /** + * 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 ListLogMetricsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLogMetricsRequest + */ + public static fromObject(object: { [k: string]: any }): google.logging.v2.ListLogMetricsRequest; + + /** + * 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.ListLogMetricsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLogMetricsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogMetricsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListLogMetricsResponse. */ + interface IListLogMetricsResponse { + + /** ListLogMetricsResponse metrics */ + metrics?: (google.logging.v2.ILogMetric[]|null); + + /** ListLogMetricsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListLogMetricsResponse. */ + class ListLogMetricsResponse implements IListLogMetricsResponse { + + /** + * Constructs a new ListLogMetricsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IListLogMetricsResponse); + + /** ListLogMetricsResponse metrics. */ + public metrics: google.logging.v2.ILogMetric[]; + + /** ListLogMetricsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 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; + + /** + * 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); + + /** + * 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 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 }; + + /** + * Converts this ListLogMetricsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListLogMetricsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetLogMetricRequest. */ + interface IGetLogMetricRequest { + + /** GetLogMetricRequest metricName */ + metricName?: (string|null); + } + + /** Represents a GetLogMetricRequest. */ + class GetLogMetricRequest implements IGetLogMetricRequest { + + /** + * Constructs a new GetLogMetricRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.IGetLogMetricRequest); + + /** GetLogMetricRequest metricName. */ + public metricName: string; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this GetLogMetricRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetLogMetricRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateLogMetricRequest. */ + interface ICreateLogMetricRequest { + + /** CreateLogMetricRequest parent */ + parent?: (string|null); + + /** CreateLogMetricRequest metric */ + metric?: (google.logging.v2.ILogMetric|null); + } + + /** Represents a CreateLogMetricRequest. */ + class CreateLogMetricRequest implements ICreateLogMetricRequest { + + /** + * Constructs a new CreateLogMetricRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.logging.v2.ICreateLogMetricRequest); + + /** CreateLogMetricRequest parent. */ + public parent: string; + + /** CreateLogMetricRequest metric. */ + public metric?: (google.logging.v2.ILogMetric|null); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this CreateLogMetricRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateLogMetricRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateLogMetricRequest. */ + interface IUpdateLogMetricRequest { + + /** UpdateLogMetricRequest metricName */ + metricName?: (string|null); + + /** UpdateLogMetricRequest metric */ + metric?: (google.logging.v2.ILogMetric|null); + } + + /** 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 }; + + /** + * Gets the default type url for UpdateLogMetricRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for DeleteLogMetricRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a MonitoredResourceDescriptor. */ + interface IMonitoredResourceDescriptor { + + /** MonitoredResourceDescriptor name */ + name?: (string|null); + + /** MonitoredResourceDescriptor type */ + type?: (string|null); + + /** MonitoredResourceDescriptor displayName */ + displayName?: (string|null); + + /** MonitoredResourceDescriptor description */ + description?: (string|null); + + /** MonitoredResourceDescriptor labels */ + labels?: (google.api.ILabelDescriptor[]|null); + + /** MonitoredResourceDescriptor launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + } + + /** Represents a MonitoredResourceDescriptor. */ + class MonitoredResourceDescriptor implements IMonitoredResourceDescriptor { + + /** + * Constructs a new MonitoredResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoredResourceDescriptor); + + /** MonitoredResourceDescriptor name. */ + public name: string; + + /** MonitoredResourceDescriptor type. */ + public type: string; + + /** MonitoredResourceDescriptor displayName. */ + public displayName: string; + + /** MonitoredResourceDescriptor description. */ + public description: string; + + /** MonitoredResourceDescriptor labels. */ + public labels: google.api.ILabelDescriptor[]; + + /** MonitoredResourceDescriptor launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** + * Creates a new MonitoredResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoredResourceDescriptor instance + */ + public static create(properties?: google.api.IMonitoredResourceDescriptor): google.api.MonitoredResourceDescriptor; + + /** + * Encodes the specified MonitoredResourceDescriptor message. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @param message MonitoredResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoredResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoredResourceDescriptor message, length delimited. Does not implicitly {@link google.api.MonitoredResourceDescriptor.verify|verify} messages. + * @param message MonitoredResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoredResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoredResourceDescriptor + * @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.MonitoredResourceDescriptor; + + /** + * Decodes a MonitoredResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoredResourceDescriptor + * @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.MonitoredResourceDescriptor; + + /** + * Verifies a MonitoredResourceDescriptor 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 MonitoredResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoredResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.MonitoredResourceDescriptor; + + /** + * Creates a plain object from a MonitoredResourceDescriptor message. Also converts values to other types if specified. + * @param message MonitoredResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MonitoredResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoredResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoredResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonitoredResource. */ + interface IMonitoredResource { + + /** MonitoredResource type */ + type?: (string|null); + + /** MonitoredResource labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a MonitoredResource. */ + class MonitoredResource implements IMonitoredResource { + + /** + * Constructs a new MonitoredResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoredResource); + + /** MonitoredResource type. */ + public type: string; + + /** MonitoredResource labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new MonitoredResource instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoredResource instance + */ + public static create(properties?: google.api.IMonitoredResource): google.api.MonitoredResource; + + /** + * Encodes the specified MonitoredResource message. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @param message MonitoredResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoredResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoredResource message, length delimited. Does not implicitly {@link google.api.MonitoredResource.verify|verify} messages. + * @param message MonitoredResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoredResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoredResource + * @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.MonitoredResource; + + /** + * Decodes a MonitoredResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoredResource + * @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.MonitoredResource; + + /** + * Verifies a MonitoredResource 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 MonitoredResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoredResource + */ + public static fromObject(object: { [k: string]: any }): google.api.MonitoredResource; + + /** + * Creates a plain object from a MonitoredResource message. Also converts values to other types if specified. + * @param message MonitoredResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MonitoredResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoredResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoredResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MonitoredResourceMetadata. */ + interface IMonitoredResourceMetadata { + + /** MonitoredResourceMetadata systemLabels */ + systemLabels?: (google.protobuf.IStruct|null); + + /** MonitoredResourceMetadata userLabels */ + userLabels?: ({ [k: string]: string }|null); + } + + /** Represents a MonitoredResourceMetadata. */ + class MonitoredResourceMetadata implements IMonitoredResourceMetadata { + + /** + * Constructs a new MonitoredResourceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMonitoredResourceMetadata); + + /** MonitoredResourceMetadata systemLabels. */ + public systemLabels?: (google.protobuf.IStruct|null); + + /** MonitoredResourceMetadata userLabels. */ + public userLabels: { [k: string]: string }; + + /** + * Creates a new MonitoredResourceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns MonitoredResourceMetadata instance + */ + public static create(properties?: google.api.IMonitoredResourceMetadata): google.api.MonitoredResourceMetadata; + + /** + * Encodes the specified MonitoredResourceMetadata message. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @param message MonitoredResourceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMonitoredResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MonitoredResourceMetadata message, length delimited. Does not implicitly {@link google.api.MonitoredResourceMetadata.verify|verify} messages. + * @param message MonitoredResourceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMonitoredResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MonitoredResourceMetadata + * @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.MonitoredResourceMetadata; + + /** + * Decodes a MonitoredResourceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MonitoredResourceMetadata + * @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.MonitoredResourceMetadata; + + /** + * Verifies a MonitoredResourceMetadata 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 MonitoredResourceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MonitoredResourceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.api.MonitoredResourceMetadata; + + /** + * Creates a plain object from a MonitoredResourceMetadata message. Also converts values to other types if specified. + * @param message MonitoredResourceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MonitoredResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MonitoredResourceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MonitoredResourceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LabelDescriptor. */ + interface ILabelDescriptor { + + /** LabelDescriptor key */ + key?: (string|null); + + /** LabelDescriptor valueType */ + valueType?: (google.api.LabelDescriptor.ValueType|keyof typeof google.api.LabelDescriptor.ValueType|null); + + /** LabelDescriptor description */ + description?: (string|null); + } + + /** Represents a LabelDescriptor. */ + class LabelDescriptor implements ILabelDescriptor { + + /** + * Constructs a new LabelDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ILabelDescriptor); + + /** LabelDescriptor key. */ + public key: string; + + /** LabelDescriptor valueType. */ + public valueType: (google.api.LabelDescriptor.ValueType|keyof typeof google.api.LabelDescriptor.ValueType); + + /** LabelDescriptor description. */ + public description: string; + + /** + * Creates a new LabelDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelDescriptor instance + */ + public static create(properties?: google.api.ILabelDescriptor): google.api.LabelDescriptor; + + /** + * Encodes the specified LabelDescriptor message. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @param message LabelDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ILabelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelDescriptor message, length delimited. Does not implicitly {@link google.api.LabelDescriptor.verify|verify} messages. + * @param message LabelDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ILabelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelDescriptor + * @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.LabelDescriptor; + + /** + * Decodes a LabelDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelDescriptor + * @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.LabelDescriptor; + + /** + * Verifies a LabelDescriptor 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 LabelDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.LabelDescriptor; + + /** + * Creates a plain object from a LabelDescriptor message. Also converts values to other types if specified. + * @param message LabelDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.LabelDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LabelDescriptor { + + /** ValueType enum. */ + enum ValueType { + STRING = 0, + BOOL = 1, + INT64 = 2 + } + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.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); + + /** + * 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 }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * 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 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 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 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 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 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 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 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 }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + + /** CommonLanguageSettings selectiveGapicGeneration */ + selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** CommonLanguageSettings selectiveGapicGeneration. */ + public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @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.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @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.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @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.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @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.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @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.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @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.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @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.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @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.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures */ + experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** PythonSettings experimentalFeatures. */ + public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @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.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @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.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PythonSettings { + + /** Properties of an ExperimentalFeatures. */ + interface IExperimentalFeatures { + + /** ExperimentalFeatures restAsyncIoEnabled */ + restAsyncIoEnabled?: (boolean|null); + + /** ExperimentalFeatures protobufPythonicTypesEnabled */ + protobufPythonicTypesEnabled?: (boolean|null); + + /** ExperimentalFeatures unversionedPackageDisabled */ + unversionedPackageDisabled?: (boolean|null); + } + + /** Represents an ExperimentalFeatures. */ + class ExperimentalFeatures implements IExperimentalFeatures { + + /** + * Constructs a new ExperimentalFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); + + /** ExperimentalFeatures restAsyncIoEnabled. */ + public restAsyncIoEnabled: boolean; + + /** ExperimentalFeatures protobufPythonicTypesEnabled. */ + public protobufPythonicTypesEnabled: boolean; + + /** ExperimentalFeatures unversionedPackageDisabled. */ + public unversionedPackageDisabled: boolean; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns ExperimentalFeatures instance + */ + public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @param message ExperimentalFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExperimentalFeatures + * @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.PythonSettings.ExperimentalFeatures; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExperimentalFeatures + * @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.PythonSettings.ExperimentalFeatures; + + /** + * Verifies an ExperimentalFeatures 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 ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExperimentalFeatures + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @param message ExperimentalFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExperimentalFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @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.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @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.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @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.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @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.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @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.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @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.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** GoSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @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.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @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.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @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.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @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.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @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.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @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.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** Properties of a SelectiveGapicGeneration. */ + interface ISelectiveGapicGeneration { + + /** SelectiveGapicGeneration methods */ + methods?: (string[]|null); + + /** SelectiveGapicGeneration generateOmittedAsInternal */ + generateOmittedAsInternal?: (boolean|null); + } + + /** Represents a SelectiveGapicGeneration. */ + class SelectiveGapicGeneration implements ISelectiveGapicGeneration { + + /** + * Constructs a new SelectiveGapicGeneration. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ISelectiveGapicGeneration); + + /** SelectiveGapicGeneration methods. */ + public methods: string[]; + + /** SelectiveGapicGeneration generateOmittedAsInternal. */ + public generateOmittedAsInternal: boolean; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectiveGapicGeneration instance + */ + public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @param message SelectiveGapicGeneration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectiveGapicGeneration + * @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.SelectiveGapicGeneration; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectiveGapicGeneration + * @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.SelectiveGapicGeneration; + + /** + * Verifies a SelectiveGapicGeneration 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 SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectiveGapicGeneration + */ + public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @param message SelectiveGapicGeneration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Distribution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for Range + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for BucketOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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 }; + + /** + * Gets the default type url for Linear + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for Exponential + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Converts this Explicit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Explicit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Exemplar. */ + interface IExemplar { + + /** Exemplar value */ + value?: (number|null); + + /** Exemplar timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); + + /** Exemplar attachments */ + attachments?: (google.protobuf.IAny[]|null); + } + + /** Represents an Exemplar. */ + class Exemplar implements IExemplar { + + /** + * Constructs a new Exemplar. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.IExemplar); + + /** Exemplar value. */ + public value: number; + + /** Exemplar timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); + + /** Exemplar attachments. */ + public attachments: google.protobuf.IAny[]; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 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; + + /** + * 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); + + /** + * 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 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 }; + + /** + * Converts this Exemplar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Exemplar + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a MetricDescriptor. */ + interface IMetricDescriptor { + + /** MetricDescriptor 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); + + /** MetricDescriptor valueType */ + valueType?: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType|null); + + /** MetricDescriptor unit */ + unit?: (string|null); + + /** MetricDescriptor description */ + description?: (string|null); + + /** MetricDescriptor displayName */ + displayName?: (string|null); + + /** MetricDescriptor metadata */ + metadata?: (google.api.MetricDescriptor.IMetricDescriptorMetadata|null); + + /** MetricDescriptor launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** MetricDescriptor monitoredResourceTypes */ + monitoredResourceTypes?: (string[]|null); + } + + /** Represents a MetricDescriptor. */ + class MetricDescriptor implements IMetricDescriptor { + + /** + * Constructs a new MetricDescriptor. + * @param [properties] Properties to set + */ + 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); + + /** MetricDescriptor valueType. */ + public valueType: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType); + + /** MetricDescriptor unit. */ + public unit: string; + + /** 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 MetricDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricDescriptor instance + */ + public static create(properties?: google.api.IMetricDescriptor): google.api.MetricDescriptor; + + /** + * 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.IMetricDescriptor, 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 + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMetricDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.MetricDescriptor; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.MetricDescriptor; + + /** + * 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 MetricDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.MetricDescriptor; + + /** + * 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.MetricDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetricDescriptor { + + /** MetricKind enum. */ + enum MetricKind { + METRIC_KIND_UNSPECIFIED = 0, + GAUGE = 1, + DELTA = 2, + CUMULATIVE = 3 + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + BOOL = 1, + INT64 = 2, + DOUBLE = 3, + STRING = 4, + DISTRIBUTION = 5, + MONEY = 6 + } + + /** 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); + + /** MetricDescriptorMetadata timeSeriesResourceHierarchyLevel */ + timeSeriesResourceHierarchyLevel?: (google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[]|null); + } + + /** Represents a MetricDescriptorMetadata. */ + class MetricDescriptorMetadata implements IMetricDescriptorMetadata { + + /** + * Constructs a new MetricDescriptorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MetricDescriptor.IMetricDescriptorMetadata); + + /** MetricDescriptorMetadata launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** MetricDescriptorMetadata samplePeriod. */ + public samplePeriod?: (google.protobuf.IDuration|null); + + /** MetricDescriptorMetadata ingestDelay. */ + public ingestDelay?: (google.protobuf.IDuration|null); + + /** MetricDescriptorMetadata timeSeriesResourceHierarchyLevel. */ + public timeSeriesResourceHierarchyLevel: google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[]; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this MetricDescriptorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricDescriptorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetricDescriptorMetadata { + + /** TimeSeriesResourceHierarchyLevel enum. */ + enum TimeSeriesResourceHierarchyLevel { + TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0, + PROJECT = 1, + ORGANIZATION = 2, + FOLDER = 3 + } + } + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric type */ + type?: (string|null); + + /** Metric labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMetric); + + /** Metric type. */ + public type: string; + + /** Metric labels. */ + public labels: { [k: string]: string }; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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; + + /** + * 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 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; + + /** + * 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; + + /** + * 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 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; + + /** + * 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 }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * 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 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 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 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 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 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 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 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 ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * 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 }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * 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.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.longrunning.DeleteOperationRequest; + + /** + * 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * 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.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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); + + /** + * 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; + + /** + * 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 }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * 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.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.longrunning.OperationInfo; + + /** + * 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 an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * 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.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-logging-api/protos/protos.js b/packages/google-cloud-logging-api/protos/protos.js new file mode 100644 index 000000000000..70405532b9e8 --- /dev/null +++ b/packages/google-cloud-logging-api/protos/protos.js @@ -0,0 +1,54396 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["_google_cloud_logging_api_protos"] || ($protobuf.roots["_google_cloud_logging_api_protos"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Duration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Duration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + message.seconds = $util.Long.fromValue(object.seconds, false); + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.nanos = 0; + } + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); + else if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.file != null && Object.hasOwnProperty.call(message, "file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i], long + 1); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileDescriptorSet: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (!$util.isObject(object.file[i])) + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options, q + 1); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[900] = "EDITION_LEGACY"] = 900; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.optionDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto optionDependency. + * @member {Array.} optionDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.optionDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + if (message.optionDependency != null && message.optionDependency.length) + for (var i = 0; i < message.optionDependency.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 15: { + if (!(message.optionDependency && message.optionDependency.length)) + message.optionDependency = []; + message.optionDependency.push(reader.string()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && Object.hasOwnProperty.call(message, "dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && Object.hasOwnProperty.call(message, "publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && Object.hasOwnProperty.call(message, "weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.optionDependency != null && Object.hasOwnProperty.call(message, "optionDependency")) { + if (!Array.isArray(message.optionDependency)) + return "optionDependency: array expected"; + for (var i = 0; i < message.optionDependency.length; ++i) + if (!$util.isString(message.optionDependency[i])) + return "optionDependency: string[] expected"; + } + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i], long + 1); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i], long + 1); + if (error) + return "enumType." + error; + } + } + if (message.service != null && Object.hasOwnProperty.call(message, "service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i], long + 1); + if (error) + return "service." + error; + } + } + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i], long + 1); + if (error) + return "extension." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo, long + 1); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.optionDependency) { + if (!Array.isArray(object.optionDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); + message.optionDependency = []; + for (var i = 0; i < object.optionDependency.length; ++i) + message.optionDependency[i] = String(object.optionDependency[i]); + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (!$util.isObject(object.messageType[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i], long + 1); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (!$util.isObject(object.enumType[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (!$util.isObject(object.service[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i], long + 1); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (!$util.isObject(object.extension[i])) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options, long + 1); + } + if (object.sourceCodeInfo != null) { + if (!$util.isObject(object.sourceCodeInfo)) + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo, long + 1); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + object.optionDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options, q + 1); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options, q + 1); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options, q + 1); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options, q + 1); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options, q + 1); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + object.syntax = message.syntax; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.optionDependency && message.optionDependency.length) { + object.optionDependency = []; + for (var j = 0; j < message.optionDependency.length; ++j) + object.optionDependency[j] = message.optionDependency[j]; + } + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * DescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.visibility = 0; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 11: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && Object.hasOwnProperty.call(message, "field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i], long + 1); + if (error) + return "field." + error; + } + } + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i], long + 1); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && Object.hasOwnProperty.call(message, "nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i], long + 1); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i], long + 1); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && Object.hasOwnProperty.call(message, "extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i], long + 1); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && Object.hasOwnProperty.call(message, "oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i], long + 1); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i], long + 1); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && Object.hasOwnProperty.call(message, "reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (!$util.isObject(object.field[i])) + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i], long + 1); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (!$util.isObject(object.extension[i])) + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (!$util.isObject(object.nestedType[i])) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i], long + 1); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (!$util.isObject(object.enumType[i])) + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (!$util.isObject(object.extensionRange[i])) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i], long + 1); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (!$util.isObject(object.oneofDecl[i])) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options, long + 1); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (!$util.isObject(object.reservedRange[i])) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i], long + 1); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options, q + 1); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options, q + 1); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options, q + 1); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options, q + 1); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options, q + 1); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options, q + 1); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options, q + 1); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto.ReservedRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && Object.hasOwnProperty.call(message, "declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i], long + 1); + if (error) + return "declaration." + error; + } + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ExtensionRangeOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (!$util.isObject(object.declaration[i])) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i], long + 1); + } + } + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options, q + 1); + } + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.Declaration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + object.number = message.number; + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + object.fullName = message.fullName; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + object.reserved = message.reserved; + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options, long + 1); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + object.extendee = message.extendee; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + object.number = message.number; + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options, q + 1); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.OneofDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * EnumDescriptorProto visibility. + * @member {google.protobuf.SymbolVisibility} visibility + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.visibility = 0; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + case 6: { + message.visibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i], long + 1); + if (error) + return "value." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i], long + 1); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && Object.hasOwnProperty.call(message, "reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + switch (message.visibility) { + default: + return "visibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (!$util.isObject(object.value[i])) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options, long + 1); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (!$util.isObject(object.reservedRange[i])) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i], long + 1); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + switch (object.visibility) { + default: + if (typeof object.visibility === "number") { + message.visibility = object.visibility; + break; + } + break; + case "VISIBILITY_UNSET": + case 0: + message.visibility = 0; + break; + case "VISIBILITY_LOCAL": + case 1: + message.visibility = 1; + break; + case "VISIBILITY_EXPORT": + case 2: + message.visibility = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options, q + 1); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options, q + 1); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) + object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumDescriptorProto.EnumReservedRange: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = message.start; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumValueDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + object.number = message.number; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && Object.hasOwnProperty.call(message, "method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i], long + 1); + if (error) + return "method." + error; + } + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ServiceDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (!$util.isObject(object.method[i])) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i], long + 1); + } + } + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options, q + 1); + } + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options, q + 1); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options, long + 1); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MethodDescriptorProto: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (!$util.isObject(object.options)) + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options, long + 1); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + object.inputType = message.inputType; + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + object.outputType = message.outputType; + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options, q + 1); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i], long + 1); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (!$util.isObject(object[".google.api.resourceDefinition"][i])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options, q + 1); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"], long + 1); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MessageOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.resource"] != null) { + if (!$util.isObject(object[".google.api.resource"])) + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options, q + 1); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.featureSupport = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && Object.hasOwnProperty.call(message, "targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && Object.hasOwnProperty.call(message, "editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i], long + 1); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"], long + 1); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (!$util.isObject(object.editionDefaults[i])) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i], long + 1); + } + } + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.featureSupport != null) { + if (!$util.isObject(object.featureSupport)) + throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (!$util.isObject(object[".google.api.resourceReference"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object.featureSupport = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + object.packed = message.packed; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + object.lazy = message.lazy; + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options, q + 1); + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options, q + 1); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions.EditionDefault: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = message.value; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + FieldOptions.FeatureSupport = (function() { + + /** + * Properties of a FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @interface IFeatureSupport + * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced + * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated + * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning + * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved + */ + + /** + * Constructs a new FeatureSupport. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents a FeatureSupport. + * @implements IFeatureSupport + * @constructor + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + */ + function FeatureSupport(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSupport editionIntroduced. + * @member {google.protobuf.Edition} editionIntroduced + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionIntroduced = 0; + + /** + * FeatureSupport editionDeprecated. + * @member {google.protobuf.Edition} editionDeprecated + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionDeprecated = 0; + + /** + * FeatureSupport deprecationWarning. + * @member {string} deprecationWarning + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.deprecationWarning = ""; + + /** + * FeatureSupport editionRemoved. + * @member {google.protobuf.Edition} editionRemoved + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + */ + FeatureSupport.prototype.editionRemoved = 0; + + /** + * Creates a new FeatureSupport instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance + */ + FeatureSupport.create = function create(properties) { + return new FeatureSupport(properties); + }; + + /** + * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); + return writer; + }; + + /** + * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.editionIntroduced = reader.int32(); + break; + } + case 2: { + message.editionDeprecated = reader.int32(); + break; + } + case 3: { + message.deprecationWarning = reader.string(); + break; + } + case 4: { + message.editionRemoved = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSupport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSupport message. + * @function verify + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSupport.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + switch (message.editionIntroduced) { + default: + return "editionIntroduced: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + switch (message.editionDeprecated) { + default: + return "editionDeprecated: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + if (!$util.isString(message.deprecationWarning)) + return "deprecationWarning: string expected"; + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + switch (message.editionRemoved) { + default: + return "editionRemoved: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport + */ + FeatureSupport.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions.FeatureSupport: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); + switch (object.editionIntroduced) { + default: + if (typeof object.editionIntroduced === "number") { + message.editionIntroduced = object.editionIntroduced; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionIntroduced = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionIntroduced = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionIntroduced = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionIntroduced = 999; + break; + case "EDITION_2023": + case 1000: + message.editionIntroduced = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionIntroduced = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionIntroduced = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionIntroduced = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionIntroduced = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionIntroduced = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionIntroduced = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionIntroduced = 2147483647; + break; + } + switch (object.editionDeprecated) { + default: + if (typeof object.editionDeprecated === "number") { + message.editionDeprecated = object.editionDeprecated; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionDeprecated = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionDeprecated = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionDeprecated = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionDeprecated = 999; + break; + case "EDITION_2023": + case 1000: + message.editionDeprecated = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionDeprecated = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionDeprecated = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionDeprecated = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionDeprecated = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionDeprecated = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionDeprecated = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionDeprecated = 2147483647; + break; + } + if (object.deprecationWarning != null) + message.deprecationWarning = String(object.deprecationWarning); + switch (object.editionRemoved) { + default: + if (typeof object.editionRemoved === "number") { + message.editionRemoved = object.editionRemoved; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.editionRemoved = 0; + break; + case "EDITION_LEGACY": + case 900: + message.editionRemoved = 900; + break; + case "EDITION_PROTO2": + case 998: + message.editionRemoved = 998; + break; + case "EDITION_PROTO3": + case 999: + message.editionRemoved = 999; + break; + case "EDITION_2023": + case 1000: + message.editionRemoved = 1000; + break; + case "EDITION_2024": + case 1001: + message.editionRemoved = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.editionRemoved = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.editionRemoved = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.editionRemoved = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.editionRemoved = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.editionRemoved = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.editionRemoved = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSupport.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.deprecationWarning = ""; + object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) + object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) + object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) + object.deprecationWarning = message.deprecationWarning; + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) + object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; + return object; + }; + + /** + * Converts this FeatureSupport to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @instance + * @returns {Object.} JSON object + */ + FeatureSupport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSupport + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.FeatureSupport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; + }; + + return FeatureSupport; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.OneofOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions featureSupport. + * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.featureSupport = null; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 4: { + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { + var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); + if (error) + return "featureSupport." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumValueOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.featureSupport != null) { + if (!$util.isObject(object.featureSupport)) + throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); + message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + object.featureSupport = null; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + object.debugRedact = message.debugRedact; + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ServiceOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @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 + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + 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 + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); + 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(), q + 1).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(), q + 1).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]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + 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(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"], long + 1); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && Object.hasOwnProperty.call(message, ".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"], long + 1); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MethodOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (!$util.isObject(object.features)) + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (!$util.isObject(object.uninterpretedOption[i])) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); + } + } + if (object[".google.api.http"] != null) { + if (!$util.isObject(object[".google.api.http"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"], long + 1); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + 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 (!$util.isObject(object[".google.longrunning.operationInfo"])) + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"], long + 1); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); + } + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options, q + 1); + 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) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options, q + 1); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i], long + 1); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UninterpretedOption: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (!$util.isObject(object.name[i])) + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i], long + 1); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue, true); + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue, false); + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options, q + 1); + } + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.positiveIntValue = typeof message.positiveIntValue === "number" ? BigInt(message.positiveIntValue) : $util.Long.fromBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0, true).toBigInt(); + else if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.negativeIntValue = typeof message.negativeIntValue === "number" ? BigInt(message.negativeIntValue) : $util.Long.fromBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0, false).toBigInt(); + else if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + if (!Object.hasOwnProperty.call(message, "namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!Object.hasOwnProperty.call(message, "isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UninterpretedOption.NamePart: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && Object.hasOwnProperty.call(message, "namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && Object.hasOwnProperty.call(message, "isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle + * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * FeatureSet enforceNamingStyle. + * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enforceNamingStyle = 0; + + /** + * FeatureSet defaultSymbolVisibility. + * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.defaultSymbolVisibility = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + case 7: { + message.enforceNamingStyle = reader.int32(); + break; + } + case 8: { + message.defaultSymbolVisibility = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + switch (message.enforceNamingStyle) { + default: + return "enforceNamingStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + switch (message.defaultSymbolVisibility) { + default: + return "defaultSymbolVisibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSet: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + switch (object.enforceNamingStyle) { + default: + if (typeof object.enforceNamingStyle === "number") { + message.enforceNamingStyle = object.enforceNamingStyle; + break; + } + break; + case "ENFORCE_NAMING_STYLE_UNKNOWN": + case 0: + message.enforceNamingStyle = 0; + break; + case "STYLE2024": + case 1: + message.enforceNamingStyle = 1; + break; + case "STYLE_LEGACY": + case 2: + message.enforceNamingStyle = 2; + break; + } + switch (object.defaultSymbolVisibility) { + default: + if (typeof object.defaultSymbolVisibility === "number") { + message.defaultSymbolVisibility = object.defaultSymbolVisibility; + break; + } + break; + case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": + case 0: + message.defaultSymbolVisibility = 0; + break; + case "EXPORT_ALL": + case 1: + message.defaultSymbolVisibility = 1; + break; + case "EXPORT_TOP_LEVEL": + case 2: + message.defaultSymbolVisibility = 2; + break; + case "LOCAL_ALL": + case 3: + message.defaultSymbolVisibility = 3; + break; + case "STRICT": + case 4: + message.defaultSymbolVisibility = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; + object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; + } + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) + object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) + object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + /** + * EnforceNamingStyle enum. + * @name google.protobuf.FeatureSet.EnforceNamingStyle + * @enum {number} + * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value + * @property {number} STYLE2024=1 STYLE2024 value + * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value + */ + FeatureSet.EnforceNamingStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; + values[valuesById[1] = "STYLE2024"] = 1; + values[valuesById[2] = "STYLE_LEGACY"] = 2; + return values; + })(); + + FeatureSet.VisibilityFeature = (function() { + + /** + * Properties of a VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @interface IVisibilityFeature + */ + + /** + * Constructs a new VisibilityFeature. + * @memberof google.protobuf.FeatureSet + * @classdesc Represents a VisibilityFeature. + * @implements IVisibilityFeature + * @constructor + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + */ + function VisibilityFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new VisibilityFeature instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance + */ + VisibilityFeature.create = function create(properties) { + return new VisibilityFeature(properties); + }; + + /** + * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VisibilityFeature message. + * @function verify + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VisibilityFeature.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature + */ + VisibilityFeature.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) + return object; + return new $root.google.protobuf.FeatureSet.VisibilityFeature(); + }; + + /** + * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VisibilityFeature.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VisibilityFeature to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @instance + * @returns {Object.} JSON object + */ + VisibilityFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VisibilityFeature + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet.VisibilityFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; + }; + + /** + * DefaultSymbolVisibility enum. + * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + * @enum {number} + * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value + * @property {number} EXPORT_ALL=1 EXPORT_ALL value + * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value + * @property {number} LOCAL_ALL=3 LOCAL_ALL value + * @property {number} STRICT=4 STRICT value + */ + VisibilityFeature.DefaultSymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; + values[valuesById[1] = "EXPORT_ALL"] = 1; + values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; + values[valuesById[3] = "LOCAL_ALL"] = 3; + values[valuesById[4] = "STRICT"] = 4; + return values; + })(); + + return VisibilityFeature; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.defaults != null && Object.hasOwnProperty.call(message, "defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i], long + 1); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSetDefaults: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (!$util.isObject(object.defaults[i])) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i], long + 1); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.minimumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.maximumEdition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options, q + 1); + } + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures + * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault overridableFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.overridableFeatures = null; + + /** + * FeatureSetEditionDefault fixedFeatures. + * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.fixedFeatures = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 4: { + message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 900: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures, long + 1); + if (error) + return "overridableFeatures." + error; + } + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) { + var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures, long + 1); + if (error) + return "fixedFeatures." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_LEGACY": + case 900: + message.edition = 900; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.overridableFeatures != null) { + if (!$util.isObject(object.overridableFeatures)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); + message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures, long + 1); + } + if (object.fixedFeatures != null) { + if (!$util.isObject(object.fixedFeatures)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); + message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.overridableFeatures = null; + object.fixedFeatures = null; + } + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options, q + 1); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options, q + 1); + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.location != null && Object.hasOwnProperty.call(message, "location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i], long + 1); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.SourceCodeInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (!$util.isObject(object.location[i])) + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options, q + 1); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.path != null && Object.hasOwnProperty.call(message, "path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && Object.hasOwnProperty.call(message, "span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && Object.hasOwnProperty.call(message, "leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i], long + 1); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.GeneratedCodeInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (!$util.isObject(object.annotation[i])) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options, q + 1); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.path != null && Object.hasOwnProperty.call(message, "path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + object.begin = message.begin; + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + object.end = message.end; + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + /** + * SymbolVisibility enum. + * @name google.protobuf.SymbolVisibility + * @enum {number} + * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value + * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value + * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value + */ + protobuf.SymbolVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VISIBILITY_UNSET"] = 0; + values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; + values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; + return values; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.fields, key); + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]], long + 1); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Struct) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Struct: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (!$util.isObject(object.fields)) + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.fields, keys[i]); + if (!$util.isObject(object.fields[keys[i]])) + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.fields, keys2[j]); + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options, q + 1); + } + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue, long + 1); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue, long + 1); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Value) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Value: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (!$util.isObject(object.structValue)) + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue, long + 1); + } + if (object.listValue != null) { + if (!$util.isObject(object.listValue)) + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options, q + 1); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options, q + 1); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i], long + 1); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ListValue: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (!$util.isObject(object.values[i])) + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options, q + 1); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Any) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Any: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + object.type_url = message.type_url; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Timestamp: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + message.seconds = $util.Long.fromValue(object.seconds, false); + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.nanos = 0; + } + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); + else if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.paths != null && Object.hasOwnProperty.call(message, "paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldMask: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.logging = (function() { + + /** + * Namespace logging. + * @memberof google + * @namespace + */ + var logging = {}; + + logging.type = (function() { + + /** + * Namespace type. + * @memberof google.logging + * @namespace + */ + var type = {}; + + type.HttpRequest = (function() { + + /** + * Properties of a HttpRequest. + * @memberof google.logging.type + * @interface IHttpRequest + * @property {string|null} [requestMethod] HttpRequest requestMethod + * @property {string|null} [requestUrl] HttpRequest requestUrl + * @property {number|Long|null} [requestSize] HttpRequest requestSize + * @property {number|null} [status] HttpRequest status + * @property {number|Long|null} [responseSize] HttpRequest responseSize + * @property {string|null} [userAgent] HttpRequest userAgent + * @property {string|null} [remoteIp] HttpRequest remoteIp + * @property {string|null} [serverIp] HttpRequest serverIp + * @property {string|null} [referer] HttpRequest referer + * @property {google.protobuf.IDuration|null} [latency] HttpRequest latency + * @property {boolean|null} [cacheLookup] HttpRequest cacheLookup + * @property {boolean|null} [cacheHit] HttpRequest cacheHit + * @property {boolean|null} [cacheValidatedWithOriginServer] HttpRequest cacheValidatedWithOriginServer + * @property {number|Long|null} [cacheFillBytes] HttpRequest cacheFillBytes + * @property {string|null} [protocol] HttpRequest protocol + */ + + /** + * Constructs a new HttpRequest. + * @memberof google.logging.type + * @classdesc Represents a HttpRequest. + * @implements IHttpRequest + * @constructor + * @param {google.logging.type.IHttpRequest=} [properties] Properties to set + */ + function HttpRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRequest requestMethod. + * @member {string} requestMethod + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.requestMethod = ""; + + /** + * HttpRequest requestUrl. + * @member {string} requestUrl + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.requestUrl = ""; + + /** + * HttpRequest requestSize. + * @member {number|Long} requestSize + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.requestSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HttpRequest status. + * @member {number} status + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.status = 0; + + /** + * HttpRequest responseSize. + * @member {number|Long} responseSize + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.responseSize = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HttpRequest userAgent. + * @member {string} userAgent + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.userAgent = ""; + + /** + * HttpRequest remoteIp. + * @member {string} remoteIp + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.remoteIp = ""; + + /** + * HttpRequest serverIp. + * @member {string} serverIp + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.serverIp = ""; + + /** + * HttpRequest referer. + * @member {string} referer + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.referer = ""; + + /** + * HttpRequest latency. + * @member {google.protobuf.IDuration|null|undefined} latency + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.latency = null; + + /** + * HttpRequest cacheLookup. + * @member {boolean} cacheLookup + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.cacheLookup = false; + + /** + * HttpRequest cacheHit. + * @member {boolean} cacheHit + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.cacheHit = false; + + /** + * HttpRequest cacheValidatedWithOriginServer. + * @member {boolean} cacheValidatedWithOriginServer + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.cacheValidatedWithOriginServer = false; + + /** + * HttpRequest cacheFillBytes. + * @member {number|Long} cacheFillBytes + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.cacheFillBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * HttpRequest protocol. + * @member {string} protocol + * @memberof google.logging.type.HttpRequest + * @instance + */ + HttpRequest.prototype.protocol = ""; + + /** + * Creates a new HttpRequest instance using the specified properties. + * @function create + * @memberof google.logging.type.HttpRequest + * @static + * @param {google.logging.type.IHttpRequest=} [properties] Properties to set + * @returns {google.logging.type.HttpRequest} HttpRequest instance + */ + HttpRequest.create = function create(properties) { + return new HttpRequest(properties); + }; + + /** + * Encodes the specified HttpRequest message. Does not implicitly {@link google.logging.type.HttpRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.type.HttpRequest + * @static + * @param {google.logging.type.IHttpRequest} message HttpRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.requestMethod != null && Object.hasOwnProperty.call(message, "requestMethod")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestMethod); + if (message.requestUrl != null && Object.hasOwnProperty.call(message, "requestUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestUrl); + if (message.requestSize != null && Object.hasOwnProperty.call(message, "requestSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.requestSize); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.responseSize != null && Object.hasOwnProperty.call(message, "responseSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.responseSize); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.userAgent); + if (message.remoteIp != null && Object.hasOwnProperty.call(message, "remoteIp")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.remoteIp); + if (message.referer != null && Object.hasOwnProperty.call(message, "referer")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.referer); + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.cacheHit); + if (message.cacheValidatedWithOriginServer != null && Object.hasOwnProperty.call(message, "cacheValidatedWithOriginServer")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.cacheValidatedWithOriginServer); + if (message.cacheLookup != null && Object.hasOwnProperty.call(message, "cacheLookup")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.cacheLookup); + if (message.cacheFillBytes != null && Object.hasOwnProperty.call(message, "cacheFillBytes")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.cacheFillBytes); + if (message.serverIp != null && Object.hasOwnProperty.call(message, "serverIp")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.serverIp); + if (message.latency != null && Object.hasOwnProperty.call(message, "latency")) + $root.google.protobuf.Duration.encode(message.latency, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.protocol); + return writer; + }; + + /** + * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.logging.type.HttpRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.type.HttpRequest + * @static + * @param {google.logging.type.IHttpRequest} message HttpRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a HttpRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.type.HttpRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.type.HttpRequest} HttpRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.type.HttpRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requestMethod = reader.string(); + break; + } + case 2: { + message.requestUrl = reader.string(); + break; + } + case 3: { + message.requestSize = reader.int64(); + break; + } + case 4: { + message.status = reader.int32(); + break; + } + case 5: { + message.responseSize = reader.int64(); + break; + } + case 6: { + message.userAgent = reader.string(); + break; + } + case 7: { + message.remoteIp = reader.string(); + break; + } + case 13: { + message.serverIp = reader.string(); + break; + } + case 8: { + message.referer = reader.string(); + break; + } + case 14: { + message.latency = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.cacheLookup = reader.bool(); + break; + } + case 9: { + message.cacheHit = reader.bool(); + break; + } + case 10: { + message.cacheValidatedWithOriginServer = reader.bool(); + break; + } + case 12: { + message.cacheFillBytes = reader.int64(); + break; + } + case 15: { + message.protocol = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.type.HttpRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.type.HttpRequest} HttpRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRequest message. + * @function verify + * @memberof google.logging.type.HttpRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.requestMethod != null && Object.hasOwnProperty.call(message, "requestMethod")) + if (!$util.isString(message.requestMethod)) + return "requestMethod: string expected"; + if (message.requestUrl != null && Object.hasOwnProperty.call(message, "requestUrl")) + if (!$util.isString(message.requestUrl)) + return "requestUrl: string expected"; + if (message.requestSize != null && Object.hasOwnProperty.call(message, "requestSize")) + if (!$util.isInteger(message.requestSize) && !(message.requestSize && $util.isInteger(message.requestSize.low) && $util.isInteger(message.requestSize.high))) + return "requestSize: integer|Long expected"; + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + if (!$util.isInteger(message.status)) + return "status: integer expected"; + if (message.responseSize != null && Object.hasOwnProperty.call(message, "responseSize")) + if (!$util.isInteger(message.responseSize) && !(message.responseSize && $util.isInteger(message.responseSize.low) && $util.isInteger(message.responseSize.high))) + return "responseSize: integer|Long expected"; + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + if (!$util.isString(message.userAgent)) + return "userAgent: string expected"; + if (message.remoteIp != null && Object.hasOwnProperty.call(message, "remoteIp")) + if (!$util.isString(message.remoteIp)) + return "remoteIp: string expected"; + if (message.serverIp != null && Object.hasOwnProperty.call(message, "serverIp")) + if (!$util.isString(message.serverIp)) + return "serverIp: string expected"; + if (message.referer != null && Object.hasOwnProperty.call(message, "referer")) + if (!$util.isString(message.referer)) + return "referer: string expected"; + if (message.latency != null && Object.hasOwnProperty.call(message, "latency")) { + var error = $root.google.protobuf.Duration.verify(message.latency, long + 1); + if (error) + return "latency." + error; + } + if (message.cacheLookup != null && Object.hasOwnProperty.call(message, "cacheLookup")) + if (typeof message.cacheLookup !== "boolean") + return "cacheLookup: boolean expected"; + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + if (typeof message.cacheHit !== "boolean") + return "cacheHit: boolean expected"; + if (message.cacheValidatedWithOriginServer != null && Object.hasOwnProperty.call(message, "cacheValidatedWithOriginServer")) + if (typeof message.cacheValidatedWithOriginServer !== "boolean") + return "cacheValidatedWithOriginServer: boolean expected"; + if (message.cacheFillBytes != null && Object.hasOwnProperty.call(message, "cacheFillBytes")) + if (!$util.isInteger(message.cacheFillBytes) && !(message.cacheFillBytes && $util.isInteger(message.cacheFillBytes.low) && $util.isInteger(message.cacheFillBytes.high))) + return "cacheFillBytes: integer|Long expected"; + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + if (!$util.isString(message.protocol)) + return "protocol: string expected"; + return null; + }; + + /** + * Creates a HttpRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.type.HttpRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.type.HttpRequest} HttpRequest + */ + HttpRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.type.HttpRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.type.HttpRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.type.HttpRequest(); + if (object.requestMethod != null) + message.requestMethod = String(object.requestMethod); + if (object.requestUrl != null) + message.requestUrl = String(object.requestUrl); + if (object.requestSize != null) + if ($util.Long) + message.requestSize = $util.Long.fromValue(object.requestSize, false); + else if (typeof object.requestSize === "string") + message.requestSize = parseInt(object.requestSize, 10); + else if (typeof object.requestSize === "number") + message.requestSize = object.requestSize; + else if (typeof object.requestSize === "object") + message.requestSize = new $util.LongBits(object.requestSize.low >>> 0, object.requestSize.high >>> 0).toNumber(); + if (object.status != null) + message.status = object.status | 0; + if (object.responseSize != null) + if ($util.Long) + message.responseSize = $util.Long.fromValue(object.responseSize, false); + else if (typeof object.responseSize === "string") + message.responseSize = parseInt(object.responseSize, 10); + else if (typeof object.responseSize === "number") + message.responseSize = object.responseSize; + else if (typeof object.responseSize === "object") + message.responseSize = new $util.LongBits(object.responseSize.low >>> 0, object.responseSize.high >>> 0).toNumber(); + if (object.userAgent != null) + message.userAgent = String(object.userAgent); + if (object.remoteIp != null) + message.remoteIp = String(object.remoteIp); + if (object.serverIp != null) + message.serverIp = String(object.serverIp); + if (object.referer != null) + message.referer = String(object.referer); + if (object.latency != null) { + if (!$util.isObject(object.latency)) + throw TypeError(".google.logging.type.HttpRequest.latency: object expected"); + message.latency = $root.google.protobuf.Duration.fromObject(object.latency, long + 1); + } + if (object.cacheLookup != null) + message.cacheLookup = Boolean(object.cacheLookup); + if (object.cacheHit != null) + message.cacheHit = Boolean(object.cacheHit); + if (object.cacheValidatedWithOriginServer != null) + message.cacheValidatedWithOriginServer = Boolean(object.cacheValidatedWithOriginServer); + if (object.cacheFillBytes != null) + if ($util.Long) + message.cacheFillBytes = $util.Long.fromValue(object.cacheFillBytes, false); + else if (typeof object.cacheFillBytes === "string") + message.cacheFillBytes = parseInt(object.cacheFillBytes, 10); + else if (typeof object.cacheFillBytes === "number") + message.cacheFillBytes = object.cacheFillBytes; + else if (typeof object.cacheFillBytes === "object") + message.cacheFillBytes = new $util.LongBits(object.cacheFillBytes.low >>> 0, object.cacheFillBytes.high >>> 0).toNumber(); + if (object.protocol != null) + message.protocol = String(object.protocol); + return message; + }; + + /** + * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.type.HttpRequest + * @static + * @param {google.logging.type.HttpRequest} message HttpRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.requestMethod = ""; + object.requestUrl = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.requestSize = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.status = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.responseSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.responseSize = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.userAgent = ""; + object.remoteIp = ""; + object.referer = ""; + object.cacheHit = false; + object.cacheValidatedWithOriginServer = false; + object.cacheLookup = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cacheFillBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.cacheFillBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.serverIp = ""; + object.latency = null; + object.protocol = ""; + } + if (message.requestMethod != null && Object.hasOwnProperty.call(message, "requestMethod")) + object.requestMethod = message.requestMethod; + if (message.requestUrl != null && Object.hasOwnProperty.call(message, "requestUrl")) + object.requestUrl = message.requestUrl; + if (message.requestSize != null && Object.hasOwnProperty.call(message, "requestSize")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.requestSize = typeof message.requestSize === "number" ? BigInt(message.requestSize) : $util.Long.fromBits(message.requestSize.low >>> 0, message.requestSize.high >>> 0, false).toBigInt(); + else if (typeof message.requestSize === "number") + object.requestSize = options.longs === String ? String(message.requestSize) : message.requestSize; + else + object.requestSize = options.longs === String ? $util.Long.prototype.toString.call(message.requestSize) : options.longs === Number ? new $util.LongBits(message.requestSize.low >>> 0, message.requestSize.high >>> 0).toNumber() : message.requestSize; + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = message.status; + if (message.responseSize != null && Object.hasOwnProperty.call(message, "responseSize")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.responseSize = typeof message.responseSize === "number" ? BigInt(message.responseSize) : $util.Long.fromBits(message.responseSize.low >>> 0, message.responseSize.high >>> 0, false).toBigInt(); + else if (typeof message.responseSize === "number") + object.responseSize = options.longs === String ? String(message.responseSize) : message.responseSize; + else + object.responseSize = options.longs === String ? $util.Long.prototype.toString.call(message.responseSize) : options.longs === Number ? new $util.LongBits(message.responseSize.low >>> 0, message.responseSize.high >>> 0).toNumber() : message.responseSize; + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + object.userAgent = message.userAgent; + if (message.remoteIp != null && Object.hasOwnProperty.call(message, "remoteIp")) + object.remoteIp = message.remoteIp; + if (message.referer != null && Object.hasOwnProperty.call(message, "referer")) + object.referer = message.referer; + if (message.cacheHit != null && Object.hasOwnProperty.call(message, "cacheHit")) + object.cacheHit = message.cacheHit; + if (message.cacheValidatedWithOriginServer != null && Object.hasOwnProperty.call(message, "cacheValidatedWithOriginServer")) + object.cacheValidatedWithOriginServer = message.cacheValidatedWithOriginServer; + if (message.cacheLookup != null && Object.hasOwnProperty.call(message, "cacheLookup")) + object.cacheLookup = message.cacheLookup; + if (message.cacheFillBytes != null && Object.hasOwnProperty.call(message, "cacheFillBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.cacheFillBytes = typeof message.cacheFillBytes === "number" ? BigInt(message.cacheFillBytes) : $util.Long.fromBits(message.cacheFillBytes.low >>> 0, message.cacheFillBytes.high >>> 0, false).toBigInt(); + else if (typeof message.cacheFillBytes === "number") + object.cacheFillBytes = options.longs === String ? String(message.cacheFillBytes) : message.cacheFillBytes; + else + object.cacheFillBytes = options.longs === String ? $util.Long.prototype.toString.call(message.cacheFillBytes) : options.longs === Number ? new $util.LongBits(message.cacheFillBytes.low >>> 0, message.cacheFillBytes.high >>> 0).toNumber() : message.cacheFillBytes; + if (message.serverIp != null && Object.hasOwnProperty.call(message, "serverIp")) + object.serverIp = message.serverIp; + if (message.latency != null && Object.hasOwnProperty.call(message, "latency")) + object.latency = $root.google.protobuf.Duration.toObject(message.latency, options, q + 1); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + object.protocol = message.protocol; + return object; + }; + + /** + * Converts this HttpRequest to JSON. + * @function toJSON + * @memberof google.logging.type.HttpRequest + * @instance + * @returns {Object.} JSON object + */ + HttpRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRequest + * @function getTypeUrl + * @memberof google.logging.type.HttpRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.type.HttpRequest"; + }; + + return HttpRequest; + })(); + + /** + * LogSeverity enum. + * @name google.logging.type.LogSeverity + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} DEBUG=100 DEBUG value + * @property {number} INFO=200 INFO value + * @property {number} NOTICE=300 NOTICE value + * @property {number} WARNING=400 WARNING value + * @property {number} ERROR=500 ERROR value + * @property {number} CRITICAL=600 CRITICAL value + * @property {number} ALERT=700 ALERT value + * @property {number} EMERGENCY=800 EMERGENCY value + */ + type.LogSeverity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[100] = "DEBUG"] = 100; + values[valuesById[200] = "INFO"] = 200; + values[valuesById[300] = "NOTICE"] = 300; + values[valuesById[400] = "WARNING"] = 400; + values[valuesById[500] = "ERROR"] = 500; + values[valuesById[600] = "CRITICAL"] = 600; + values[valuesById[700] = "ALERT"] = 700; + values[valuesById[800] = "EMERGENCY"] = 800; + return values; + })(); + + return type; + })(); + + logging.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.logging + * @namespace + */ + var v2 = {}; + + v2.LogEntry = (function() { + + /** + * Properties of a LogEntry. + * @memberof google.logging.v2 + * @interface ILogEntry + * @property {string|null} [logName] LogEntry logName + * @property {google.api.IMonitoredResource|null} [resource] LogEntry resource + * @property {google.protobuf.IAny|null} [protoPayload] LogEntry protoPayload + * @property {string|null} [textPayload] LogEntry textPayload + * @property {google.protobuf.IStruct|null} [jsonPayload] LogEntry jsonPayload + * @property {google.protobuf.ITimestamp|null} [timestamp] LogEntry timestamp + * @property {google.protobuf.ITimestamp|null} [receiveTimestamp] LogEntry receiveTimestamp + * @property {google.logging.type.LogSeverity|null} [severity] LogEntry severity + * @property {string|null} [insertId] LogEntry insertId + * @property {google.logging.type.IHttpRequest|null} [httpRequest] LogEntry httpRequest + * @property {Object.|null} [labels] LogEntry labels + * @property {google.logging.v2.ILogEntryOperation|null} [operation] LogEntry operation + * @property {string|null} [trace] LogEntry trace + * @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 + */ + + /** + * Constructs a new LogEntry. + * @memberof google.logging.v2 + * @classdesc Represents a LogEntry. + * @implements ILogEntry + * @constructor + * @param {google.logging.v2.ILogEntry=} [properties] Properties to set + */ + function LogEntry(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogEntry logName. + * @member {string} logName + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.logName = ""; + + /** + * LogEntry resource. + * @member {google.api.IMonitoredResource|null|undefined} resource + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.resource = null; + + /** + * LogEntry protoPayload. + * @member {google.protobuf.IAny|null|undefined} protoPayload + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.protoPayload = null; + + /** + * LogEntry textPayload. + * @member {string|null|undefined} textPayload + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.textPayload = null; + + /** + * LogEntry jsonPayload. + * @member {google.protobuf.IStruct|null|undefined} jsonPayload + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.jsonPayload = null; + + /** + * LogEntry timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.timestamp = null; + + /** + * LogEntry receiveTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} receiveTimestamp + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.receiveTimestamp = null; + + /** + * LogEntry severity. + * @member {google.logging.type.LogSeverity} severity + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.severity = 0; + + /** + * LogEntry insertId. + * @member {string} insertId + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.insertId = ""; + + /** + * LogEntry httpRequest. + * @member {google.logging.type.IHttpRequest|null|undefined} httpRequest + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.httpRequest = null; + + /** + * LogEntry labels. + * @member {Object.} labels + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.labels = $util.emptyObject; + + /** + * LogEntry operation. + * @member {google.logging.v2.ILogEntryOperation|null|undefined} operation + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.operation = null; + + /** + * LogEntry trace. + * @member {string} trace + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.trace = ""; + + /** + * LogEntry spanId. + * @member {string} spanId + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.spanId = ""; + + /** + * LogEntry traceSampled. + * @member {boolean} traceSampled + * @memberof google.logging.v2.LogEntry + * @instance + */ + LogEntry.prototype.traceSampled = false; + + /** + * LogEntry sourceLocation. + * @member {google.logging.v2.ILogEntrySourceLocation|null|undefined} sourceLocation + * @memberof google.logging.v2.LogEntry + * @instance + */ + 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; + + /** + * LogEntry payload. + * @member {"protoPayload"|"textPayload"|"jsonPayload"|undefined} payload + * @memberof google.logging.v2.LogEntry + * @instance + */ + Object.defineProperty(LogEntry.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["protoPayload", "textPayload", "jsonPayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogEntry instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogEntry + * @static + * @param {google.logging.v2.ILogEntry=} [properties] Properties to set + * @returns {google.logging.v2.LogEntry} LogEntry instance + */ + LogEntry.create = function create(properties) { + return new LogEntry(properties); + }; + + /** + * Encodes the specified LogEntry message. Does not implicitly {@link google.logging.v2.LogEntry.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogEntry + * @static + * @param {google.logging.v2.ILogEntry} message LogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntry.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.protoPayload != null && Object.hasOwnProperty.call(message, "protoPayload")) + $root.google.protobuf.Any.encode(message.protoPayload, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.textPayload != null && Object.hasOwnProperty.call(message, "textPayload")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.textPayload); + if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.insertId); + if (message.jsonPayload != null && Object.hasOwnProperty.call(message, "jsonPayload")) + $root.google.protobuf.Struct.encode(message.jsonPayload, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + if (message.httpRequest != null && Object.hasOwnProperty.call(message, "httpRequest")) + $root.google.logging.type.HttpRequest.encode(message.httpRequest, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.api.MonitoredResource.encode(message.resource, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.severity); + 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 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.logName); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + $root.google.logging.v2.LogEntryOperation.encode(message.operation, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); + if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.trace); + if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) + $root.google.logging.v2.LogEntrySourceLocation.encode(message.sourceLocation, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.receiveTimestamp != null && Object.hasOwnProperty.call(message, "receiveTimestamp")) + $root.google.protobuf.Timestamp.encode(message.receiveTimestamp, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + 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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogEntry message, length delimited. Does not implicitly {@link google.logging.v2.LogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogEntry + * @static + * @param {google.logging.v2.ILogEntry} message LogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogEntry} LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntry.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogEntry(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 12: { + message.logName = reader.string(); + break; + } + case 8: { + message.resource = $root.google.api.MonitoredResource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.protoPayload = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.textPayload = reader.string(); + break; + } + case 6: { + message.jsonPayload = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.receiveTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.severity = reader.int32(); + break; + } + case 4: { + message.insertId = reader.string(); + break; + } + case 7: { + message.httpRequest = $root.google.logging.type.HttpRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 15: { + message.operation = $root.google.logging.v2.LogEntryOperation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.trace = reader.string(); + break; + } + case 27: { + message.spanId = reader.string(); + break; + } + case 30: { + message.traceSampled = reader.bool(); + break; + } + case 23: { + message.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 35: { + message.split = $root.google.logging.v2.LogSplit.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogEntry} LogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogEntry message. + * @function verify + * @memberof google.logging.v2.LogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogEntry.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + if (!$util.isString(message.logName)) + return "logName: string expected"; + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) { + var error = $root.google.api.MonitoredResource.verify(message.resource, long + 1); + if (error) + return "resource." + error; + } + if (message.protoPayload != null && Object.hasOwnProperty.call(message, "protoPayload")) { + properties.payload = 1; + { + var error = $root.google.protobuf.Any.verify(message.protoPayload, long + 1); + if (error) + return "protoPayload." + error; + } + } + if (message.textPayload != null && Object.hasOwnProperty.call(message, "textPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + if (!$util.isString(message.textPayload)) + return "textPayload: string expected"; + } + if (message.jsonPayload != null && Object.hasOwnProperty.call(message, "jsonPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.protobuf.Struct.verify(message.jsonPayload, long + 1); + if (error) + return "jsonPayload." + error; + } + } + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp, long + 1); + if (error) + return "timestamp." + error; + } + if (message.receiveTimestamp != null && Object.hasOwnProperty.call(message, "receiveTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.receiveTimestamp, long + 1); + if (error) + return "receiveTimestamp." + error; + } + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 100: + case 200: + case 300: + case 400: + case 500: + case 600: + case 700: + case 800: + break; + } + if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) + if (!$util.isString(message.insertId)) + return "insertId: string expected"; + if (message.httpRequest != null && Object.hasOwnProperty.call(message, "httpRequest")) { + var error = $root.google.logging.type.HttpRequest.verify(message.httpRequest, long + 1); + if (error) + return "httpRequest." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "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.operation != null && Object.hasOwnProperty.call(message, "operation")) { + var error = $root.google.logging.v2.LogEntryOperation.verify(message.operation, long + 1); + if (error) + return "operation." + error; + } + if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) + if (!$util.isString(message.trace)) + return "trace: string expected"; + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + if (!$util.isString(message.spanId)) + return "spanId: string expected"; + if (message.traceSampled != null && Object.hasOwnProperty.call(message, "traceSampled")) + if (typeof message.traceSampled !== "boolean") + return "traceSampled: boolean expected"; + if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) { + var error = $root.google.logging.v2.LogEntrySourceLocation.verify(message.sourceLocation, long + 1); + if (error) + return "sourceLocation." + error; + } + if (message.split != null && Object.hasOwnProperty.call(message, "split")) { + var error = $root.google.logging.v2.LogSplit.verify(message.split, long + 1); + if (error) + return "split." + error; + } + return null; + }; + + /** + * Creates a LogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogEntry} LogEntry + */ + LogEntry.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogEntry) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogEntry: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogEntry(); + if (object.logName != null) + message.logName = String(object.logName); + if (object.resource != null) { + if (!$util.isObject(object.resource)) + throw TypeError(".google.logging.v2.LogEntry.resource: object expected"); + message.resource = $root.google.api.MonitoredResource.fromObject(object.resource, long + 1); + } + if (object.protoPayload != null) { + if (!$util.isObject(object.protoPayload)) + throw TypeError(".google.logging.v2.LogEntry.protoPayload: object expected"); + message.protoPayload = $root.google.protobuf.Any.fromObject(object.protoPayload, long + 1); + } + if (object.textPayload != null) + message.textPayload = String(object.textPayload); + if (object.jsonPayload != null) { + if (!$util.isObject(object.jsonPayload)) + throw TypeError(".google.logging.v2.LogEntry.jsonPayload: object expected"); + message.jsonPayload = $root.google.protobuf.Struct.fromObject(object.jsonPayload, long + 1); + } + if (object.timestamp != null) { + if (!$util.isObject(object.timestamp)) + throw TypeError(".google.logging.v2.LogEntry.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp, long + 1); + } + if (object.receiveTimestamp != null) { + if (!$util.isObject(object.receiveTimestamp)) + throw TypeError(".google.logging.v2.LogEntry.receiveTimestamp: object expected"); + message.receiveTimestamp = $root.google.protobuf.Timestamp.fromObject(object.receiveTimestamp, long + 1); + } + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "DEFAULT": + case 0: + message.severity = 0; + break; + case "DEBUG": + case 100: + message.severity = 100; + break; + case "INFO": + case 200: + message.severity = 200; + break; + case "NOTICE": + case 300: + message.severity = 300; + break; + case "WARNING": + case 400: + message.severity = 400; + break; + case "ERROR": + case 500: + message.severity = 500; + break; + case "CRITICAL": + case 600: + message.severity = 600; + break; + case "ALERT": + case 700: + message.severity = 700; + break; + case "EMERGENCY": + case 800: + message.severity = 800; + break; + } + if (object.insertId != null) + message.insertId = String(object.insertId); + if (object.httpRequest != null) { + if (!$util.isObject(object.httpRequest)) + throw TypeError(".google.logging.v2.LogEntry.httpRequest: object expected"); + message.httpRequest = $root.google.logging.type.HttpRequest.fromObject(object.httpRequest, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.logging.v2.LogEntry.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.operation != null) { + if (!$util.isObject(object.operation)) + throw TypeError(".google.logging.v2.LogEntry.operation: object expected"); + message.operation = $root.google.logging.v2.LogEntryOperation.fromObject(object.operation, long + 1); + } + if (object.trace != null) + message.trace = String(object.trace); + if (object.spanId != null) + message.spanId = String(object.spanId); + if (object.traceSampled != null) + message.traceSampled = Boolean(object.traceSampled); + if (object.sourceLocation != null) { + if (!$util.isObject(object.sourceLocation)) + throw TypeError(".google.logging.v2.LogEntry.sourceLocation: object expected"); + message.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.fromObject(object.sourceLocation, long + 1); + } + if (object.split != null) { + if (!$util.isObject(object.split)) + throw TypeError(".google.logging.v2.LogEntry.split: object expected"); + message.split = $root.google.logging.v2.LogSplit.fromObject(object.split, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogEntry + * @static + * @param {google.logging.v2.LogEntry} message LogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogEntry.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.insertId = ""; + object.httpRequest = null; + object.resource = null; + object.timestamp = null; + object.severity = options.enums === String ? "DEFAULT" : 0; + object.logName = ""; + object.operation = null; + object.trace = ""; + object.sourceLocation = null; + object.receiveTimestamp = null; + object.spanId = ""; + object.traceSampled = false; + object.split = null; + } + if (message.protoPayload != null && Object.hasOwnProperty.call(message, "protoPayload")) { + object.protoPayload = $root.google.protobuf.Any.toObject(message.protoPayload, options, q + 1); + if (options.oneofs) + object.payload = "protoPayload"; + } + if (message.textPayload != null && Object.hasOwnProperty.call(message, "textPayload")) { + object.textPayload = message.textPayload; + if (options.oneofs) + object.payload = "textPayload"; + } + if (message.insertId != null && Object.hasOwnProperty.call(message, "insertId")) + object.insertId = message.insertId; + if (message.jsonPayload != null && Object.hasOwnProperty.call(message, "jsonPayload")) { + object.jsonPayload = $root.google.protobuf.Struct.toObject(message.jsonPayload, options, q + 1); + if (options.oneofs) + object.payload = "jsonPayload"; + } + if (message.httpRequest != null && Object.hasOwnProperty.call(message, "httpRequest")) + object.httpRequest = $root.google.logging.type.HttpRequest.toObject(message.httpRequest, options, q + 1); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + object.resource = $root.google.api.MonitoredResource.toObject(message.resource, options, q + 1); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options, q + 1); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + object.severity = options.enums === String ? $root.google.logging.type.LogSeverity[message.severity] === undefined ? message.severity : $root.google.logging.type.LogSeverity[message.severity] : message.severity; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + object.logName = message.logName; + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + object.operation = $root.google.logging.v2.LogEntryOperation.toObject(message.operation, options, q + 1); + if (message.trace != null && Object.hasOwnProperty.call(message, "trace")) + object.trace = message.trace; + if (message.sourceLocation != null && Object.hasOwnProperty.call(message, "sourceLocation")) + object.sourceLocation = $root.google.logging.v2.LogEntrySourceLocation.toObject(message.sourceLocation, options, q + 1); + if (message.receiveTimestamp != null && Object.hasOwnProperty.call(message, "receiveTimestamp")) + object.receiveTimestamp = $root.google.protobuf.Timestamp.toObject(message.receiveTimestamp, options, q + 1); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + object.spanId = message.spanId; + if (message.traceSampled != null && Object.hasOwnProperty.call(message, "traceSampled")) + object.traceSampled = message.traceSampled; + if (message.split != null && Object.hasOwnProperty.call(message, "split")) + object.split = $root.google.logging.v2.LogSplit.toObject(message.split, options, q + 1); + return object; + }; + + /** + * Converts this LogEntry to JSON. + * @function toJSON + * @memberof google.logging.v2.LogEntry + * @instance + * @returns {Object.} JSON object + */ + LogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogEntry + * @function getTypeUrl + * @memberof google.logging.v2.LogEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogEntry"; + }; + + return LogEntry; + })(); + + v2.LogEntryOperation = (function() { + + /** + * Properties of a LogEntryOperation. + * @memberof google.logging.v2 + * @interface ILogEntryOperation + * @property {string|null} [id] LogEntryOperation id + * @property {string|null} [producer] LogEntryOperation producer + * @property {boolean|null} [first] LogEntryOperation first + * @property {boolean|null} [last] LogEntryOperation last + */ + + /** + * Constructs a new LogEntryOperation. + * @memberof google.logging.v2 + * @classdesc Represents a LogEntryOperation. + * @implements ILogEntryOperation + * @constructor + * @param {google.logging.v2.ILogEntryOperation=} [properties] Properties to set + */ + function LogEntryOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogEntryOperation id. + * @member {string} id + * @memberof google.logging.v2.LogEntryOperation + * @instance + */ + LogEntryOperation.prototype.id = ""; + + /** + * LogEntryOperation producer. + * @member {string} producer + * @memberof google.logging.v2.LogEntryOperation + * @instance + */ + LogEntryOperation.prototype.producer = ""; + + /** + * LogEntryOperation first. + * @member {boolean} first + * @memberof google.logging.v2.LogEntryOperation + * @instance + */ + LogEntryOperation.prototype.first = false; + + /** + * LogEntryOperation last. + * @member {boolean} last + * @memberof google.logging.v2.LogEntryOperation + * @instance + */ + LogEntryOperation.prototype.last = false; + + /** + * Creates a new LogEntryOperation instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {google.logging.v2.ILogEntryOperation=} [properties] Properties to set + * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation instance + */ + LogEntryOperation.create = function create(properties) { + return new LogEntryOperation(properties); + }; + + /** + * Encodes the specified LogEntryOperation message. Does not implicitly {@link google.logging.v2.LogEntryOperation.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {google.logging.v2.ILogEntryOperation} message LogEntryOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntryOperation.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.producer != null && Object.hasOwnProperty.call(message, "producer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.producer); + if (message.first != null && Object.hasOwnProperty.call(message, "first")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.first); + if (message.last != null && Object.hasOwnProperty.call(message, "last")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.last); + return writer; + }; + + /** + * Encodes the specified LogEntryOperation message, length delimited. Does not implicitly {@link google.logging.v2.LogEntryOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {google.logging.v2.ILogEntryOperation} message LogEntryOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntryOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogEntryOperation message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntryOperation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogEntryOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.producer = reader.string(); + break; + } + case 3: { + message.first = reader.bool(); + break; + } + case 4: { + message.last = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogEntryOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntryOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogEntryOperation message. + * @function verify + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogEntryOperation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.producer != null && Object.hasOwnProperty.call(message, "producer")) + if (!$util.isString(message.producer)) + return "producer: string expected"; + if (message.first != null && Object.hasOwnProperty.call(message, "first")) + if (typeof message.first !== "boolean") + return "first: boolean expected"; + if (message.last != null && Object.hasOwnProperty.call(message, "last")) + if (typeof message.last !== "boolean") + return "last: boolean expected"; + return null; + }; + + /** + * Creates a LogEntryOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogEntryOperation} LogEntryOperation + */ + LogEntryOperation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogEntryOperation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogEntryOperation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogEntryOperation(); + if (object.id != null) + message.id = String(object.id); + if (object.producer != null) + message.producer = String(object.producer); + if (object.first != null) + message.first = Boolean(object.first); + if (object.last != null) + message.last = Boolean(object.last); + return message; + }; + + /** + * Creates a plain object from a LogEntryOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {google.logging.v2.LogEntryOperation} message LogEntryOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogEntryOperation.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.id = ""; + object.producer = ""; + object.first = false; + object.last = false; + } + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + object.id = message.id; + if (message.producer != null && Object.hasOwnProperty.call(message, "producer")) + object.producer = message.producer; + if (message.first != null && Object.hasOwnProperty.call(message, "first")) + object.first = message.first; + if (message.last != null && Object.hasOwnProperty.call(message, "last")) + object.last = message.last; + return object; + }; + + /** + * Converts this LogEntryOperation to JSON. + * @function toJSON + * @memberof google.logging.v2.LogEntryOperation + * @instance + * @returns {Object.} JSON object + */ + LogEntryOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogEntryOperation + * @function getTypeUrl + * @memberof google.logging.v2.LogEntryOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogEntryOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogEntryOperation"; + }; + + return LogEntryOperation; + })(); + + v2.LogEntrySourceLocation = (function() { + + /** + * Properties of a LogEntrySourceLocation. + * @memberof google.logging.v2 + * @interface ILogEntrySourceLocation + * @property {string|null} [file] LogEntrySourceLocation file + * @property {number|Long|null} [line] LogEntrySourceLocation line + * @property {string|null} ["function"] LogEntrySourceLocation function + */ + + /** + * Constructs a new LogEntrySourceLocation. + * @memberof google.logging.v2 + * @classdesc Represents a LogEntrySourceLocation. + * @implements ILogEntrySourceLocation + * @constructor + * @param {google.logging.v2.ILogEntrySourceLocation=} [properties] Properties to set + */ + function LogEntrySourceLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogEntrySourceLocation file. + * @member {string} file + * @memberof google.logging.v2.LogEntrySourceLocation + * @instance + */ + LogEntrySourceLocation.prototype.file = ""; + + /** + * LogEntrySourceLocation line. + * @member {number|Long} line + * @memberof google.logging.v2.LogEntrySourceLocation + * @instance + */ + LogEntrySourceLocation.prototype.line = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * LogEntrySourceLocation function. + * @member {string} function + * @memberof google.logging.v2.LogEntrySourceLocation + * @instance + */ + LogEntrySourceLocation.prototype["function"] = ""; + + /** + * Creates a new LogEntrySourceLocation instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {google.logging.v2.ILogEntrySourceLocation=} [properties] Properties to set + * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation instance + */ + LogEntrySourceLocation.create = function create(properties) { + return new LogEntrySourceLocation(properties); + }; + + /** + * Encodes the specified LogEntrySourceLocation message. Does not implicitly {@link google.logging.v2.LogEntrySourceLocation.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {google.logging.v2.ILogEntrySourceLocation} message LogEntrySourceLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntrySourceLocation.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.file); + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.line); + if (message["function"] != null && Object.hasOwnProperty.call(message, "function")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message["function"]); + return writer; + }; + + /** + * Encodes the specified LogEntrySourceLocation message, length delimited. Does not implicitly {@link google.logging.v2.LogEntrySourceLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {google.logging.v2.ILogEntrySourceLocation} message LogEntrySourceLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogEntrySourceLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogEntrySourceLocation message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntrySourceLocation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogEntrySourceLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.file = reader.string(); + break; + } + case 2: { + message.line = reader.int64(); + break; + } + case 3: { + message["function"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogEntrySourceLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogEntrySourceLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogEntrySourceLocation message. + * @function verify + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogEntrySourceLocation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + if (!$util.isString(message.file)) + return "file: string expected"; + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + if (!$util.isInteger(message.line) && !(message.line && $util.isInteger(message.line.low) && $util.isInteger(message.line.high))) + return "line: integer|Long expected"; + if (message["function"] != null && Object.hasOwnProperty.call(message, "function")) + if (!$util.isString(message["function"])) + return "function: string expected"; + return null; + }; + + /** + * Creates a LogEntrySourceLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogEntrySourceLocation} LogEntrySourceLocation + */ + LogEntrySourceLocation.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogEntrySourceLocation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogEntrySourceLocation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogEntrySourceLocation(); + if (object.file != null) + message.file = String(object.file); + if (object.line != null) + if ($util.Long) + message.line = $util.Long.fromValue(object.line, false); + else if (typeof object.line === "string") + message.line = parseInt(object.line, 10); + else if (typeof object.line === "number") + message.line = object.line; + else if (typeof object.line === "object") + message.line = new $util.LongBits(object.line.low >>> 0, object.line.high >>> 0).toNumber(); + if (object["function"] != null) + message["function"] = String(object["function"]); + return message; + }; + + /** + * Creates a plain object from a LogEntrySourceLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {google.logging.v2.LogEntrySourceLocation} message LogEntrySourceLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogEntrySourceLocation.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.file = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.line = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.line = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object["function"] = ""; + } + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + object.file = message.file; + if (message.line != null && Object.hasOwnProperty.call(message, "line")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.line = typeof message.line === "number" ? BigInt(message.line) : $util.Long.fromBits(message.line.low >>> 0, message.line.high >>> 0, false).toBigInt(); + else if (typeof message.line === "number") + object.line = options.longs === String ? String(message.line) : message.line; + else + object.line = options.longs === String ? $util.Long.prototype.toString.call(message.line) : options.longs === Number ? new $util.LongBits(message.line.low >>> 0, message.line.high >>> 0).toNumber() : message.line; + if (message["function"] != null && Object.hasOwnProperty.call(message, "function")) + object["function"] = message["function"]; + return object; + }; + + /** + * Converts this LogEntrySourceLocation to JSON. + * @function toJSON + * @memberof google.logging.v2.LogEntrySourceLocation + * @instance + * @returns {Object.} JSON object + */ + LogEntrySourceLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogEntrySourceLocation + * @function getTypeUrl + * @memberof google.logging.v2.LogEntrySourceLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogEntrySourceLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogEntrySourceLocation"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogSplit(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.totalSplits != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.logging.v2.LogSplit) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogSplit: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.uid = ""; + object.index = 0; + object.totalSplits = 0; + } + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + object.uid = message.uid; + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + object.index = message.index; + if (message.totalSplits != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for LogSplit + * @function getTypeUrl + * @memberof google.logging.v2.LogSplit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogSplit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogSplit"; + }; + + return LogSplit; + })(); + + v2.LoggingServiceV2 = (function() { + + /** + * Constructs a new LoggingServiceV2 service. + * @memberof google.logging.v2 + * @classdesc Represents a LoggingServiceV2 + * @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 LoggingServiceV2(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LoggingServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LoggingServiceV2; + + /** + * Creates new LoggingServiceV2 service using the specified rpc implementation. + * @function create + * @memberof google.logging.v2.LoggingServiceV2 + * @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 {LoggingServiceV2} RPC service. Useful where requests and/or responses are streamed. + */ + LoggingServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|deleteLog}. + * @memberof google.logging.v2.LoggingServiceV2 + * @typedef DeleteLogCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteLog. + * @function deleteLog + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IDeleteLogRequest} request DeleteLogRequest message or plain object + * @param {google.logging.v2.LoggingServiceV2.DeleteLogCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LoggingServiceV2.prototype.deleteLog = function deleteLog(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteLog, $root.google.logging.v2.DeleteLogRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteLog" }); + + /** + * Calls DeleteLog. + * @function deleteLog + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IDeleteLogRequest} request DeleteLogRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|writeLogEntries}. + * @memberof google.logging.v2.LoggingServiceV2 + * @typedef WriteLogEntriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.WriteLogEntriesResponse} [response] WriteLogEntriesResponse + */ + + /** + * Calls WriteLogEntries. + * @function writeLogEntries + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IWriteLogEntriesRequest} request WriteLogEntriesRequest message or plain object + * @param {google.logging.v2.LoggingServiceV2.WriteLogEntriesCallback} callback Node-style callback called with the error, if any, and WriteLogEntriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LoggingServiceV2.prototype.writeLogEntries = function writeLogEntries(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, writeLogEntries, $root.google.logging.v2.WriteLogEntriesRequest, $root.google.logging.v2.WriteLogEntriesResponse, request, callback); + }, "name", { value: "WriteLogEntries" }); + + /** + * Calls WriteLogEntries. + * @function writeLogEntries + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IWriteLogEntriesRequest} request WriteLogEntriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|listLogEntries}. + * @memberof google.logging.v2.LoggingServiceV2 + * @typedef ListLogEntriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListLogEntriesResponse} [response] ListLogEntriesResponse + */ + + /** + * Calls ListLogEntries. + * @function listLogEntries + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IListLogEntriesRequest} request ListLogEntriesRequest message or plain object + * @param {google.logging.v2.LoggingServiceV2.ListLogEntriesCallback} callback Node-style callback called with the error, if any, and ListLogEntriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LoggingServiceV2.prototype.listLogEntries = function listLogEntries(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listLogEntries, $root.google.logging.v2.ListLogEntriesRequest, $root.google.logging.v2.ListLogEntriesResponse, request, callback); + }, "name", { value: "ListLogEntries" }); + + /** + * Calls ListLogEntries. + * @function listLogEntries + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IListLogEntriesRequest} request ListLogEntriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|listMonitoredResourceDescriptors}. + * @memberof google.logging.v2.LoggingServiceV2 + * @typedef ListMonitoredResourceDescriptorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListMonitoredResourceDescriptorsResponse} [response] ListMonitoredResourceDescriptorsResponse + */ + + /** + * Calls ListMonitoredResourceDescriptors. + * @function listMonitoredResourceDescriptors + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object + * @param {google.logging.v2.LoggingServiceV2.ListMonitoredResourceDescriptorsCallback} callback Node-style callback called with the error, if any, and ListMonitoredResourceDescriptorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LoggingServiceV2.prototype.listMonitoredResourceDescriptors = function listMonitoredResourceDescriptors(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listMonitoredResourceDescriptors, $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest, $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse, request, callback); + }, "name", { value: "ListMonitoredResourceDescriptors" }); + + /** + * Calls ListMonitoredResourceDescriptors. + * @function listMonitoredResourceDescriptors + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|listLogs}. + * @memberof google.logging.v2.LoggingServiceV2 + * @typedef ListLogsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListLogsResponse} [response] ListLogsResponse + */ + + /** + * Calls ListLogs. + * @function listLogs + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IListLogsRequest} request ListLogsRequest message or plain object + * @param {google.logging.v2.LoggingServiceV2.ListLogsCallback} callback Node-style callback called with the error, if any, and ListLogsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LoggingServiceV2.prototype.listLogs = function listLogs(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listLogs, $root.google.logging.v2.ListLogsRequest, $root.google.logging.v2.ListLogsResponse, request, callback); + }, "name", { value: "ListLogs" }); + + /** + * Calls ListLogs. + * @function listLogs + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.IListLogsRequest} request ListLogsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.LoggingServiceV2|tailLogEntries}. + * @memberof google.logging.v2.LoggingServiceV2 + * @typedef TailLogEntriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.TailLogEntriesResponse} [response] TailLogEntriesResponse + */ + + /** + * Calls TailLogEntries. + * @function tailLogEntries + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.ITailLogEntriesRequest} request TailLogEntriesRequest message or plain object + * @param {google.logging.v2.LoggingServiceV2.TailLogEntriesCallback} callback Node-style callback called with the error, if any, and TailLogEntriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LoggingServiceV2.prototype.tailLogEntries = function tailLogEntries(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, tailLogEntries, $root.google.logging.v2.TailLogEntriesRequest, $root.google.logging.v2.TailLogEntriesResponse, request, callback); + }, "name", { value: "TailLogEntries" }); + + /** + * Calls TailLogEntries. + * @function tailLogEntries + * @memberof google.logging.v2.LoggingServiceV2 + * @instance + * @param {google.logging.v2.ITailLogEntriesRequest} request TailLogEntriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LoggingServiceV2; + })(); + + v2.DeleteLogRequest = (function() { + + /** + * Properties of a DeleteLogRequest. + * @memberof google.logging.v2 + * @interface IDeleteLogRequest + * @property {string|null} [logName] DeleteLogRequest logName + */ + + /** + * Constructs a new DeleteLogRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteLogRequest. + * @implements IDeleteLogRequest + * @constructor + * @param {google.logging.v2.IDeleteLogRequest=} [properties] Properties to set + */ + function DeleteLogRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLogRequest logName. + * @member {string} logName + * @memberof google.logging.v2.DeleteLogRequest + * @instance + */ + DeleteLogRequest.prototype.logName = ""; + + /** + * Creates a new DeleteLogRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {google.logging.v2.IDeleteLogRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest instance + */ + DeleteLogRequest.create = function create(properties) { + return new DeleteLogRequest(properties); + }; + + /** + * Encodes the specified DeleteLogRequest message. Does not implicitly {@link google.logging.v2.DeleteLogRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {google.logging.v2.IDeleteLogRequest} message DeleteLogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.logName); + return writer; + }; + + /** + * Encodes the specified DeleteLogRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLogRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {google.logging.v2.IDeleteLogRequest} message DeleteLogRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLogRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteLogRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteLogRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteLogRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLogRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLogRequest message. + * @function verify + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLogRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + if (!$util.isString(message.logName)) + return "logName: string expected"; + return null; + }; + + /** + * Creates a DeleteLogRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteLogRequest} DeleteLogRequest + */ + DeleteLogRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.DeleteLogRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteLogRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.DeleteLogRequest(); + if (object.logName != null) + message.logName = String(object.logName); + return message; + }; + + /** + * Creates a plain object from a DeleteLogRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {google.logging.v2.DeleteLogRequest} message DeleteLogRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLogRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.logName = ""; + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + object.logName = message.logName; + return object; + }; + + /** + * Converts this DeleteLogRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteLogRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLogRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteLogRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteLogRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLogRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteLogRequest"; + }; + + return DeleteLogRequest; + })(); + + v2.WriteLogEntriesRequest = (function() { + + /** + * Properties of a WriteLogEntriesRequest. + * @memberof google.logging.v2 + * @interface IWriteLogEntriesRequest + * @property {string|null} [logName] WriteLogEntriesRequest logName + * @property {google.api.IMonitoredResource|null} [resource] WriteLogEntriesRequest resource + * @property {Object.|null} [labels] WriteLogEntriesRequest labels + * @property {Array.|null} [entries] WriteLogEntriesRequest entries + * @property {boolean|null} [partialSuccess] WriteLogEntriesRequest partialSuccess + * @property {boolean|null} [dryRun] WriteLogEntriesRequest dryRun + */ + + /** + * Constructs a new WriteLogEntriesRequest. + * @memberof google.logging.v2 + * @classdesc Represents a WriteLogEntriesRequest. + * @implements IWriteLogEntriesRequest + * @constructor + * @param {google.logging.v2.IWriteLogEntriesRequest=} [properties] Properties to set + */ + function WriteLogEntriesRequest(properties) { + this.labels = {}; + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteLogEntriesRequest logName. + * @member {string} logName + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + */ + WriteLogEntriesRequest.prototype.logName = ""; + + /** + * WriteLogEntriesRequest resource. + * @member {google.api.IMonitoredResource|null|undefined} resource + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + */ + WriteLogEntriesRequest.prototype.resource = null; + + /** + * WriteLogEntriesRequest labels. + * @member {Object.} labels + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + */ + WriteLogEntriesRequest.prototype.labels = $util.emptyObject; + + /** + * WriteLogEntriesRequest entries. + * @member {Array.} entries + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + */ + WriteLogEntriesRequest.prototype.entries = $util.emptyArray; + + /** + * WriteLogEntriesRequest partialSuccess. + * @member {boolean} partialSuccess + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + */ + WriteLogEntriesRequest.prototype.partialSuccess = false; + + /** + * WriteLogEntriesRequest dryRun. + * @member {boolean} dryRun + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + */ + WriteLogEntriesRequest.prototype.dryRun = false; + + /** + * Creates a new WriteLogEntriesRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {google.logging.v2.IWriteLogEntriesRequest=} [properties] Properties to set + * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest instance + */ + WriteLogEntriesRequest.create = function create(properties) { + return new WriteLogEntriesRequest(properties); + }; + + /** + * Encodes the specified WriteLogEntriesRequest message. Does not implicitly {@link google.logging.v2.WriteLogEntriesRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {google.logging.v2.IWriteLogEntriesRequest} message WriteLogEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteLogEntriesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.logName); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.api.MonitoredResource.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + 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 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.logging.v2.LogEntry.encode(message.entries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.partialSuccess); + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.dryRun); + return writer; + }; + + /** + * Encodes the specified WriteLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {google.logging.v2.IWriteLogEntriesRequest} message WriteLogEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a WriteLogEntriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteLogEntriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.WriteLogEntriesRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logName = reader.string(); + break; + } + case 2: { + message.resource = $root.google.api.MonitoredResource.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + case 4: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.logging.v2.LogEntry.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 5: { + message.partialSuccess = reader.bool(); + break; + } + case 6: { + message.dryRun = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WriteLogEntriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteLogEntriesRequest message. + * @function verify + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteLogEntriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + if (!$util.isString(message.logName)) + return "logName: string expected"; + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) { + var error = $root.google.api.MonitoredResource.verify(message.resource, long + 1); + if (error) + return "resource." + error; + } + if (message.labels != null && Object.hasOwnProperty.call(message, "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.entries != null && Object.hasOwnProperty.call(message, "entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.logging.v2.LogEntry.verify(message.entries[i], long + 1); + if (error) + return "entries." + error; + } + } + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) + if (typeof message.partialSuccess !== "boolean") + return "partialSuccess: boolean expected"; + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + if (typeof message.dryRun !== "boolean") + return "dryRun: boolean expected"; + return null; + }; + + /** + * Creates a WriteLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.WriteLogEntriesRequest} WriteLogEntriesRequest + */ + WriteLogEntriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.WriteLogEntriesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.WriteLogEntriesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.WriteLogEntriesRequest(); + if (object.logName != null) + message.logName = String(object.logName); + if (object.resource != null) { + if (!$util.isObject(object.resource)) + throw TypeError(".google.logging.v2.WriteLogEntriesRequest.resource: object expected"); + message.resource = $root.google.api.MonitoredResource.fromObject(object.resource, long + 1); + } + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.logging.v2.WriteLogEntriesRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.logging.v2.WriteLogEntriesRequest.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (!$util.isObject(object.entries[i])) + throw TypeError(".google.logging.v2.WriteLogEntriesRequest.entries: object expected"); + message.entries[i] = $root.google.logging.v2.LogEntry.fromObject(object.entries[i], long + 1); + } + } + if (object.partialSuccess != null) + message.partialSuccess = Boolean(object.partialSuccess); + if (object.dryRun != null) + message.dryRun = Boolean(object.dryRun); + return message; + }; + + /** + * Creates a plain object from a WriteLogEntriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {google.logging.v2.WriteLogEntriesRequest} message WriteLogEntriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteLogEntriesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.logName = ""; + object.resource = null; + object.partialSuccess = false; + object.dryRun = false; + } + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + object.logName = message.logName; + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + object.resource = $root.google.api.MonitoredResource.toObject(message.resource, options, q + 1); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.logging.v2.LogEntry.toObject(message.entries[j], options, q + 1); + } + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) + object.partialSuccess = message.partialSuccess; + if (message.dryRun != null && Object.hasOwnProperty.call(message, "dryRun")) + object.dryRun = message.dryRun; + return object; + }; + + /** + * Converts this WriteLogEntriesRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.WriteLogEntriesRequest + * @instance + * @returns {Object.} JSON object + */ + WriteLogEntriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteLogEntriesRequest + * @function getTypeUrl + * @memberof google.logging.v2.WriteLogEntriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteLogEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.WriteLogEntriesRequest"; + }; + + return WriteLogEntriesRequest; + })(); + + v2.WriteLogEntriesResponse = (function() { + + /** + * Properties of a WriteLogEntriesResponse. + * @memberof google.logging.v2 + * @interface IWriteLogEntriesResponse + */ + + /** + * Constructs a new WriteLogEntriesResponse. + * @memberof google.logging.v2 + * @classdesc Represents a WriteLogEntriesResponse. + * @implements IWriteLogEntriesResponse + * @constructor + * @param {google.logging.v2.IWriteLogEntriesResponse=} [properties] Properties to set + */ + function WriteLogEntriesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new WriteLogEntriesResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {google.logging.v2.IWriteLogEntriesResponse=} [properties] Properties to set + * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse instance + */ + WriteLogEntriesResponse.create = function create(properties) { + return new WriteLogEntriesResponse(properties); + }; + + /** + * Encodes the specified WriteLogEntriesResponse message. Does not implicitly {@link google.logging.v2.WriteLogEntriesResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {google.logging.v2.IWriteLogEntriesResponse} message WriteLogEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteLogEntriesResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + return writer; + }; + + /** + * Encodes the specified WriteLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {google.logging.v2.IWriteLogEntriesResponse} message WriteLogEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a WriteLogEntriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteLogEntriesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.WriteLogEntriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WriteLogEntriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteLogEntriesResponse message. + * @function verify + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteLogEntriesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a WriteLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.WriteLogEntriesResponse} WriteLogEntriesResponse + */ + WriteLogEntriesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.WriteLogEntriesResponse) + return object; + return new $root.google.logging.v2.WriteLogEntriesResponse(); + }; + + /** + * Creates a plain object from a WriteLogEntriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {google.logging.v2.WriteLogEntriesResponse} message WriteLogEntriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteLogEntriesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this WriteLogEntriesResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.WriteLogEntriesResponse + * @instance + * @returns {Object.} JSON object + */ + WriteLogEntriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteLogEntriesResponse + * @function getTypeUrl + * @memberof google.logging.v2.WriteLogEntriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteLogEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.WriteLogEntriesResponse"; + }; + + return WriteLogEntriesResponse; + })(); + + v2.WriteLogEntriesPartialErrors = (function() { + + /** + * Properties of a WriteLogEntriesPartialErrors. + * @memberof google.logging.v2 + * @interface IWriteLogEntriesPartialErrors + * @property {Object.|null} [logEntryErrors] WriteLogEntriesPartialErrors logEntryErrors + */ + + /** + * Constructs a new WriteLogEntriesPartialErrors. + * @memberof google.logging.v2 + * @classdesc Represents a WriteLogEntriesPartialErrors. + * @implements IWriteLogEntriesPartialErrors + * @constructor + * @param {google.logging.v2.IWriteLogEntriesPartialErrors=} [properties] Properties to set + */ + function WriteLogEntriesPartialErrors(properties) { + this.logEntryErrors = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteLogEntriesPartialErrors logEntryErrors. + * @member {Object.} logEntryErrors + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @instance + */ + WriteLogEntriesPartialErrors.prototype.logEntryErrors = $util.emptyObject; + + /** + * Creates a new WriteLogEntriesPartialErrors instance using the specified properties. + * @function create + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {google.logging.v2.IWriteLogEntriesPartialErrors=} [properties] Properties to set + * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors instance + */ + WriteLogEntriesPartialErrors.create = function create(properties) { + return new WriteLogEntriesPartialErrors(properties); + }; + + /** + * Encodes the specified WriteLogEntriesPartialErrors message. Does not implicitly {@link google.logging.v2.WriteLogEntriesPartialErrors.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {google.logging.v2.IWriteLogEntriesPartialErrors} message WriteLogEntriesPartialErrors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteLogEntriesPartialErrors.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.logEntryErrors != null && Object.hasOwnProperty.call(message, "logEntryErrors")) + for (var keys = Object.keys(message.logEntryErrors), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); + $root.google.rpc.Status.encode(message.logEntryErrors[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified WriteLogEntriesPartialErrors message, length delimited. Does not implicitly {@link google.logging.v2.WriteLogEntriesPartialErrors.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {google.logging.v2.IWriteLogEntriesPartialErrors} message WriteLogEntriesPartialErrors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WriteLogEntriesPartialErrors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a WriteLogEntriesPartialErrors message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteLogEntriesPartialErrors.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.WriteLogEntriesPartialErrors(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.logEntryErrors === $util.emptyObject) + message.logEntryErrors = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + message.logEntryErrors[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a WriteLogEntriesPartialErrors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WriteLogEntriesPartialErrors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WriteLogEntriesPartialErrors message. + * @function verify + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WriteLogEntriesPartialErrors.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logEntryErrors != null && Object.hasOwnProperty.call(message, "logEntryErrors")) { + if (!$util.isObject(message.logEntryErrors)) + return "logEntryErrors: object expected"; + var key = Object.keys(message.logEntryErrors); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "logEntryErrors: integer key{k:int32} expected"; + { + var error = $root.google.rpc.Status.verify(message.logEntryErrors[key[i]], long + 1); + if (error) + return "logEntryErrors." + error; + } + } + } + return null; + }; + + /** + * Creates a WriteLogEntriesPartialErrors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.WriteLogEntriesPartialErrors} WriteLogEntriesPartialErrors + */ + WriteLogEntriesPartialErrors.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.WriteLogEntriesPartialErrors) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.WriteLogEntriesPartialErrors: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.WriteLogEntriesPartialErrors(); + if (object.logEntryErrors) { + if (!$util.isObject(object.logEntryErrors)) + throw TypeError(".google.logging.v2.WriteLogEntriesPartialErrors.logEntryErrors: object expected"); + message.logEntryErrors = {}; + for (var keys = Object.keys(object.logEntryErrors), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.logEntryErrors, keys[i]); + if (!$util.isObject(object.logEntryErrors[keys[i]])) + throw TypeError(".google.logging.v2.WriteLogEntriesPartialErrors.logEntryErrors: object expected"); + message.logEntryErrors[keys[i]] = $root.google.rpc.Status.fromObject(object.logEntryErrors[keys[i]], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a WriteLogEntriesPartialErrors message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {google.logging.v2.WriteLogEntriesPartialErrors} message WriteLogEntriesPartialErrors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WriteLogEntriesPartialErrors.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.logEntryErrors = {}; + var keys2; + if (message.logEntryErrors && (keys2 = Object.keys(message.logEntryErrors)).length) { + object.logEntryErrors = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.logEntryErrors, keys2[j]); + object.logEntryErrors[keys2[j]] = $root.google.rpc.Status.toObject(message.logEntryErrors[keys2[j]], options, q + 1); + } + } + return object; + }; + + /** + * Converts this WriteLogEntriesPartialErrors to JSON. + * @function toJSON + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @instance + * @returns {Object.} JSON object + */ + WriteLogEntriesPartialErrors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WriteLogEntriesPartialErrors + * @function getTypeUrl + * @memberof google.logging.v2.WriteLogEntriesPartialErrors + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteLogEntriesPartialErrors.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.WriteLogEntriesPartialErrors"; + }; + + return WriteLogEntriesPartialErrors; + })(); + + v2.ListLogEntriesRequest = (function() { + + /** + * Properties of a ListLogEntriesRequest. + * @memberof google.logging.v2 + * @interface IListLogEntriesRequest + * @property {Array.|null} [resourceNames] ListLogEntriesRequest resourceNames + * @property {string|null} [filter] ListLogEntriesRequest filter + * @property {string|null} [orderBy] ListLogEntriesRequest orderBy + * @property {number|null} [pageSize] ListLogEntriesRequest pageSize + * @property {string|null} [pageToken] ListLogEntriesRequest pageToken + */ + + /** + * Constructs a new ListLogEntriesRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListLogEntriesRequest. + * @implements IListLogEntriesRequest + * @constructor + * @param {google.logging.v2.IListLogEntriesRequest=} [properties] Properties to set + */ + function ListLogEntriesRequest(properties) { + this.resourceNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogEntriesRequest resourceNames. + * @member {Array.} resourceNames + * @memberof google.logging.v2.ListLogEntriesRequest + * @instance + */ + ListLogEntriesRequest.prototype.resourceNames = $util.emptyArray; + + /** + * ListLogEntriesRequest filter. + * @member {string} filter + * @memberof google.logging.v2.ListLogEntriesRequest + * @instance + */ + ListLogEntriesRequest.prototype.filter = ""; + + /** + * ListLogEntriesRequest orderBy. + * @member {string} orderBy + * @memberof google.logging.v2.ListLogEntriesRequest + * @instance + */ + ListLogEntriesRequest.prototype.orderBy = ""; + + /** + * ListLogEntriesRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListLogEntriesRequest + * @instance + */ + ListLogEntriesRequest.prototype.pageSize = 0; + + /** + * ListLogEntriesRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListLogEntriesRequest + * @instance + */ + ListLogEntriesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListLogEntriesRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {google.logging.v2.IListLogEntriesRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest instance + */ + ListLogEntriesRequest.create = function create(properties) { + return new ListLogEntriesRequest(properties); + }; + + /** + * Encodes the specified ListLogEntriesRequest message. Does not implicitly {@link google.logging.v2.ListLogEntriesRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {google.logging.v2.IListLogEntriesRequest} message ListLogEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogEntriesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.orderBy); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceNames[i]); + return writer; + }; + + /** + * Encodes the specified ListLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogEntriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {google.logging.v2.IListLogEntriesRequest} message ListLogEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListLogEntriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogEntriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogEntriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 8: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push(reader.string()); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.orderBy = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogEntriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogEntriesRequest message. + * @function verify + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogEntriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceNames != null && Object.hasOwnProperty.call(message, "resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) + if (!$util.isString(message.resourceNames[i])) + return "resourceNames: string[] expected"; + } + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLogEntriesRequest} ListLogEntriesRequest + */ + ListLogEntriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListLogEntriesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLogEntriesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListLogEntriesRequest(); + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.logging.v2.ListLogEntriesRequest.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) + message.resourceNames[i] = String(object.resourceNames[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogEntriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {google.logging.v2.ListLogEntriesRequest} message ListLogEntriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogEntriesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.resourceNames = []; + if (options.defaults) { + object.filter = ""; + object.orderBy = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + object.orderBy = message.orderBy; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = message.resourceNames[j]; + } + return object; + }; + + /** + * Converts this ListLogEntriesRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLogEntriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListLogEntriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogEntriesRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListLogEntriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLogEntriesRequest"; + }; + + return ListLogEntriesRequest; + })(); + + v2.ListLogEntriesResponse = (function() { + + /** + * Properties of a ListLogEntriesResponse. + * @memberof google.logging.v2 + * @interface IListLogEntriesResponse + * @property {Array.|null} [entries] ListLogEntriesResponse entries + * @property {string|null} [nextPageToken] ListLogEntriesResponse nextPageToken + */ + + /** + * Constructs a new ListLogEntriesResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListLogEntriesResponse. + * @implements IListLogEntriesResponse + * @constructor + * @param {google.logging.v2.IListLogEntriesResponse=} [properties] Properties to set + */ + function ListLogEntriesResponse(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogEntriesResponse entries. + * @member {Array.} entries + * @memberof google.logging.v2.ListLogEntriesResponse + * @instance + */ + ListLogEntriesResponse.prototype.entries = $util.emptyArray; + + /** + * ListLogEntriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListLogEntriesResponse + * @instance + */ + ListLogEntriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLogEntriesResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {google.logging.v2.IListLogEntriesResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse instance + */ + ListLogEntriesResponse.create = function create(properties) { + return new ListLogEntriesResponse(properties); + }; + + /** + * Encodes the specified ListLogEntriesResponse message. Does not implicitly {@link google.logging.v2.ListLogEntriesResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {google.logging.v2.IListLogEntriesResponse} message ListLogEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogEntriesResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.logging.v2.LogEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogEntriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {google.logging.v2.IListLogEntriesResponse} message ListLogEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListLogEntriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogEntriesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogEntriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.logging.v2.LogEntry.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogEntriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogEntriesResponse message. + * @function verify + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogEntriesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.logging.v2.LogEntry.verify(message.entries[i], long + 1); + if (error) + return "entries." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLogEntriesResponse} ListLogEntriesResponse + */ + ListLogEntriesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListLogEntriesResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLogEntriesResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListLogEntriesResponse(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.logging.v2.ListLogEntriesResponse.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (!$util.isObject(object.entries[i])) + throw TypeError(".google.logging.v2.ListLogEntriesResponse.entries: object expected"); + message.entries[i] = $root.google.logging.v2.LogEntry.fromObject(object.entries[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogEntriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {google.logging.v2.ListLogEntriesResponse} message ListLogEntriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogEntriesResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.logging.v2.LogEntry.toObject(message.entries[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListLogEntriesResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLogEntriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListLogEntriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogEntriesResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListLogEntriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLogEntriesResponse"; + }; + + return ListLogEntriesResponse; + })(); + + v2.ListMonitoredResourceDescriptorsRequest = (function() { + + /** + * Properties of a ListMonitoredResourceDescriptorsRequest. + * @memberof google.logging.v2 + * @interface IListMonitoredResourceDescriptorsRequest + * @property {number|null} [pageSize] ListMonitoredResourceDescriptorsRequest pageSize + * @property {string|null} [pageToken] ListMonitoredResourceDescriptorsRequest pageToken + */ + + /** + * Constructs a new ListMonitoredResourceDescriptorsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListMonitoredResourceDescriptorsRequest. + * @implements IListMonitoredResourceDescriptorsRequest + * @constructor + * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set + */ + function ListMonitoredResourceDescriptorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMonitoredResourceDescriptorsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @instance + */ + ListMonitoredResourceDescriptorsRequest.prototype.pageSize = 0; + + /** + * ListMonitoredResourceDescriptorsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @instance + */ + ListMonitoredResourceDescriptorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest instance + */ + ListMonitoredResourceDescriptorsRequest.create = function create(properties) { + return new ListMonitoredResourceDescriptorsRequest(properties); + }; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMonitoredResourceDescriptorsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {google.logging.v2.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMonitoredResourceDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMonitoredResourceDescriptorsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMonitoredResourceDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMonitoredResourceDescriptorsRequest message. + * @function verify + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMonitoredResourceDescriptorsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListMonitoredResourceDescriptorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest + */ + ListMonitoredResourceDescriptorsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListMonitoredResourceDescriptorsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListMonitoredResourceDescriptorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {google.logging.v2.ListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMonitoredResourceDescriptorsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + } + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListMonitoredResourceDescriptorsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMonitoredResourceDescriptorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMonitoredResourceDescriptorsRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMonitoredResourceDescriptorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListMonitoredResourceDescriptorsRequest"; + }; + + return ListMonitoredResourceDescriptorsRequest; + })(); + + v2.ListMonitoredResourceDescriptorsResponse = (function() { + + /** + * Properties of a ListMonitoredResourceDescriptorsResponse. + * @memberof google.logging.v2 + * @interface IListMonitoredResourceDescriptorsResponse + * @property {Array.|null} [resourceDescriptors] ListMonitoredResourceDescriptorsResponse resourceDescriptors + * @property {string|null} [nextPageToken] ListMonitoredResourceDescriptorsResponse nextPageToken + */ + + /** + * Constructs a new ListMonitoredResourceDescriptorsResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListMonitoredResourceDescriptorsResponse. + * @implements IListMonitoredResourceDescriptorsResponse + * @constructor + * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set + */ + function ListMonitoredResourceDescriptorsResponse(properties) { + this.resourceDescriptors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMonitoredResourceDescriptorsResponse resourceDescriptors. + * @member {Array.} resourceDescriptors + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @instance + */ + ListMonitoredResourceDescriptorsResponse.prototype.resourceDescriptors = $util.emptyArray; + + /** + * ListMonitoredResourceDescriptorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @instance + */ + ListMonitoredResourceDescriptorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse instance + */ + ListMonitoredResourceDescriptorsResponse.create = function create(properties) { + return new ListMonitoredResourceDescriptorsResponse(properties); + }; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMonitoredResourceDescriptorsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.resourceDescriptors != null && message.resourceDescriptors.length) + for (var i = 0; i < message.resourceDescriptors.length; ++i) + $root.google.api.MonitoredResourceDescriptor.encode(message.resourceDescriptors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {google.logging.v2.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMonitoredResourceDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMonitoredResourceDescriptorsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceDescriptors && message.resourceDescriptors.length)) + message.resourceDescriptors = []; + message.resourceDescriptors.push($root.google.api.MonitoredResourceDescriptor.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMonitoredResourceDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMonitoredResourceDescriptorsResponse message. + * @function verify + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMonitoredResourceDescriptorsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceDescriptors != null && Object.hasOwnProperty.call(message, "resourceDescriptors")) { + if (!Array.isArray(message.resourceDescriptors)) + return "resourceDescriptors: array expected"; + for (var i = 0; i < message.resourceDescriptors.length; ++i) { + var error = $root.google.api.MonitoredResourceDescriptor.verify(message.resourceDescriptors[i], long + 1); + if (error) + return "resourceDescriptors." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMonitoredResourceDescriptorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse + */ + ListMonitoredResourceDescriptorsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListMonitoredResourceDescriptorsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); + if (object.resourceDescriptors) { + if (!Array.isArray(object.resourceDescriptors)) + throw TypeError(".google.logging.v2.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: array expected"); + message.resourceDescriptors = []; + for (var i = 0; i < object.resourceDescriptors.length; ++i) { + if (!$util.isObject(object.resourceDescriptors[i])) + throw TypeError(".google.logging.v2.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: object expected"); + message.resourceDescriptors[i] = $root.google.api.MonitoredResourceDescriptor.fromObject(object.resourceDescriptors[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMonitoredResourceDescriptorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {google.logging.v2.ListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMonitoredResourceDescriptorsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.resourceDescriptors = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceDescriptors && message.resourceDescriptors.length) { + object.resourceDescriptors = []; + for (var j = 0; j < message.resourceDescriptors.length; ++j) + object.resourceDescriptors[j] = $root.google.api.MonitoredResourceDescriptor.toObject(message.resourceDescriptors[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMonitoredResourceDescriptorsResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMonitoredResourceDescriptorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMonitoredResourceDescriptorsResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListMonitoredResourceDescriptorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMonitoredResourceDescriptorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListMonitoredResourceDescriptorsResponse"; + }; + + return ListMonitoredResourceDescriptorsResponse; + })(); + + v2.ListLogsRequest = (function() { + + /** + * Properties of a ListLogsRequest. + * @memberof google.logging.v2 + * @interface IListLogsRequest + * @property {string|null} [parent] ListLogsRequest parent + * @property {Array.|null} [resourceNames] ListLogsRequest resourceNames + * @property {number|null} [pageSize] ListLogsRequest pageSize + * @property {string|null} [pageToken] ListLogsRequest pageToken + */ + + /** + * Constructs a new ListLogsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListLogsRequest. + * @implements IListLogsRequest + * @constructor + * @param {google.logging.v2.IListLogsRequest=} [properties] Properties to set + */ + function ListLogsRequest(properties) { + this.resourceNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogsRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListLogsRequest + * @instance + */ + ListLogsRequest.prototype.parent = ""; + + /** + * ListLogsRequest resourceNames. + * @member {Array.} resourceNames + * @memberof google.logging.v2.ListLogsRequest + * @instance + */ + ListLogsRequest.prototype.resourceNames = $util.emptyArray; + + /** + * ListLogsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListLogsRequest + * @instance + */ + ListLogsRequest.prototype.pageSize = 0; + + /** + * ListLogsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListLogsRequest + * @instance + */ + ListLogsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListLogsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {google.logging.v2.IListLogsRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest instance + */ + ListLogsRequest.create = function create(properties) { + return new ListLogsRequest(properties); + }; + + /** + * Encodes the specified ListLogsRequest message. Does not implicitly {@link google.logging.v2.ListLogsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {google.logging.v2.IListLogsRequest} message ListLogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + 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.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceNames[i]); + return writer; + }; + + /** + * Encodes the specified ListLogsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLogsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {google.logging.v2.IListLogsRequest} message ListLogsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListLogsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 8: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push(reader.string()); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogsRequest message. + * @function verify + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceNames != null && Object.hasOwnProperty.call(message, "resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) + if (!$util.isString(message.resourceNames[i])) + return "resourceNames: string[] expected"; + } + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLogsRequest} ListLogsRequest + */ + ListLogsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListLogsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLogsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListLogsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.logging.v2.ListLogsRequest.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) + message.resourceNames[i] = String(object.resourceNames[i]); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {google.logging.v2.ListLogsRequest} message ListLogsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.resourceNames = []; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = message.resourceNames[j]; + } + return object; + }; + + /** + * Converts this ListLogsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLogsRequest + * @instance + * @returns {Object.} JSON object + */ + ListLogsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogsRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListLogsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLogsRequest"; + }; + + return ListLogsRequest; + })(); + + v2.ListLogsResponse = (function() { + + /** + * Properties of a ListLogsResponse. + * @memberof google.logging.v2 + * @interface IListLogsResponse + * @property {Array.|null} [logNames] ListLogsResponse logNames + * @property {string|null} [nextPageToken] ListLogsResponse nextPageToken + */ + + /** + * Constructs a new ListLogsResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListLogsResponse. + * @implements IListLogsResponse + * @constructor + * @param {google.logging.v2.IListLogsResponse=} [properties] Properties to set + */ + function ListLogsResponse(properties) { + this.logNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogsResponse logNames. + * @member {Array.} logNames + * @memberof google.logging.v2.ListLogsResponse + * @instance + */ + ListLogsResponse.prototype.logNames = $util.emptyArray; + + /** + * ListLogsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListLogsResponse + * @instance + */ + ListLogsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLogsResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {google.logging.v2.IListLogsResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse instance + */ + ListLogsResponse.create = function create(properties) { + return new ListLogsResponse(properties); + }; + + /** + * Encodes the specified ListLogsResponse message. Does not implicitly {@link google.logging.v2.ListLogsResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {google.logging.v2.IListLogsResponse} message ListLogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.logNames != null && message.logNames.length) + for (var i = 0; i < message.logNames.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.logNames[i]); + return writer; + }; + + /** + * Encodes the specified ListLogsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLogsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {google.logging.v2.IListLogsResponse} message ListLogsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLogsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListLogsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + if (!(message.logNames && message.logNames.length)) + message.logNames = []; + message.logNames.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListLogsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLogsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLogsResponse message. + * @function verify + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLogsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logNames != null && Object.hasOwnProperty.call(message, "logNames")) { + if (!Array.isArray(message.logNames)) + return "logNames: array expected"; + for (var i = 0; i < message.logNames.length; ++i) + if (!$util.isString(message.logNames[i])) + return "logNames: string[] expected"; + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLogsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLogsResponse} ListLogsResponse + */ + ListLogsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListLogsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLogsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListLogsResponse(); + if (object.logNames) { + if (!Array.isArray(object.logNames)) + throw TypeError(".google.logging.v2.ListLogsResponse.logNames: array expected"); + message.logNames = []; + for (var i = 0; i < object.logNames.length; ++i) + message.logNames[i] = String(object.logNames[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLogsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {google.logging.v2.ListLogsResponse} message ListLogsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLogsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.logNames = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.logNames && message.logNames.length) { + object.logNames = []; + for (var j = 0; j < message.logNames.length; ++j) + object.logNames[j] = message.logNames[j]; + } + return object; + }; + + /** + * Converts this ListLogsResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLogsResponse + * @instance + * @returns {Object.} JSON object + */ + ListLogsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLogsResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListLogsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLogsResponse"; + }; + + return ListLogsResponse; + })(); + + v2.TailLogEntriesRequest = (function() { + + /** + * Properties of a TailLogEntriesRequest. + * @memberof google.logging.v2 + * @interface ITailLogEntriesRequest + * @property {Array.|null} [resourceNames] TailLogEntriesRequest resourceNames + * @property {string|null} [filter] TailLogEntriesRequest filter + * @property {google.protobuf.IDuration|null} [bufferWindow] TailLogEntriesRequest bufferWindow + */ + + /** + * Constructs a new TailLogEntriesRequest. + * @memberof google.logging.v2 + * @classdesc Represents a TailLogEntriesRequest. + * @implements ITailLogEntriesRequest + * @constructor + * @param {google.logging.v2.ITailLogEntriesRequest=} [properties] Properties to set + */ + function TailLogEntriesRequest(properties) { + this.resourceNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TailLogEntriesRequest resourceNames. + * @member {Array.} resourceNames + * @memberof google.logging.v2.TailLogEntriesRequest + * @instance + */ + TailLogEntriesRequest.prototype.resourceNames = $util.emptyArray; + + /** + * TailLogEntriesRequest filter. + * @member {string} filter + * @memberof google.logging.v2.TailLogEntriesRequest + * @instance + */ + TailLogEntriesRequest.prototype.filter = ""; + + /** + * TailLogEntriesRequest bufferWindow. + * @member {google.protobuf.IDuration|null|undefined} bufferWindow + * @memberof google.logging.v2.TailLogEntriesRequest + * @instance + */ + TailLogEntriesRequest.prototype.bufferWindow = null; + + /** + * Creates a new TailLogEntriesRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {google.logging.v2.ITailLogEntriesRequest=} [properties] Properties to set + * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest instance + */ + TailLogEntriesRequest.create = function create(properties) { + return new TailLogEntriesRequest(properties); + }; + + /** + * Encodes the specified TailLogEntriesRequest message. Does not implicitly {@link google.logging.v2.TailLogEntriesRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {google.logging.v2.ITailLogEntriesRequest} message TailLogEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TailLogEntriesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.resourceNames != null && message.resourceNames.length) + for (var i = 0; i < message.resourceNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceNames[i]); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.bufferWindow != null && Object.hasOwnProperty.call(message, "bufferWindow")) + $root.google.protobuf.Duration.encode(message.bufferWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TailLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {google.logging.v2.ITailLogEntriesRequest} message TailLogEntriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TailLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TailLogEntriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TailLogEntriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.TailLogEntriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceNames && message.resourceNames.length)) + message.resourceNames = []; + message.resourceNames.push(reader.string()); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.bufferWindow = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TailLogEntriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TailLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TailLogEntriesRequest message. + * @function verify + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TailLogEntriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.resourceNames != null && Object.hasOwnProperty.call(message, "resourceNames")) { + if (!Array.isArray(message.resourceNames)) + return "resourceNames: array expected"; + for (var i = 0; i < message.resourceNames.length; ++i) + if (!$util.isString(message.resourceNames[i])) + return "resourceNames: string[] expected"; + } + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.bufferWindow != null && Object.hasOwnProperty.call(message, "bufferWindow")) { + var error = $root.google.protobuf.Duration.verify(message.bufferWindow, long + 1); + if (error) + return "bufferWindow." + error; + } + return null; + }; + + /** + * Creates a TailLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.TailLogEntriesRequest} TailLogEntriesRequest + */ + TailLogEntriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.TailLogEntriesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.TailLogEntriesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.TailLogEntriesRequest(); + if (object.resourceNames) { + if (!Array.isArray(object.resourceNames)) + throw TypeError(".google.logging.v2.TailLogEntriesRequest.resourceNames: array expected"); + message.resourceNames = []; + for (var i = 0; i < object.resourceNames.length; ++i) + message.resourceNames[i] = String(object.resourceNames[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.bufferWindow != null) { + if (!$util.isObject(object.bufferWindow)) + throw TypeError(".google.logging.v2.TailLogEntriesRequest.bufferWindow: object expected"); + message.bufferWindow = $root.google.protobuf.Duration.fromObject(object.bufferWindow, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a TailLogEntriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {google.logging.v2.TailLogEntriesRequest} message TailLogEntriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TailLogEntriesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.resourceNames = []; + if (options.defaults) { + object.filter = ""; + object.bufferWindow = null; + } + if (message.resourceNames && message.resourceNames.length) { + object.resourceNames = []; + for (var j = 0; j < message.resourceNames.length; ++j) + object.resourceNames[j] = message.resourceNames[j]; + } + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.bufferWindow != null && Object.hasOwnProperty.call(message, "bufferWindow")) + object.bufferWindow = $root.google.protobuf.Duration.toObject(message.bufferWindow, options, q + 1); + return object; + }; + + /** + * Converts this TailLogEntriesRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.TailLogEntriesRequest + * @instance + * @returns {Object.} JSON object + */ + TailLogEntriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TailLogEntriesRequest + * @function getTypeUrl + * @memberof google.logging.v2.TailLogEntriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TailLogEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.TailLogEntriesRequest"; + }; + + return TailLogEntriesRequest; + })(); + + v2.TailLogEntriesResponse = (function() { + + /** + * Properties of a TailLogEntriesResponse. + * @memberof google.logging.v2 + * @interface ITailLogEntriesResponse + * @property {Array.|null} [entries] TailLogEntriesResponse entries + * @property {Array.|null} [suppressionInfo] TailLogEntriesResponse suppressionInfo + */ + + /** + * Constructs a new TailLogEntriesResponse. + * @memberof google.logging.v2 + * @classdesc Represents a TailLogEntriesResponse. + * @implements ITailLogEntriesResponse + * @constructor + * @param {google.logging.v2.ITailLogEntriesResponse=} [properties] Properties to set + */ + function TailLogEntriesResponse(properties) { + this.entries = []; + this.suppressionInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * TailLogEntriesResponse entries. + * @member {Array.} entries + * @memberof google.logging.v2.TailLogEntriesResponse + * @instance + */ + TailLogEntriesResponse.prototype.entries = $util.emptyArray; + + /** + * TailLogEntriesResponse suppressionInfo. + * @member {Array.} suppressionInfo + * @memberof google.logging.v2.TailLogEntriesResponse + * @instance + */ + TailLogEntriesResponse.prototype.suppressionInfo = $util.emptyArray; + + /** + * Creates a new TailLogEntriesResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {google.logging.v2.ITailLogEntriesResponse=} [properties] Properties to set + * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse instance + */ + TailLogEntriesResponse.create = function create(properties) { + return new TailLogEntriesResponse(properties); + }; + + /** + * Encodes the specified TailLogEntriesResponse message. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {google.logging.v2.ITailLogEntriesResponse} message TailLogEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TailLogEntriesResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + $root.google.logging.v2.LogEntry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.suppressionInfo != null && message.suppressionInfo.length) + for (var i = 0; i < message.suppressionInfo.length; ++i) + $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.encode(message.suppressionInfo[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified TailLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {google.logging.v2.ITailLogEntriesResponse} message TailLogEntriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TailLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a TailLogEntriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TailLogEntriesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.TailLogEntriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push($root.google.logging.v2.LogEntry.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + if (!(message.suppressionInfo && message.suppressionInfo.length)) + message.suppressionInfo = []; + message.suppressionInfo.push($root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a TailLogEntriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TailLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TailLogEntriesResponse message. + * @function verify + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TailLogEntriesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.entries != null && Object.hasOwnProperty.call(message, "entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) { + var error = $root.google.logging.v2.LogEntry.verify(message.entries[i], long + 1); + if (error) + return "entries." + error; + } + } + if (message.suppressionInfo != null && Object.hasOwnProperty.call(message, "suppressionInfo")) { + if (!Array.isArray(message.suppressionInfo)) + return "suppressionInfo: array expected"; + for (var i = 0; i < message.suppressionInfo.length; ++i) { + var error = $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify(message.suppressionInfo[i], long + 1); + if (error) + return "suppressionInfo." + error; + } + } + return null; + }; + + /** + * Creates a TailLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.TailLogEntriesResponse} TailLogEntriesResponse + */ + TailLogEntriesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.TailLogEntriesResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.TailLogEntriesResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.TailLogEntriesResponse(); + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.logging.v2.TailLogEntriesResponse.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) { + if (!$util.isObject(object.entries[i])) + throw TypeError(".google.logging.v2.TailLogEntriesResponse.entries: object expected"); + message.entries[i] = $root.google.logging.v2.LogEntry.fromObject(object.entries[i], long + 1); + } + } + if (object.suppressionInfo) { + if (!Array.isArray(object.suppressionInfo)) + throw TypeError(".google.logging.v2.TailLogEntriesResponse.suppressionInfo: array expected"); + message.suppressionInfo = []; + for (var i = 0; i < object.suppressionInfo.length; ++i) { + if (!$util.isObject(object.suppressionInfo[i])) + throw TypeError(".google.logging.v2.TailLogEntriesResponse.suppressionInfo: object expected"); + message.suppressionInfo[i] = $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.fromObject(object.suppressionInfo[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a TailLogEntriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {google.logging.v2.TailLogEntriesResponse} message TailLogEntriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TailLogEntriesResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.entries = []; + object.suppressionInfo = []; + } + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = $root.google.logging.v2.LogEntry.toObject(message.entries[j], options, q + 1); + } + if (message.suppressionInfo && message.suppressionInfo.length) { + object.suppressionInfo = []; + for (var j = 0; j < message.suppressionInfo.length; ++j) + object.suppressionInfo[j] = $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.toObject(message.suppressionInfo[j], options, q + 1); + } + return object; + }; + + /** + * Converts this TailLogEntriesResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.TailLogEntriesResponse + * @instance + * @returns {Object.} JSON object + */ + TailLogEntriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TailLogEntriesResponse + * @function getTypeUrl + * @memberof google.logging.v2.TailLogEntriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TailLogEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.TailLogEntriesResponse"; + }; + + TailLogEntriesResponse.SuppressionInfo = (function() { + + /** + * Properties of a SuppressionInfo. + * @memberof google.logging.v2.TailLogEntriesResponse + * @interface ISuppressionInfo + * @property {google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason|null} [reason] SuppressionInfo reason + * @property {number|null} [suppressedCount] SuppressionInfo suppressedCount + */ + + /** + * Constructs a new SuppressionInfo. + * @memberof google.logging.v2.TailLogEntriesResponse + * @classdesc Represents a SuppressionInfo. + * @implements ISuppressionInfo + * @constructor + * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo=} [properties] Properties to set + */ + function SuppressionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuppressionInfo reason. + * @member {google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason} reason + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @instance + */ + SuppressionInfo.prototype.reason = 0; + + /** + * SuppressionInfo suppressedCount. + * @member {number} suppressedCount + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @instance + */ + SuppressionInfo.prototype.suppressedCount = 0; + + /** + * Creates a new SuppressionInfo instance using the specified properties. + * @function create + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo=} [properties] Properties to set + * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo instance + */ + SuppressionInfo.create = function create(properties) { + return new SuppressionInfo(properties); + }; + + /** + * Encodes the specified SuppressionInfo message. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo} message SuppressionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuppressionInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason); + if (message.suppressedCount != null && Object.hasOwnProperty.call(message, "suppressedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.suppressedCount); + return writer; + }; + + /** + * Encodes the specified SuppressionInfo message, length delimited. Does not implicitly {@link google.logging.v2.TailLogEntriesResponse.SuppressionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {google.logging.v2.TailLogEntriesResponse.ISuppressionInfo} message SuppressionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuppressionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SuppressionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuppressionInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.reason = reader.int32(); + break; + } + case 2: { + message.suppressedCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SuppressionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuppressionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuppressionInfo message. + * @function verify + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuppressionInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.suppressedCount != null && Object.hasOwnProperty.call(message, "suppressedCount")) + if (!$util.isInteger(message.suppressedCount)) + return "suppressedCount: integer expected"; + return null; + }; + + /** + * Creates a SuppressionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} SuppressionInfo + */ + SuppressionInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.TailLogEntriesResponse.SuppressionInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "RATE_LIMIT": + case 1: + message.reason = 1; + break; + case "NOT_CONSUMED": + case 2: + message.reason = 2; + break; + } + if (object.suppressedCount != null) + message.suppressedCount = object.suppressedCount | 0; + return message; + }; + + /** + * Creates a plain object from a SuppressionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {google.logging.v2.TailLogEntriesResponse.SuppressionInfo} message SuppressionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuppressionInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.reason = options.enums === String ? "REASON_UNSPECIFIED" : 0; + object.suppressedCount = 0; + } + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + object.reason = options.enums === String ? $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason[message.reason] === undefined ? message.reason : $root.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason[message.reason] : message.reason; + if (message.suppressedCount != null && Object.hasOwnProperty.call(message, "suppressedCount")) + object.suppressedCount = message.suppressedCount; + return object; + }; + + /** + * Converts this SuppressionInfo to JSON. + * @function toJSON + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @instance + * @returns {Object.} JSON object + */ + SuppressionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SuppressionInfo + * @function getTypeUrl + * @memberof google.logging.v2.TailLogEntriesResponse.SuppressionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SuppressionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.TailLogEntriesResponse.SuppressionInfo"; + }; + + /** + * Reason enum. + * @name google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason + * @enum {number} + * @property {number} REASON_UNSPECIFIED=0 REASON_UNSPECIFIED value + * @property {number} RATE_LIMIT=1 RATE_LIMIT value + * @property {number} NOT_CONSUMED=2 NOT_CONSUMED value + */ + SuppressionInfo.Reason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "RATE_LIMIT"] = 1; + values[valuesById[2] = "NOT_CONSUMED"] = 2; + return values; + })(); + + return SuppressionInfo; + })(); + + return TailLogEntriesResponse; + })(); + + v2.ConfigServiceV2 = (function() { + + /** + * Constructs a new ConfigServiceV2 service. + * @memberof google.logging.v2 + * @classdesc Represents a ConfigServiceV2 + * @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 ConfigServiceV2(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ConfigServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConfigServiceV2; + + /** + * Creates new ConfigServiceV2 service using the specified rpc implementation. + * @function create + * @memberof google.logging.v2.ConfigServiceV2 + * @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 {ConfigServiceV2} RPC service. Useful where requests and/or responses are streamed. + */ + ConfigServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listBuckets}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef ListBucketsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListBucketsResponse} [response] ListBucketsResponse + */ + + /** + * Calls ListBuckets. + * @function listBuckets + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListBucketsRequest} request ListBucketsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.ListBucketsCallback} callback Node-style callback called with the error, if any, and ListBucketsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.listBuckets = function listBuckets(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBuckets, $root.google.logging.v2.ListBucketsRequest, $root.google.logging.v2.ListBucketsResponse, request, callback); + }, "name", { value: "ListBuckets" }); + + /** + * Calls ListBuckets. + * @function listBuckets + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListBucketsRequest} request ListBucketsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getBucket}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogBucket} [response] LogBucket + */ + + /** + * Calls GetBucket. + * @function getBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetBucketRequest} request GetBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetBucketCallback} callback Node-style callback called with the error, if any, and LogBucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getBucket = function getBucket(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getBucket, $root.google.logging.v2.GetBucketRequest, $root.google.logging.v2.LogBucket, request, callback); + }, "name", { value: "GetBucket" }); + + /** + * Calls GetBucket. + * @function getBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetBucketRequest} request GetBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createBucketAsync}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CreateBucketAsyncCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBucketAsync. + * @function createBucketAsync + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CreateBucketAsyncCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.createBucketAsync = function createBucketAsync(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBucketAsync, $root.google.logging.v2.CreateBucketRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBucketAsync" }); + + /** + * Calls CreateBucketAsync. + * @function createBucketAsync + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateBucketAsync}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateBucketAsyncCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBucketAsync. + * @function updateBucketAsync + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateBucketAsyncCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateBucketAsync = function updateBucketAsync(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBucketAsync, $root.google.logging.v2.UpdateBucketRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBucketAsync" }); + + /** + * Calls UpdateBucketAsync. + * @function updateBucketAsync + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createBucket}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CreateBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogBucket} [response] LogBucket + */ + + /** + * Calls CreateBucket. + * @function createBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CreateBucketCallback} callback Node-style callback called with the error, if any, and LogBucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.createBucket = function createBucket(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBucket, $root.google.logging.v2.CreateBucketRequest, $root.google.logging.v2.LogBucket, request, callback); + }, "name", { value: "CreateBucket" }); + + /** + * Calls CreateBucket. + * @function createBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateBucketRequest} request CreateBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateBucket}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogBucket} [response] LogBucket + */ + + /** + * Calls UpdateBucket. + * @function updateBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateBucketCallback} callback Node-style callback called with the error, if any, and LogBucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateBucket = function updateBucket(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBucket, $root.google.logging.v2.UpdateBucketRequest, $root.google.logging.v2.LogBucket, request, callback); + }, "name", { value: "UpdateBucket" }); + + /** + * Calls UpdateBucket. + * @function updateBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateBucketRequest} request UpdateBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteBucket}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef DeleteBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBucket. + * @function deleteBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteBucketRequest} request DeleteBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.DeleteBucketCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.deleteBucket = function deleteBucket(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteBucket, $root.google.logging.v2.DeleteBucketRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBucket" }); + + /** + * Calls DeleteBucket. + * @function deleteBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteBucketRequest} request DeleteBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|undeleteBucket}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UndeleteBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls UndeleteBucket. + * @function undeleteBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUndeleteBucketRequest} request UndeleteBucketRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UndeleteBucketCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.undeleteBucket = function undeleteBucket(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, undeleteBucket, $root.google.logging.v2.UndeleteBucketRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "UndeleteBucket" }); + + /** + * Calls UndeleteBucket. + * @function undeleteBucket + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUndeleteBucketRequest} request UndeleteBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listViews}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef ListViewsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListViewsResponse} [response] ListViewsResponse + */ + + /** + * Calls ListViews. + * @function listViews + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListViewsRequest} request ListViewsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.ListViewsCallback} callback Node-style callback called with the error, if any, and ListViewsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.listViews = function listViews(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listViews, $root.google.logging.v2.ListViewsRequest, $root.google.logging.v2.ListViewsResponse, request, callback); + }, "name", { value: "ListViews" }); + + /** + * Calls ListViews. + * @function listViews + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListViewsRequest} request ListViewsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getView}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogView} [response] LogView + */ + + /** + * Calls GetView. + * @function getView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetViewRequest} request GetViewRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetViewCallback} callback Node-style callback called with the error, if any, and LogView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getView = function getView(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getView, $root.google.logging.v2.GetViewRequest, $root.google.logging.v2.LogView, request, callback); + }, "name", { value: "GetView" }); + + /** + * Calls GetView. + * @function getView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetViewRequest} request GetViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createView}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CreateViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogView} [response] LogView + */ + + /** + * Calls CreateView. + * @function createView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateViewRequest} request CreateViewRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CreateViewCallback} callback Node-style callback called with the error, if any, and LogView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.createView = function createView(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createView, $root.google.logging.v2.CreateViewRequest, $root.google.logging.v2.LogView, request, callback); + }, "name", { value: "CreateView" }); + + /** + * Calls CreateView. + * @function createView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateViewRequest} request CreateViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateView}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogView} [response] LogView + */ + + /** + * Calls UpdateView. + * @function updateView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateViewRequest} request UpdateViewRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateViewCallback} callback Node-style callback called with the error, if any, and LogView + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateView = function updateView(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateView, $root.google.logging.v2.UpdateViewRequest, $root.google.logging.v2.LogView, request, callback); + }, "name", { value: "UpdateView" }); + + /** + * Calls UpdateView. + * @function updateView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateViewRequest} request UpdateViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteView}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef DeleteViewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteView. + * @function deleteView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteViewRequest} request DeleteViewRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.DeleteViewCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.deleteView = function deleteView(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteView, $root.google.logging.v2.DeleteViewRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteView" }); + + /** + * Calls DeleteView. + * @function deleteView + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteViewRequest} request DeleteViewRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listSinks}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef ListSinksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListSinksResponse} [response] ListSinksResponse + */ + + /** + * Calls ListSinks. + * @function listSinks + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListSinksRequest} request ListSinksRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.ListSinksCallback} callback Node-style callback called with the error, if any, and ListSinksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.listSinks = function listSinks(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listSinks, $root.google.logging.v2.ListSinksRequest, $root.google.logging.v2.ListSinksResponse, request, callback); + }, "name", { value: "ListSinks" }); + + /** + * Calls ListSinks. + * @function listSinks + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListSinksRequest} request ListSinksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getSink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetSinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogSink} [response] LogSink + */ + + /** + * Calls GetSink. + * @function getSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetSinkRequest} request GetSinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetSinkCallback} callback Node-style callback called with the error, if any, and LogSink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getSink = function getSink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getSink, $root.google.logging.v2.GetSinkRequest, $root.google.logging.v2.LogSink, request, callback); + }, "name", { value: "GetSink" }); + + /** + * Calls GetSink. + * @function getSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetSinkRequest} request GetSinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createSink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CreateSinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogSink} [response] LogSink + */ + + /** + * Calls CreateSink. + * @function createSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateSinkRequest} request CreateSinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CreateSinkCallback} callback Node-style callback called with the error, if any, and LogSink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.createSink = function createSink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createSink, $root.google.logging.v2.CreateSinkRequest, $root.google.logging.v2.LogSink, request, callback); + }, "name", { value: "CreateSink" }); + + /** + * Calls CreateSink. + * @function createSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateSinkRequest} request CreateSinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateSink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateSinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogSink} [response] LogSink + */ + + /** + * Calls UpdateSink. + * @function updateSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateSinkRequest} request UpdateSinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateSinkCallback} callback Node-style callback called with the error, if any, and LogSink + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateSink = function updateSink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateSink, $root.google.logging.v2.UpdateSinkRequest, $root.google.logging.v2.LogSink, request, callback); + }, "name", { value: "UpdateSink" }); + + /** + * Calls UpdateSink. + * @function updateSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateSinkRequest} request UpdateSinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteSink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef DeleteSinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSink. + * @function deleteSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteSinkRequest} request DeleteSinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.DeleteSinkCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.deleteSink = function deleteSink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteSink, $root.google.logging.v2.DeleteSinkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSink" }); + + /** + * Calls DeleteSink. + * @function deleteSink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteSinkRequest} request DeleteSinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createLink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CreateLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateLink. + * @function createLink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateLinkRequest} request CreateLinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CreateLinkCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.createLink = function createLink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createLink, $root.google.logging.v2.CreateLinkRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateLink" }); + + /** + * Calls CreateLink. + * @function createLink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateLinkRequest} request CreateLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteLink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef DeleteLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteLink. + * @function deleteLink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteLinkRequest} request DeleteLinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.DeleteLinkCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.deleteLink = function deleteLink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteLink, $root.google.logging.v2.DeleteLinkRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteLink" }); + + /** + * Calls DeleteLink. + * @function deleteLink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteLinkRequest} request DeleteLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listLinks}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef ListLinksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListLinksResponse} [response] ListLinksResponse + */ + + /** + * Calls ListLinks. + * @function listLinks + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListLinksRequest} request ListLinksRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.ListLinksCallback} callback Node-style callback called with the error, if any, and ListLinksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.listLinks = function listLinks(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listLinks, $root.google.logging.v2.ListLinksRequest, $root.google.logging.v2.ListLinksResponse, request, callback); + }, "name", { value: "ListLinks" }); + + /** + * Calls ListLinks. + * @function listLinks + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListLinksRequest} request ListLinksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getLink}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetLinkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.Link} [response] Link + */ + + /** + * Calls GetLink. + * @function getLink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetLinkRequest} request GetLinkRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetLinkCallback} callback Node-style callback called with the error, if any, and Link + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getLink = function getLink(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getLink, $root.google.logging.v2.GetLinkRequest, $root.google.logging.v2.Link, request, callback); + }, "name", { value: "GetLink" }); + + /** + * Calls GetLink. + * @function getLink + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetLinkRequest} request GetLinkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|listExclusions}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef ListExclusionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.ListExclusionsResponse} [response] ListExclusionsResponse + */ + + /** + * Calls ListExclusions. + * @function listExclusions + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListExclusionsRequest} request ListExclusionsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.ListExclusionsCallback} callback Node-style callback called with the error, if any, and ListExclusionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.listExclusions = function listExclusions(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listExclusions, $root.google.logging.v2.ListExclusionsRequest, $root.google.logging.v2.ListExclusionsResponse, request, callback); + }, "name", { value: "ListExclusions" }); + + /** + * Calls ListExclusions. + * @function listExclusions + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IListExclusionsRequest} request ListExclusionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getExclusion}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetExclusionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogExclusion} [response] LogExclusion + */ + + /** + * Calls GetExclusion. + * @function getExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetExclusionRequest} request GetExclusionRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetExclusionCallback} callback Node-style callback called with the error, if any, and LogExclusion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getExclusion = function getExclusion(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getExclusion, $root.google.logging.v2.GetExclusionRequest, $root.google.logging.v2.LogExclusion, request, callback); + }, "name", { value: "GetExclusion" }); + + /** + * Calls GetExclusion. + * @function getExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetExclusionRequest} request GetExclusionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|createExclusion}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef CreateExclusionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogExclusion} [response] LogExclusion + */ + + /** + * Calls CreateExclusion. + * @function createExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateExclusionRequest} request CreateExclusionRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.CreateExclusionCallback} callback Node-style callback called with the error, if any, and LogExclusion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.createExclusion = function createExclusion(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createExclusion, $root.google.logging.v2.CreateExclusionRequest, $root.google.logging.v2.LogExclusion, request, callback); + }, "name", { value: "CreateExclusion" }); + + /** + * Calls CreateExclusion. + * @function createExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.ICreateExclusionRequest} request CreateExclusionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateExclusion}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateExclusionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.LogExclusion} [response] LogExclusion + */ + + /** + * Calls UpdateExclusion. + * @function updateExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateExclusionRequest} request UpdateExclusionRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateExclusionCallback} callback Node-style callback called with the error, if any, and LogExclusion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateExclusion = function updateExclusion(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateExclusion, $root.google.logging.v2.UpdateExclusionRequest, $root.google.logging.v2.LogExclusion, request, callback); + }, "name", { value: "UpdateExclusion" }); + + /** + * Calls UpdateExclusion. + * @function updateExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateExclusionRequest} request UpdateExclusionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|deleteExclusion}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef DeleteExclusionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteExclusion. + * @function deleteExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteExclusionRequest} request DeleteExclusionRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.DeleteExclusionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.deleteExclusion = function deleteExclusion(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteExclusion, $root.google.logging.v2.DeleteExclusionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteExclusion" }); + + /** + * Calls DeleteExclusion. + * @function deleteExclusion + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IDeleteExclusionRequest} request DeleteExclusionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|getCmekSettings}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef GetCmekSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.CmekSettings} [response] CmekSettings + */ + + /** + * Calls GetCmekSettings. + * @function getCmekSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetCmekSettingsRequest} request GetCmekSettingsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.GetCmekSettingsCallback} callback Node-style callback called with the error, if any, and CmekSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.getCmekSettings = function getCmekSettings(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getCmekSettings, $root.google.logging.v2.GetCmekSettingsRequest, $root.google.logging.v2.CmekSettings, request, callback); + }, "name", { value: "GetCmekSettings" }); + + /** + * Calls GetCmekSettings. + * @function getCmekSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IGetCmekSettingsRequest} request GetCmekSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.logging.v2.ConfigServiceV2|updateCmekSettings}. + * @memberof google.logging.v2.ConfigServiceV2 + * @typedef UpdateCmekSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.logging.v2.CmekSettings} [response] CmekSettings + */ + + /** + * Calls UpdateCmekSettings. + * @function updateCmekSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateCmekSettingsRequest} request UpdateCmekSettingsRequest message or plain object + * @param {google.logging.v2.ConfigServiceV2.UpdateCmekSettingsCallback} callback Node-style callback called with the error, if any, and CmekSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConfigServiceV2.prototype.updateCmekSettings = function updateCmekSettings(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateCmekSettings, $root.google.logging.v2.UpdateCmekSettingsRequest, $root.google.logging.v2.CmekSettings, request, callback); + }, "name", { value: "UpdateCmekSettings" }); + + /** + * Calls UpdateCmekSettings. + * @function updateCmekSettings + * @memberof google.logging.v2.ConfigServiceV2 + * @instance + * @param {google.logging.v2.IUpdateCmekSettingsRequest} request UpdateCmekSettingsRequest message or plain object + * @returns {Promise} Promise + * @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 $protobuf.rpc.Service.prototype.rpcCall.call(this, 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, 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; + })(); + + v2.IndexConfig = (function() { + + /** + * Properties of an IndexConfig. + * @memberof google.logging.v2 + * @interface IIndexConfig + * @property {string|null} [fieldPath] IndexConfig fieldPath + * @property {google.logging.v2.IndexType|null} [type] IndexConfig type + * @property {google.protobuf.ITimestamp|null} [createTime] IndexConfig createTime + */ + + /** + * Constructs a new IndexConfig. + * @memberof google.logging.v2 + * @classdesc Represents an IndexConfig. + * @implements IIndexConfig + * @constructor + * @param {google.logging.v2.IIndexConfig=} [properties] Properties to set + */ + function IndexConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexConfig fieldPath. + * @member {string} fieldPath + * @memberof google.logging.v2.IndexConfig + * @instance + */ + IndexConfig.prototype.fieldPath = ""; + + /** + * IndexConfig type. + * @member {google.logging.v2.IndexType} type + * @memberof google.logging.v2.IndexConfig + * @instance + */ + IndexConfig.prototype.type = 0; + + /** + * IndexConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.IndexConfig + * @instance + */ + IndexConfig.prototype.createTime = null; + + /** + * Creates a new IndexConfig instance using the specified properties. + * @function create + * @memberof google.logging.v2.IndexConfig + * @static + * @param {google.logging.v2.IIndexConfig=} [properties] Properties to set + * @returns {google.logging.v2.IndexConfig} IndexConfig instance + */ + IndexConfig.create = function create(properties) { + return new IndexConfig(properties); + }; + + /** + * Encodes the specified IndexConfig message. Does not implicitly {@link google.logging.v2.IndexConfig.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.IndexConfig + * @static + * @param {google.logging.v2.IIndexConfig} message IndexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexConfig.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fieldPath); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndexConfig message, length delimited. Does not implicitly {@link google.logging.v2.IndexConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.IndexConfig + * @static + * @param {google.logging.v2.IIndexConfig} message IndexConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an IndexConfig message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.IndexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.IndexConfig} IndexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.IndexConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPath = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an IndexConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.IndexConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.IndexConfig} IndexConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexConfig message. + * @function verify + * @memberof google.logging.v2.IndexConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) + if (!$util.isString(message.fieldPath)) + return "fieldPath: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates an IndexConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.IndexConfig + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.IndexConfig} IndexConfig + */ + IndexConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.IndexConfig) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.IndexConfig: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.IndexConfig(); + if (object.fieldPath != null) + message.fieldPath = String(object.fieldPath); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INDEX_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INDEX_TYPE_STRING": + case 1: + message.type = 1; + break; + case "INDEX_TYPE_INTEGER": + case 2: + message.type = 2; + break; + } + if (object.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.IndexConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an IndexConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.IndexConfig + * @static + * @param {google.logging.v2.IndexConfig} message IndexConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexConfig.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.fieldPath = ""; + object.type = options.enums === String ? "INDEX_TYPE_UNSPECIFIED" : 0; + object.createTime = null; + } + if (message.fieldPath != null && Object.hasOwnProperty.call(message, "fieldPath")) + object.fieldPath = message.fieldPath; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = options.enums === String ? $root.google.logging.v2.IndexType[message.type] === undefined ? message.type : $root.google.logging.v2.IndexType[message.type] : message.type; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + return object; + }; + + /** + * Converts this IndexConfig to JSON. + * @function toJSON + * @memberof google.logging.v2.IndexConfig + * @instance + * @returns {Object.} JSON object + */ + IndexConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexConfig + * @function getTypeUrl + * @memberof google.logging.v2.IndexConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.IndexConfig"; + }; + + return IndexConfig; + })(); + + v2.LogBucket = (function() { + + /** + * Properties of a LogBucket. + * @memberof google.logging.v2 + * @interface ILogBucket + * @property {string|null} [name] LogBucket name + * @property {string|null} [description] LogBucket description + * @property {google.protobuf.ITimestamp|null} [createTime] LogBucket createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] LogBucket updateTime + * @property {number|null} [retentionDays] LogBucket retentionDays + * @property {boolean|null} [locked] LogBucket locked + * @property {google.logging.v2.LifecycleState|null} [lifecycleState] LogBucket lifecycleState + * @property {boolean|null} [analyticsEnabled] LogBucket analyticsEnabled + * @property {Array.|null} [restrictedFields] LogBucket restrictedFields + * @property {Array.|null} [indexConfigs] LogBucket indexConfigs + * @property {google.logging.v2.ICmekSettings|null} [cmekSettings] LogBucket cmekSettings + */ + + /** + * Constructs a new LogBucket. + * @memberof google.logging.v2 + * @classdesc Represents a LogBucket. + * @implements ILogBucket + * @constructor + * @param {google.logging.v2.ILogBucket=} [properties] Properties to set + */ + function LogBucket(properties) { + this.restrictedFields = []; + this.indexConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogBucket name. + * @member {string} name + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.name = ""; + + /** + * LogBucket description. + * @member {string} description + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.description = ""; + + /** + * LogBucket createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.createTime = null; + + /** + * LogBucket updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.updateTime = null; + + /** + * LogBucket retentionDays. + * @member {number} retentionDays + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.retentionDays = 0; + + /** + * LogBucket locked. + * @member {boolean} locked + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.locked = false; + + /** + * LogBucket lifecycleState. + * @member {google.logging.v2.LifecycleState} lifecycleState + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.lifecycleState = 0; + + /** + * LogBucket analyticsEnabled. + * @member {boolean} analyticsEnabled + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.analyticsEnabled = false; + + /** + * LogBucket restrictedFields. + * @member {Array.} restrictedFields + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.restrictedFields = $util.emptyArray; + + /** + * LogBucket indexConfigs. + * @member {Array.} indexConfigs + * @memberof google.logging.v2.LogBucket + * @instance + */ + LogBucket.prototype.indexConfigs = $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 + * @memberof google.logging.v2.LogBucket + * @static + * @param {google.logging.v2.ILogBucket=} [properties] Properties to set + * @returns {google.logging.v2.LogBucket} LogBucket instance + */ + LogBucket.create = function create(properties) { + return new LogBucket(properties); + }; + + /** + * Encodes the specified LogBucket message. Does not implicitly {@link google.logging.v2.LogBucket.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogBucket + * @static + * @param {google.logging.v2.ILogBucket} message LogBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogBucket.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.locked); + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) + 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.analyticsEnabled != null && Object.hasOwnProperty.call(message, "analyticsEnabled")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.analyticsEnabled); + 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.indexConfigs != null && message.indexConfigs.length) + for (var i = 0; i < message.indexConfigs.length; ++i) + $root.google.logging.v2.IndexConfig.encode(message.indexConfigs[i], writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); + 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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogBucket message, length delimited. Does not implicitly {@link google.logging.v2.LogBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogBucket + * @static + * @param {google.logging.v2.ILogBucket} message LogBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogBucket message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogBucket} LogBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogBucket.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 11: { + message.retentionDays = reader.int32(); + break; + } + case 9: { + message.locked = reader.bool(); + break; + } + case 12: { + message.lifecycleState = reader.int32(); + break; + } + case 14: { + message.analyticsEnabled = reader.bool(); + break; + } + case 15: { + if (!(message.restrictedFields && message.restrictedFields.length)) + message.restrictedFields = []; + message.restrictedFields.push(reader.string()); + break; + } + case 17: { + if (!(message.indexConfigs && message.indexConfigs.length)) + message.indexConfigs = []; + message.indexConfigs.push($root.google.logging.v2.IndexConfig.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 19: { + message.cmekSettings = $root.google.logging.v2.CmekSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogBucket} LogBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogBucket message. + * @function verify + * @memberof google.logging.v2.LogBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogBucket.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) + if (!$util.isInteger(message.retentionDays)) + return "retentionDays: integer expected"; + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + switch (message.lifecycleState) { + default: + return "lifecycleState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.analyticsEnabled != null && Object.hasOwnProperty.call(message, "analyticsEnabled")) + if (typeof message.analyticsEnabled !== "boolean") + return "analyticsEnabled: boolean expected"; + if (message.restrictedFields != null && Object.hasOwnProperty.call(message, "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.indexConfigs != null && Object.hasOwnProperty.call(message, "indexConfigs")) { + if (!Array.isArray(message.indexConfigs)) + return "indexConfigs: array expected"; + for (var i = 0; i < message.indexConfigs.length; ++i) { + var error = $root.google.logging.v2.IndexConfig.verify(message.indexConfigs[i], long + 1); + if (error) + return "indexConfigs." + error; + } + } + if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) { + var error = $root.google.logging.v2.CmekSettings.verify(message.cmekSettings, long + 1); + if (error) + return "cmekSettings." + error; + } + return null; + }; + + /** + * Creates a LogBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogBucket + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogBucket} LogBucket + */ + LogBucket.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogBucket) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogBucket: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogBucket(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.LogBucket.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (!$util.isObject(object.updateTime)) + throw TypeError(".google.logging.v2.LogBucket.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.retentionDays != null) + message.retentionDays = object.retentionDays | 0; + if (object.locked != null) + message.locked = Boolean(object.locked); + switch (object.lifecycleState) { + default: + if (typeof object.lifecycleState === "number") { + message.lifecycleState = object.lifecycleState; + break; + } + break; + case "LIFECYCLE_STATE_UNSPECIFIED": + case 0: + message.lifecycleState = 0; + break; + case "ACTIVE": + case 1: + message.lifecycleState = 1; + break; + case "DELETE_REQUESTED": + case 2: + message.lifecycleState = 2; + break; + case "UPDATING": + case 3: + message.lifecycleState = 3; + break; + case "CREATING": + case 4: + message.lifecycleState = 4; + break; + case "FAILED": + case 5: + message.lifecycleState = 5; + break; + } + if (object.analyticsEnabled != null) + message.analyticsEnabled = Boolean(object.analyticsEnabled); + 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.indexConfigs) { + if (!Array.isArray(object.indexConfigs)) + throw TypeError(".google.logging.v2.LogBucket.indexConfigs: array expected"); + message.indexConfigs = []; + for (var i = 0; i < object.indexConfigs.length; ++i) { + if (!$util.isObject(object.indexConfigs[i])) + throw TypeError(".google.logging.v2.LogBucket.indexConfigs: object expected"); + message.indexConfigs[i] = $root.google.logging.v2.IndexConfig.fromObject(object.indexConfigs[i], long + 1); + } + } + if (object.cmekSettings != null) { + if (!$util.isObject(object.cmekSettings)) + throw TypeError(".google.logging.v2.LogBucket.cmekSettings: object expected"); + message.cmekSettings = $root.google.logging.v2.CmekSettings.fromObject(object.cmekSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LogBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogBucket + * @static + * @param {google.logging.v2.LogBucket} message LogBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogBucket.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.restrictedFields = []; + object.indexConfigs = []; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.locked = false; + object.retentionDays = 0; + object.lifecycleState = options.enums === String ? "LIFECYCLE_STATE_UNSPECIFIED" : 0; + object.analyticsEnabled = false; + object.cmekSettings = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + object.locked = message.locked; + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) + object.retentionDays = message.retentionDays; + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + object.lifecycleState = options.enums === String ? $root.google.logging.v2.LifecycleState[message.lifecycleState] === undefined ? message.lifecycleState : $root.google.logging.v2.LifecycleState[message.lifecycleState] : message.lifecycleState; + if (message.analyticsEnabled != null && Object.hasOwnProperty.call(message, "analyticsEnabled")) + object.analyticsEnabled = message.analyticsEnabled; + 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.indexConfigs && message.indexConfigs.length) { + object.indexConfigs = []; + for (var j = 0; j < message.indexConfigs.length; ++j) + object.indexConfigs[j] = $root.google.logging.v2.IndexConfig.toObject(message.indexConfigs[j], options, q + 1); + } + if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) + object.cmekSettings = $root.google.logging.v2.CmekSettings.toObject(message.cmekSettings, options, q + 1); + return object; + }; + + /** + * Converts this LogBucket to JSON. + * @function toJSON + * @memberof google.logging.v2.LogBucket + * @instance + * @returns {Object.} JSON object + */ + LogBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogBucket + * @function getTypeUrl + * @memberof google.logging.v2.LogBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogBucket"; + }; + + return LogBucket; + })(); + + v2.LogView = (function() { + + /** + * Properties of a LogView. + * @memberof google.logging.v2 + * @interface ILogView + * @property {string|null} [name] LogView name + * @property {string|null} [description] LogView description + * @property {google.protobuf.ITimestamp|null} [createTime] LogView createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] LogView updateTime + * @property {string|null} [filter] LogView filter + */ + + /** + * Constructs a new LogView. + * @memberof google.logging.v2 + * @classdesc Represents a LogView. + * @implements ILogView + * @constructor + * @param {google.logging.v2.ILogView=} [properties] Properties to set + */ + function LogView(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogView name. + * @member {string} name + * @memberof google.logging.v2.LogView + * @instance + */ + LogView.prototype.name = ""; + + /** + * LogView description. + * @member {string} description + * @memberof google.logging.v2.LogView + * @instance + */ + LogView.prototype.description = ""; + + /** + * LogView createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.LogView + * @instance + */ + LogView.prototype.createTime = null; + + /** + * LogView updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.logging.v2.LogView + * @instance + */ + LogView.prototype.updateTime = null; + + /** + * LogView filter. + * @member {string} filter + * @memberof google.logging.v2.LogView + * @instance + */ + LogView.prototype.filter = ""; + + /** + * Creates a new LogView instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogView + * @static + * @param {google.logging.v2.ILogView=} [properties] Properties to set + * @returns {google.logging.v2.LogView} LogView instance + */ + LogView.create = function create(properties) { + return new LogView(properties); + }; + + /** + * Encodes the specified LogView message. Does not implicitly {@link google.logging.v2.LogView.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogView + * @static + * @param {google.logging.v2.ILogView} message LogView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogView.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.filter); + return writer; + }; + + /** + * Encodes the specified LogView message, length delimited. Does not implicitly {@link google.logging.v2.LogView.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogView + * @static + * @param {google.logging.v2.ILogView} message LogView message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogView.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogView message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogView} LogView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogView.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogView(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogView message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogView + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogView} LogView + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogView.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogView message. + * @function verify + * @memberof google.logging.v2.LogView + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogView.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a LogView message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogView + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogView} LogView + */ + LogView.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogView) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogView: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogView(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.LogView.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (!$util.isObject(object.updateTime)) + throw TypeError(".google.logging.v2.LogView.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a LogView message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogView + * @static + * @param {google.logging.v2.LogView} message LogView + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogView.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.filter = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this LogView to JSON. + * @function toJSON + * @memberof google.logging.v2.LogView + * @instance + * @returns {Object.} JSON object + */ + LogView.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogView + * @function getTypeUrl + * @memberof google.logging.v2.LogView + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogView.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogView"; + }; + + return LogView; + })(); + + v2.LogSink = (function() { + + /** + * Properties of a LogSink. + * @memberof google.logging.v2 + * @interface ILogSink + * @property {string|null} [name] LogSink name + * @property {string|null} [destination] LogSink destination + * @property {string|null} [filter] LogSink filter + * @property {string|null} [description] LogSink description + * @property {boolean|null} [disabled] LogSink disabled + * @property {Array.|null} [exclusions] LogSink exclusions + * @property {google.logging.v2.LogSink.VersionFormat|null} [outputVersionFormat] LogSink outputVersionFormat + * @property {string|null} [writerIdentity] LogSink writerIdentity + * @property {boolean|null} [includeChildren] LogSink includeChildren + * @property {google.logging.v2.IBigQueryOptions|null} [bigqueryOptions] LogSink bigqueryOptions + * @property {google.protobuf.ITimestamp|null} [createTime] LogSink createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] LogSink updateTime + */ + + /** + * Constructs a new LogSink. + * @memberof google.logging.v2 + * @classdesc Represents a LogSink. + * @implements ILogSink + * @constructor + * @param {google.logging.v2.ILogSink=} [properties] Properties to set + */ + function LogSink(properties) { + this.exclusions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogSink name. + * @member {string} name + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.name = ""; + + /** + * LogSink destination. + * @member {string} destination + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.destination = ""; + + /** + * LogSink filter. + * @member {string} filter + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.filter = ""; + + /** + * LogSink description. + * @member {string} description + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.description = ""; + + /** + * LogSink disabled. + * @member {boolean} disabled + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.disabled = false; + + /** + * LogSink exclusions. + * @member {Array.} exclusions + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.exclusions = $util.emptyArray; + + /** + * LogSink outputVersionFormat. + * @member {google.logging.v2.LogSink.VersionFormat} outputVersionFormat + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.outputVersionFormat = 0; + + /** + * LogSink writerIdentity. + * @member {string} writerIdentity + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.writerIdentity = ""; + + /** + * LogSink includeChildren. + * @member {boolean} includeChildren + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.includeChildren = false; + + /** + * LogSink bigqueryOptions. + * @member {google.logging.v2.IBigQueryOptions|null|undefined} bigqueryOptions + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.bigqueryOptions = null; + + /** + * LogSink createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.createTime = null; + + /** + * LogSink updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.logging.v2.LogSink + * @instance + */ + LogSink.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogSink options. + * @member {"bigqueryOptions"|undefined} options + * @memberof google.logging.v2.LogSink + * @instance + */ + Object.defineProperty(LogSink.prototype, "options", { + get: $util.oneOfGetter($oneOfFields = ["bigqueryOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogSink instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogSink + * @static + * @param {google.logging.v2.ILogSink=} [properties] Properties to set + * @returns {google.logging.v2.LogSink} LogSink instance + */ + LogSink.create = function create(properties) { + return new LogSink(properties); + }; + + /** + * Encodes the specified LogSink message. Does not implicitly {@link google.logging.v2.LogSink.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogSink + * @static + * @param {google.logging.v2.ILogSink} message LogSink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogSink.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destination); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.outputVersionFormat != null && Object.hasOwnProperty.call(message, "outputVersionFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.outputVersionFormat); + if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.writerIdentity); + if (message.includeChildren != null && Object.hasOwnProperty.call(message, "includeChildren")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.includeChildren); + if (message.bigqueryOptions != null && Object.hasOwnProperty.call(message, "bigqueryOptions")) + $root.google.logging.v2.BigQueryOptions.encode(message.bigqueryOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); + if (message.exclusions != null && message.exclusions.length) + for (var i = 0; i < message.exclusions.length; ++i) + $root.google.logging.v2.LogExclusion.encode(message.exclusions[i], writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.description); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified LogSink message, length delimited. Does not implicitly {@link google.logging.v2.LogSink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogSink + * @static + * @param {google.logging.v2.ILogSink} message LogSink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogSink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogSink message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogSink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogSink} LogSink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogSink.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogSink(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.destination = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 18: { + message.description = reader.string(); + break; + } + case 19: { + message.disabled = reader.bool(); + break; + } + case 16: { + if (!(message.exclusions && message.exclusions.length)) + message.exclusions = []; + message.exclusions.push($root.google.logging.v2.LogExclusion.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + message.outputVersionFormat = reader.int32(); + break; + } + case 8: { + message.writerIdentity = reader.string(); + break; + } + case 9: { + message.includeChildren = reader.bool(); + break; + } + case 12: { + message.bigqueryOptions = $root.google.logging.v2.BigQueryOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogSink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogSink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogSink} LogSink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogSink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogSink message. + * @function verify + * @memberof google.logging.v2.LogSink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogSink.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.exclusions != null && Object.hasOwnProperty.call(message, "exclusions")) { + if (!Array.isArray(message.exclusions)) + return "exclusions: array expected"; + for (var i = 0; i < message.exclusions.length; ++i) { + var error = $root.google.logging.v2.LogExclusion.verify(message.exclusions[i], long + 1); + if (error) + return "exclusions." + error; + } + } + if (message.outputVersionFormat != null && Object.hasOwnProperty.call(message, "outputVersionFormat")) + switch (message.outputVersionFormat) { + default: + return "outputVersionFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) + if (!$util.isString(message.writerIdentity)) + return "writerIdentity: string expected"; + if (message.includeChildren != null && Object.hasOwnProperty.call(message, "includeChildren")) + if (typeof message.includeChildren !== "boolean") + return "includeChildren: boolean expected"; + if (message.bigqueryOptions != null && Object.hasOwnProperty.call(message, "bigqueryOptions")) { + properties.options = 1; + { + var error = $root.google.logging.v2.BigQueryOptions.verify(message.bigqueryOptions, long + 1); + if (error) + return "bigqueryOptions." + error; + } + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a LogSink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogSink + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogSink} LogSink + */ + LogSink.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogSink) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogSink: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogSink(); + if (object.name != null) + message.name = String(object.name); + if (object.destination != null) + message.destination = String(object.destination); + if (object.filter != null) + message.filter = String(object.filter); + if (object.description != null) + message.description = String(object.description); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.exclusions) { + if (!Array.isArray(object.exclusions)) + throw TypeError(".google.logging.v2.LogSink.exclusions: array expected"); + message.exclusions = []; + for (var i = 0; i < object.exclusions.length; ++i) { + if (!$util.isObject(object.exclusions[i])) + throw TypeError(".google.logging.v2.LogSink.exclusions: object expected"); + message.exclusions[i] = $root.google.logging.v2.LogExclusion.fromObject(object.exclusions[i], long + 1); + } + } + switch (object.outputVersionFormat) { + default: + if (typeof object.outputVersionFormat === "number") { + message.outputVersionFormat = object.outputVersionFormat; + break; + } + break; + case "VERSION_FORMAT_UNSPECIFIED": + case 0: + message.outputVersionFormat = 0; + break; + case "V2": + case 1: + message.outputVersionFormat = 1; + break; + case "V1": + case 2: + message.outputVersionFormat = 2; + break; + } + if (object.writerIdentity != null) + message.writerIdentity = String(object.writerIdentity); + if (object.includeChildren != null) + message.includeChildren = Boolean(object.includeChildren); + if (object.bigqueryOptions != null) { + if (!$util.isObject(object.bigqueryOptions)) + throw TypeError(".google.logging.v2.LogSink.bigqueryOptions: object expected"); + message.bigqueryOptions = $root.google.logging.v2.BigQueryOptions.fromObject(object.bigqueryOptions, long + 1); + } + if (object.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.LogSink.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (!$util.isObject(object.updateTime)) + throw TypeError(".google.logging.v2.LogSink.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LogSink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogSink + * @static + * @param {google.logging.v2.LogSink} message LogSink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogSink.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.exclusions = []; + if (options.defaults) { + object.name = ""; + object.destination = ""; + object.filter = ""; + object.outputVersionFormat = options.enums === String ? "VERSION_FORMAT_UNSPECIFIED" : 0; + object.writerIdentity = ""; + object.includeChildren = false; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.disabled = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + object.destination = message.destination; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.outputVersionFormat != null && Object.hasOwnProperty.call(message, "outputVersionFormat")) + object.outputVersionFormat = options.enums === String ? $root.google.logging.v2.LogSink.VersionFormat[message.outputVersionFormat] === undefined ? message.outputVersionFormat : $root.google.logging.v2.LogSink.VersionFormat[message.outputVersionFormat] : message.outputVersionFormat; + if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) + object.writerIdentity = message.writerIdentity; + if (message.includeChildren != null && Object.hasOwnProperty.call(message, "includeChildren")) + object.includeChildren = message.includeChildren; + if (message.bigqueryOptions != null && Object.hasOwnProperty.call(message, "bigqueryOptions")) { + object.bigqueryOptions = $root.google.logging.v2.BigQueryOptions.toObject(message.bigqueryOptions, options, q + 1); + if (options.oneofs) + object.options = "bigqueryOptions"; + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + if (message.exclusions && message.exclusions.length) { + object.exclusions = []; + for (var j = 0; j < message.exclusions.length; ++j) + object.exclusions[j] = $root.google.logging.v2.LogExclusion.toObject(message.exclusions[j], options, q + 1); + } + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this LogSink to JSON. + * @function toJSON + * @memberof google.logging.v2.LogSink + * @instance + * @returns {Object.} JSON object + */ + LogSink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogSink + * @function getTypeUrl + * @memberof google.logging.v2.LogSink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogSink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogSink"; + }; + + /** + * VersionFormat enum. + * @name google.logging.v2.LogSink.VersionFormat + * @enum {number} + * @property {number} VERSION_FORMAT_UNSPECIFIED=0 VERSION_FORMAT_UNSPECIFIED value + * @property {number} V2=1 V2 value + * @property {number} V1=2 V1 value + */ + LogSink.VersionFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VERSION_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "V2"] = 1; + values[valuesById[2] = "V1"] = 2; + return values; + })(); + + return LogSink; + })(); + + v2.BigQueryDataset = (function() { + + /** + * Properties of a BigQueryDataset. + * @memberof google.logging.v2 + * @interface IBigQueryDataset + * @property {string|null} [datasetId] BigQueryDataset datasetId + */ + + /** + * Constructs a new BigQueryDataset. + * @memberof google.logging.v2 + * @classdesc Represents a BigQueryDataset. + * @implements IBigQueryDataset + * @constructor + * @param {google.logging.v2.IBigQueryDataset=} [properties] Properties to set + */ + function BigQueryDataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryDataset datasetId. + * @member {string} datasetId + * @memberof google.logging.v2.BigQueryDataset + * @instance + */ + BigQueryDataset.prototype.datasetId = ""; + + /** + * Creates a new BigQueryDataset instance using the specified properties. + * @function create + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {google.logging.v2.IBigQueryDataset=} [properties] Properties to set + * @returns {google.logging.v2.BigQueryDataset} BigQueryDataset instance + */ + BigQueryDataset.create = function create(properties) { + return new BigQueryDataset(properties); + }; + + /** + * Encodes the specified BigQueryDataset message. Does not implicitly {@link google.logging.v2.BigQueryDataset.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {google.logging.v2.IBigQueryDataset} message BigQueryDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDataset.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasetId); + return writer; + }; + + /** + * Encodes the specified BigQueryDataset message, length delimited. Does not implicitly {@link google.logging.v2.BigQueryDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {google.logging.v2.IBigQueryDataset} message BigQueryDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigQueryDataset message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.BigQueryDataset} BigQueryDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDataset.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.BigQueryDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.datasetId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.BigQueryDataset} BigQueryDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDataset message. + * @function verify + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDataset.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + return null; + }; + + /** + * Creates a BigQueryDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.BigQueryDataset} BigQueryDataset + */ + BigQueryDataset.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.BigQueryDataset) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.BigQueryDataset: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.BigQueryDataset(); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + return message; + }; + + /** + * Creates a plain object from a BigQueryDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {google.logging.v2.BigQueryDataset} message BigQueryDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDataset.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.datasetId = ""; + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + object.datasetId = message.datasetId; + return object; + }; + + /** + * Converts this BigQueryDataset to JSON. + * @function toJSON + * @memberof google.logging.v2.BigQueryDataset + * @instance + * @returns {Object.} JSON object + */ + BigQueryDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDataset + * @function getTypeUrl + * @memberof google.logging.v2.BigQueryDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.BigQueryDataset"; + }; + + return BigQueryDataset; + })(); + + v2.Link = (function() { + + /** + * Properties of a Link. + * @memberof google.logging.v2 + * @interface ILink + * @property {string|null} [name] Link name + * @property {string|null} [description] Link description + * @property {google.protobuf.ITimestamp|null} [createTime] Link createTime + * @property {google.logging.v2.LifecycleState|null} [lifecycleState] Link lifecycleState + * @property {google.logging.v2.IBigQueryDataset|null} [bigqueryDataset] Link bigqueryDataset + */ + + /** + * Constructs a new Link. + * @memberof google.logging.v2 + * @classdesc Represents a Link. + * @implements ILink + * @constructor + * @param {google.logging.v2.ILink=} [properties] Properties to set + */ + function Link(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Link name. + * @member {string} name + * @memberof google.logging.v2.Link + * @instance + */ + Link.prototype.name = ""; + + /** + * Link description. + * @member {string} description + * @memberof google.logging.v2.Link + * @instance + */ + Link.prototype.description = ""; + + /** + * Link createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.Link + * @instance + */ + Link.prototype.createTime = null; + + /** + * Link lifecycleState. + * @member {google.logging.v2.LifecycleState} lifecycleState + * @memberof google.logging.v2.Link + * @instance + */ + Link.prototype.lifecycleState = 0; + + /** + * Link bigqueryDataset. + * @member {google.logging.v2.IBigQueryDataset|null|undefined} bigqueryDataset + * @memberof google.logging.v2.Link + * @instance + */ + Link.prototype.bigqueryDataset = null; + + /** + * Creates a new Link instance using the specified properties. + * @function create + * @memberof google.logging.v2.Link + * @static + * @param {google.logging.v2.ILink=} [properties] Properties to set + * @returns {google.logging.v2.Link} Link instance + */ + Link.create = function create(properties) { + return new Link(properties); + }; + + /** + * Encodes the specified Link message. Does not implicitly {@link google.logging.v2.Link.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.Link + * @static + * @param {google.logging.v2.ILink} message Link message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Link.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.lifecycleState); + if (message.bigqueryDataset != null && Object.hasOwnProperty.call(message, "bigqueryDataset")) + $root.google.logging.v2.BigQueryDataset.encode(message.bigqueryDataset, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Link message, length delimited. Does not implicitly {@link google.logging.v2.Link.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.Link + * @static + * @param {google.logging.v2.ILink} message Link message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Link.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Link message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.Link + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.Link} Link + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Link.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.Link(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.lifecycleState = reader.int32(); + break; + } + case 5: { + message.bigqueryDataset = $root.google.logging.v2.BigQueryDataset.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Link message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.Link + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.Link} Link + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Link.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Link message. + * @function verify + * @memberof google.logging.v2.Link + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Link.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + switch (message.lifecycleState) { + default: + return "lifecycleState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.bigqueryDataset != null && Object.hasOwnProperty.call(message, "bigqueryDataset")) { + var error = $root.google.logging.v2.BigQueryDataset.verify(message.bigqueryDataset, long + 1); + if (error) + return "bigqueryDataset." + error; + } + return null; + }; + + /** + * Creates a Link message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.Link + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.Link} Link + */ + Link.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.Link) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.Link: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.Link(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.Link.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + switch (object.lifecycleState) { + default: + if (typeof object.lifecycleState === "number") { + message.lifecycleState = object.lifecycleState; + break; + } + break; + case "LIFECYCLE_STATE_UNSPECIFIED": + case 0: + message.lifecycleState = 0; + break; + case "ACTIVE": + case 1: + message.lifecycleState = 1; + break; + case "DELETE_REQUESTED": + case 2: + message.lifecycleState = 2; + break; + case "UPDATING": + case 3: + message.lifecycleState = 3; + break; + case "CREATING": + case 4: + message.lifecycleState = 4; + break; + case "FAILED": + case 5: + message.lifecycleState = 5; + break; + } + if (object.bigqueryDataset != null) { + if (!$util.isObject(object.bigqueryDataset)) + throw TypeError(".google.logging.v2.Link.bigqueryDataset: object expected"); + message.bigqueryDataset = $root.google.logging.v2.BigQueryDataset.fromObject(object.bigqueryDataset, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Link message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.Link + * @static + * @param {google.logging.v2.Link} message Link + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Link.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.lifecycleState = options.enums === String ? "LIFECYCLE_STATE_UNSPECIFIED" : 0; + object.bigqueryDataset = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + object.lifecycleState = options.enums === String ? $root.google.logging.v2.LifecycleState[message.lifecycleState] === undefined ? message.lifecycleState : $root.google.logging.v2.LifecycleState[message.lifecycleState] : message.lifecycleState; + if (message.bigqueryDataset != null && Object.hasOwnProperty.call(message, "bigqueryDataset")) + object.bigqueryDataset = $root.google.logging.v2.BigQueryDataset.toObject(message.bigqueryDataset, options, q + 1); + return object; + }; + + /** + * Converts this Link to JSON. + * @function toJSON + * @memberof google.logging.v2.Link + * @instance + * @returns {Object.} JSON object + */ + Link.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Link + * @function getTypeUrl + * @memberof google.logging.v2.Link + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.Link"; + }; + + return Link; + })(); + + v2.BigQueryOptions = (function() { + + /** + * Properties of a BigQueryOptions. + * @memberof google.logging.v2 + * @interface IBigQueryOptions + * @property {boolean|null} [usePartitionedTables] BigQueryOptions usePartitionedTables + * @property {boolean|null} [usesTimestampColumnPartitioning] BigQueryOptions usesTimestampColumnPartitioning + */ + + /** + * Constructs a new BigQueryOptions. + * @memberof google.logging.v2 + * @classdesc Represents a BigQueryOptions. + * @implements IBigQueryOptions + * @constructor + * @param {google.logging.v2.IBigQueryOptions=} [properties] Properties to set + */ + function BigQueryOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryOptions usePartitionedTables. + * @member {boolean} usePartitionedTables + * @memberof google.logging.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.usePartitionedTables = false; + + /** + * BigQueryOptions usesTimestampColumnPartitioning. + * @member {boolean} usesTimestampColumnPartitioning + * @memberof google.logging.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.usesTimestampColumnPartitioning = false; + + /** + * Creates a new BigQueryOptions instance using the specified properties. + * @function create + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {google.logging.v2.IBigQueryOptions=} [properties] Properties to set + * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions instance + */ + BigQueryOptions.create = function create(properties) { + return new BigQueryOptions(properties); + }; + + /** + * Encodes the specified BigQueryOptions message. Does not implicitly {@link google.logging.v2.BigQueryOptions.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {google.logging.v2.IBigQueryOptions} message BigQueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryOptions.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.usePartitionedTables != null && Object.hasOwnProperty.call(message, "usePartitionedTables")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.usePartitionedTables); + if (message.usesTimestampColumnPartitioning != null && Object.hasOwnProperty.call(message, "usesTimestampColumnPartitioning")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.usesTimestampColumnPartitioning); + return writer; + }; + + /** + * Encodes the specified BigQueryOptions message, length delimited. Does not implicitly {@link google.logging.v2.BigQueryOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {google.logging.v2.IBigQueryOptions} message BigQueryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryOptions.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.BigQueryOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.usePartitionedTables = reader.bool(); + break; + } + case 3: { + message.usesTimestampColumnPartitioning = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryOptions message. + * @function verify + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryOptions.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.usePartitionedTables != null && Object.hasOwnProperty.call(message, "usePartitionedTables")) + if (typeof message.usePartitionedTables !== "boolean") + return "usePartitionedTables: boolean expected"; + if (message.usesTimestampColumnPartitioning != null && Object.hasOwnProperty.call(message, "usesTimestampColumnPartitioning")) + if (typeof message.usesTimestampColumnPartitioning !== "boolean") + return "usesTimestampColumnPartitioning: boolean expected"; + return null; + }; + + /** + * Creates a BigQueryOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.BigQueryOptions} BigQueryOptions + */ + BigQueryOptions.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.BigQueryOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.BigQueryOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.BigQueryOptions(); + if (object.usePartitionedTables != null) + message.usePartitionedTables = Boolean(object.usePartitionedTables); + if (object.usesTimestampColumnPartitioning != null) + message.usesTimestampColumnPartitioning = Boolean(object.usesTimestampColumnPartitioning); + return message; + }; + + /** + * Creates a plain object from a BigQueryOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {google.logging.v2.BigQueryOptions} message BigQueryOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryOptions.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.usePartitionedTables = false; + object.usesTimestampColumnPartitioning = false; + } + if (message.usePartitionedTables != null && Object.hasOwnProperty.call(message, "usePartitionedTables")) + object.usePartitionedTables = message.usePartitionedTables; + if (message.usesTimestampColumnPartitioning != null && Object.hasOwnProperty.call(message, "usesTimestampColumnPartitioning")) + object.usesTimestampColumnPartitioning = message.usesTimestampColumnPartitioning; + return object; + }; + + /** + * Converts this BigQueryOptions to JSON. + * @function toJSON + * @memberof google.logging.v2.BigQueryOptions + * @instance + * @returns {Object.} JSON object + */ + BigQueryOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryOptions + * @function getTypeUrl + * @memberof google.logging.v2.BigQueryOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.BigQueryOptions"; + }; + + return BigQueryOptions; + })(); + + v2.ListBucketsRequest = (function() { + + /** + * Properties of a ListBucketsRequest. + * @memberof google.logging.v2 + * @interface IListBucketsRequest + * @property {string|null} [parent] ListBucketsRequest parent + * @property {string|null} [pageToken] ListBucketsRequest pageToken + * @property {number|null} [pageSize] ListBucketsRequest pageSize + */ + + /** + * Constructs a new ListBucketsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListBucketsRequest. + * @implements IListBucketsRequest + * @constructor + * @param {google.logging.v2.IListBucketsRequest=} [properties] Properties to set + */ + function ListBucketsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBucketsRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.parent = ""; + + /** + * ListBucketsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.pageToken = ""; + + /** + * ListBucketsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListBucketsRequest + * @instance + */ + ListBucketsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListBucketsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {google.logging.v2.IListBucketsRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest instance + */ + ListBucketsRequest.create = function create(properties) { + return new ListBucketsRequest(properties); + }; + + /** + * Encodes the specified ListBucketsRequest message. Does not implicitly {@link google.logging.v2.ListBucketsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {google.logging.v2.IListBucketsRequest} message ListBucketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 ListBucketsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListBucketsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {google.logging.v2.IListBucketsRequest} message ListBucketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListBucketsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListBucketsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBucketsRequest message. + * @function verify + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBucketsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListBucketsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListBucketsRequest} ListBucketsRequest + */ + ListBucketsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListBucketsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListBucketsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListBucketsRequest(); + 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; + }; + + /** + * Creates a plain object from a ListBucketsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {google.logging.v2.ListBucketsRequest} message ListBucketsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBucketsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListBucketsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListBucketsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBucketsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBucketsRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListBucketsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBucketsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListBucketsRequest"; + }; + + return ListBucketsRequest; + })(); + + v2.ListBucketsResponse = (function() { + + /** + * Properties of a ListBucketsResponse. + * @memberof google.logging.v2 + * @interface IListBucketsResponse + * @property {Array.|null} [buckets] ListBucketsResponse buckets + * @property {string|null} [nextPageToken] ListBucketsResponse nextPageToken + */ + + /** + * Constructs a new ListBucketsResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListBucketsResponse. + * @implements IListBucketsResponse + * @constructor + * @param {google.logging.v2.IListBucketsResponse=} [properties] Properties to set + */ + function ListBucketsResponse(properties) { + this.buckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBucketsResponse buckets. + * @member {Array.} buckets + * @memberof google.logging.v2.ListBucketsResponse + * @instance + */ + ListBucketsResponse.prototype.buckets = $util.emptyArray; + + /** + * ListBucketsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListBucketsResponse + * @instance + */ + ListBucketsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBucketsResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {google.logging.v2.IListBucketsResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse instance + */ + ListBucketsResponse.create = function create(properties) { + return new ListBucketsResponse(properties); + }; + + /** + * Encodes the specified ListBucketsResponse message. Does not implicitly {@link google.logging.v2.ListBucketsResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {google.logging.v2.IListBucketsResponse} message ListBucketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.logging.v2.LogBucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListBucketsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListBucketsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {google.logging.v2.IListBucketsResponse} message ListBucketsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBucketsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListBucketsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.logging.v2.LogBucket.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListBucketsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBucketsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBucketsResponse message. + * @function verify + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBucketsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.buckets != null && Object.hasOwnProperty.call(message, "buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.logging.v2.LogBucket.verify(message.buckets[i], long + 1); + if (error) + return "buckets." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBucketsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListBucketsResponse} ListBucketsResponse + */ + ListBucketsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListBucketsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListBucketsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListBucketsResponse(); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.logging.v2.ListBucketsResponse.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (!$util.isObject(object.buckets[i])) + throw TypeError(".google.logging.v2.ListBucketsResponse.buckets: object expected"); + message.buckets[i] = $root.google.logging.v2.LogBucket.fromObject(object.buckets[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBucketsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {google.logging.v2.ListBucketsResponse} message ListBucketsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBucketsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.buckets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.logging.v2.LogBucket.toObject(message.buckets[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBucketsResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListBucketsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBucketsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBucketsResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListBucketsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBucketsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListBucketsResponse"; + }; + + return ListBucketsResponse; + })(); + + v2.CreateBucketRequest = (function() { + + /** + * Properties of a CreateBucketRequest. + * @memberof google.logging.v2 + * @interface ICreateBucketRequest + * @property {string|null} [parent] CreateBucketRequest parent + * @property {string|null} [bucketId] CreateBucketRequest bucketId + * @property {google.logging.v2.ILogBucket|null} [bucket] CreateBucketRequest bucket + */ + + /** + * Constructs a new CreateBucketRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CreateBucketRequest. + * @implements ICreateBucketRequest + * @constructor + * @param {google.logging.v2.ICreateBucketRequest=} [properties] Properties to set + */ + function CreateBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBucketRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.parent = ""; + + /** + * CreateBucketRequest bucketId. + * @member {string} bucketId + * @memberof google.logging.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.bucketId = ""; + + /** + * CreateBucketRequest bucket. + * @member {google.logging.v2.ILogBucket|null|undefined} bucket + * @memberof google.logging.v2.CreateBucketRequest + * @instance + */ + CreateBucketRequest.prototype.bucket = null; + + /** + * Creates a new CreateBucketRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {google.logging.v2.ICreateBucketRequest=} [properties] Properties to set + * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest instance + */ + CreateBucketRequest.create = function create(properties) { + return new CreateBucketRequest(properties); + }; + + /** + * Encodes the specified CreateBucketRequest message. Does not implicitly {@link google.logging.v2.CreateBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {google.logging.v2.ICreateBucketRequest} message CreateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBucketRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucketId); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + $root.google.logging.v2.LogBucket.encode(message.bucket, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {google.logging.v2.ICreateBucketRequest} message CreateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBucketRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.bucketId = reader.string(); + break; + } + case 3: { + message.bucket = $root.google.logging.v2.LogBucket.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBucketRequest message. + * @function verify + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBucketRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + if (!$util.isString(message.bucketId)) + return "bucketId: string expected"; + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) { + var error = $root.google.logging.v2.LogBucket.verify(message.bucket, long + 1); + if (error) + return "bucket." + error; + } + return null; + }; + + /** + * Creates a CreateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CreateBucketRequest} CreateBucketRequest + */ + CreateBucketRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CreateBucketRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CreateBucketRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CreateBucketRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.bucketId != null) + message.bucketId = String(object.bucketId); + if (object.bucket != null) { + if (!$util.isObject(object.bucket)) + throw TypeError(".google.logging.v2.CreateBucketRequest.bucket: object expected"); + message.bucket = $root.google.logging.v2.LogBucket.fromObject(object.bucket, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {google.logging.v2.CreateBucketRequest} message CreateBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBucketRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.bucketId = ""; + object.bucket = null; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.bucketId != null && Object.hasOwnProperty.call(message, "bucketId")) + object.bucketId = message.bucketId; + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + object.bucket = $root.google.logging.v2.LogBucket.toObject(message.bucket, options, q + 1); + return object; + }; + + /** + * Converts this CreateBucketRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CreateBucketRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBucketRequest + * @function getTypeUrl + * @memberof google.logging.v2.CreateBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CreateBucketRequest"; + }; + + return CreateBucketRequest; + })(); + + v2.UpdateBucketRequest = (function() { + + /** + * Properties of an UpdateBucketRequest. + * @memberof google.logging.v2 + * @interface IUpdateBucketRequest + * @property {string|null} [name] UpdateBucketRequest name + * @property {google.logging.v2.ILogBucket|null} [bucket] UpdateBucketRequest bucket + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBucketRequest updateMask + */ + + /** + * Constructs a new UpdateBucketRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateBucketRequest. + * @implements IUpdateBucketRequest + * @constructor + * @param {google.logging.v2.IUpdateBucketRequest=} [properties] Properties to set + */ + function UpdateBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBucketRequest name. + * @member {string} name + * @memberof google.logging.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.name = ""; + + /** + * UpdateBucketRequest bucket. + * @member {google.logging.v2.ILogBucket|null|undefined} bucket + * @memberof google.logging.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.bucket = null; + + /** + * UpdateBucketRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateBucketRequest + * @instance + */ + UpdateBucketRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBucketRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {google.logging.v2.IUpdateBucketRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest instance + */ + UpdateBucketRequest.create = function create(properties) { + return new UpdateBucketRequest(properties); + }; + + /** + * Encodes the specified UpdateBucketRequest message. Does not implicitly {@link google.logging.v2.UpdateBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {google.logging.v2.IUpdateBucketRequest} message UpdateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBucketRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + $root.google.logging.v2.LogBucket.encode(message.bucket, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {google.logging.v2.IUpdateBucketRequest} message UpdateBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBucketRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.bucket = $root.google.logging.v2.LogBucket.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBucketRequest message. + * @function verify + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBucketRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) { + var error = $root.google.logging.v2.LogBucket.verify(message.bucket, long + 1); + if (error) + return "bucket." + error; + } + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateBucketRequest} UpdateBucketRequest + */ + UpdateBucketRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UpdateBucketRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateBucketRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateBucketRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.bucket != null) { + if (!$util.isObject(object.bucket)) + throw TypeError(".google.logging.v2.UpdateBucketRequest.bucket: object expected"); + message.bucket = $root.google.logging.v2.LogBucket.fromObject(object.bucket, long + 1); + } + if (object.updateMask != null) { + if (!$util.isObject(object.updateMask)) + throw TypeError(".google.logging.v2.UpdateBucketRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {google.logging.v2.UpdateBucketRequest} message UpdateBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBucketRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.bucket = null; + object.updateMask = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + object.bucket = $root.google.logging.v2.LogBucket.toObject(message.bucket, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + return object; + }; + + /** + * Converts this UpdateBucketRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateBucketRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBucketRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateBucketRequest"; + }; + + return UpdateBucketRequest; + })(); + + v2.GetBucketRequest = (function() { + + /** + * Properties of a GetBucketRequest. + * @memberof google.logging.v2 + * @interface IGetBucketRequest + * @property {string|null} [name] GetBucketRequest name + */ + + /** + * Constructs a new GetBucketRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetBucketRequest. + * @implements IGetBucketRequest + * @constructor + * @param {google.logging.v2.IGetBucketRequest=} [properties] Properties to set + */ + function GetBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBucketRequest name. + * @member {string} name + * @memberof google.logging.v2.GetBucketRequest + * @instance + */ + GetBucketRequest.prototype.name = ""; + + /** + * Creates a new GetBucketRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {google.logging.v2.IGetBucketRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest instance + */ + GetBucketRequest.create = function create(properties) { + return new GetBucketRequest(properties); + }; + + /** + * Encodes the specified GetBucketRequest message. Does not implicitly {@link google.logging.v2.GetBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {google.logging.v2.IGetBucketRequest} message GetBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBucketRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {google.logging.v2.IGetBucketRequest} message GetBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBucketRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBucketRequest message. + * @function verify + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBucketRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetBucketRequest} GetBucketRequest + */ + GetBucketRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.GetBucketRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetBucketRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetBucketRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {google.logging.v2.GetBucketRequest} message GetBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBucketRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBucketRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetBucketRequest + * @instance + * @returns {Object.} JSON object + */ + GetBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBucketRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetBucketRequest"; + }; + + return GetBucketRequest; + })(); + + v2.DeleteBucketRequest = (function() { + + /** + * Properties of a DeleteBucketRequest. + * @memberof google.logging.v2 + * @interface IDeleteBucketRequest + * @property {string|null} [name] DeleteBucketRequest name + */ + + /** + * Constructs a new DeleteBucketRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteBucketRequest. + * @implements IDeleteBucketRequest + * @constructor + * @param {google.logging.v2.IDeleteBucketRequest=} [properties] Properties to set + */ + function DeleteBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBucketRequest name. + * @member {string} name + * @memberof google.logging.v2.DeleteBucketRequest + * @instance + */ + DeleteBucketRequest.prototype.name = ""; + + /** + * Creates a new DeleteBucketRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {google.logging.v2.IDeleteBucketRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest instance + */ + DeleteBucketRequest.create = function create(properties) { + return new DeleteBucketRequest(properties); + }; + + /** + * Encodes the specified DeleteBucketRequest message. Does not implicitly {@link google.logging.v2.DeleteBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {google.logging.v2.IDeleteBucketRequest} message DeleteBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBucketRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {google.logging.v2.IDeleteBucketRequest} message DeleteBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBucketRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBucketRequest message. + * @function verify + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBucketRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteBucketRequest} DeleteBucketRequest + */ + DeleteBucketRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.DeleteBucketRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteBucketRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.DeleteBucketRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {google.logging.v2.DeleteBucketRequest} message DeleteBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBucketRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteBucketRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteBucketRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBucketRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteBucketRequest"; + }; + + return DeleteBucketRequest; + })(); + + v2.UndeleteBucketRequest = (function() { + + /** + * Properties of an UndeleteBucketRequest. + * @memberof google.logging.v2 + * @interface IUndeleteBucketRequest + * @property {string|null} [name] UndeleteBucketRequest name + */ + + /** + * Constructs a new UndeleteBucketRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UndeleteBucketRequest. + * @implements IUndeleteBucketRequest + * @constructor + * @param {google.logging.v2.IUndeleteBucketRequest=} [properties] Properties to set + */ + function UndeleteBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeleteBucketRequest name. + * @member {string} name + * @memberof google.logging.v2.UndeleteBucketRequest + * @instance + */ + UndeleteBucketRequest.prototype.name = ""; + + /** + * Creates a new UndeleteBucketRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {google.logging.v2.IUndeleteBucketRequest=} [properties] Properties to set + * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest instance + */ + UndeleteBucketRequest.create = function create(properties) { + return new UndeleteBucketRequest(properties); + }; + + /** + * Encodes the specified UndeleteBucketRequest message. Does not implicitly {@link google.logging.v2.UndeleteBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {google.logging.v2.IUndeleteBucketRequest} message UndeleteBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteBucketRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified UndeleteBucketRequest message, length delimited. Does not implicitly {@link google.logging.v2.UndeleteBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {google.logging.v2.IUndeleteBucketRequest} message UndeleteBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeleteBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UndeleteBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteBucketRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UndeleteBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UndeleteBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeleteBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeleteBucketRequest message. + * @function verify + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeleteBucketRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an UndeleteBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UndeleteBucketRequest} UndeleteBucketRequest + */ + UndeleteBucketRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UndeleteBucketRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UndeleteBucketRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UndeleteBucketRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeleteBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {google.logging.v2.UndeleteBucketRequest} message UndeleteBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeleteBucketRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this UndeleteBucketRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UndeleteBucketRequest + * @instance + * @returns {Object.} JSON object + */ + UndeleteBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeleteBucketRequest + * @function getTypeUrl + * @memberof google.logging.v2.UndeleteBucketRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeleteBucketRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UndeleteBucketRequest"; + }; + + return UndeleteBucketRequest; + })(); + + v2.ListViewsRequest = (function() { + + /** + * Properties of a ListViewsRequest. + * @memberof google.logging.v2 + * @interface IListViewsRequest + * @property {string|null} [parent] ListViewsRequest parent + * @property {string|null} [pageToken] ListViewsRequest pageToken + * @property {number|null} [pageSize] ListViewsRequest pageSize + */ + + /** + * Constructs a new ListViewsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListViewsRequest. + * @implements IListViewsRequest + * @constructor + * @param {google.logging.v2.IListViewsRequest=} [properties] Properties to set + */ + function ListViewsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListViewsRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListViewsRequest + * @instance + */ + ListViewsRequest.prototype.parent = ""; + + /** + * ListViewsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListViewsRequest + * @instance + */ + ListViewsRequest.prototype.pageToken = ""; + + /** + * ListViewsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListViewsRequest + * @instance + */ + ListViewsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListViewsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {google.logging.v2.IListViewsRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest instance + */ + ListViewsRequest.create = function create(properties) { + return new ListViewsRequest(properties); + }; + + /** + * Encodes the specified ListViewsRequest message. Does not implicitly {@link google.logging.v2.ListViewsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {google.logging.v2.IListViewsRequest} message ListViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViewsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 ListViewsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListViewsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {google.logging.v2.IListViewsRequest} message ListViewsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViewsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListViewsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViewsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListViewsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListViewsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViewsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListViewsRequest message. + * @function verify + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListViewsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListViewsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListViewsRequest} ListViewsRequest + */ + ListViewsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListViewsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListViewsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListViewsRequest(); + 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; + }; + + /** + * Creates a plain object from a ListViewsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {google.logging.v2.ListViewsRequest} message ListViewsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListViewsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListViewsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListViewsRequest + * @instance + * @returns {Object.} JSON object + */ + ListViewsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListViewsRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListViewsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListViewsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListViewsRequest"; + }; + + return ListViewsRequest; + })(); + + v2.ListViewsResponse = (function() { + + /** + * Properties of a ListViewsResponse. + * @memberof google.logging.v2 + * @interface IListViewsResponse + * @property {Array.|null} [views] ListViewsResponse views + * @property {string|null} [nextPageToken] ListViewsResponse nextPageToken + */ + + /** + * Constructs a new ListViewsResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListViewsResponse. + * @implements IListViewsResponse + * @constructor + * @param {google.logging.v2.IListViewsResponse=} [properties] Properties to set + */ + function ListViewsResponse(properties) { + this.views = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListViewsResponse views. + * @member {Array.} views + * @memberof google.logging.v2.ListViewsResponse + * @instance + */ + ListViewsResponse.prototype.views = $util.emptyArray; + + /** + * ListViewsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListViewsResponse + * @instance + */ + ListViewsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListViewsResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {google.logging.v2.IListViewsResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse instance + */ + ListViewsResponse.create = function create(properties) { + return new ListViewsResponse(properties); + }; + + /** + * Encodes the specified ListViewsResponse message. Does not implicitly {@link google.logging.v2.ListViewsResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {google.logging.v2.IListViewsResponse} message ListViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViewsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.views != null && message.views.length) + for (var i = 0; i < message.views.length; ++i) + $root.google.logging.v2.LogView.encode(message.views[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListViewsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListViewsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {google.logging.v2.IListViewsResponse} message ListViewsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViewsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListViewsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViewsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListViewsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.views && message.views.length)) + message.views = []; + message.views.push($root.google.logging.v2.LogView.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListViewsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViewsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListViewsResponse message. + * @function verify + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListViewsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.views != null && Object.hasOwnProperty.call(message, "views")) { + if (!Array.isArray(message.views)) + return "views: array expected"; + for (var i = 0; i < message.views.length; ++i) { + var error = $root.google.logging.v2.LogView.verify(message.views[i], long + 1); + if (error) + return "views." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListViewsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListViewsResponse} ListViewsResponse + */ + ListViewsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListViewsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListViewsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListViewsResponse(); + if (object.views) { + if (!Array.isArray(object.views)) + throw TypeError(".google.logging.v2.ListViewsResponse.views: array expected"); + message.views = []; + for (var i = 0; i < object.views.length; ++i) { + if (!$util.isObject(object.views[i])) + throw TypeError(".google.logging.v2.ListViewsResponse.views: object expected"); + message.views[i] = $root.google.logging.v2.LogView.fromObject(object.views[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListViewsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {google.logging.v2.ListViewsResponse} message ListViewsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListViewsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.views = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.views && message.views.length) { + object.views = []; + for (var j = 0; j < message.views.length; ++j) + object.views[j] = $root.google.logging.v2.LogView.toObject(message.views[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListViewsResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListViewsResponse + * @instance + * @returns {Object.} JSON object + */ + ListViewsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListViewsResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListViewsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListViewsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListViewsResponse"; + }; + + return ListViewsResponse; + })(); + + v2.CreateViewRequest = (function() { + + /** + * Properties of a CreateViewRequest. + * @memberof google.logging.v2 + * @interface ICreateViewRequest + * @property {string|null} [parent] CreateViewRequest parent + * @property {string|null} [viewId] CreateViewRequest viewId + * @property {google.logging.v2.ILogView|null} [view] CreateViewRequest view + */ + + /** + * Constructs a new CreateViewRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CreateViewRequest. + * @implements ICreateViewRequest + * @constructor + * @param {google.logging.v2.ICreateViewRequest=} [properties] Properties to set + */ + function CreateViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateViewRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateViewRequest + * @instance + */ + CreateViewRequest.prototype.parent = ""; + + /** + * CreateViewRequest viewId. + * @member {string} viewId + * @memberof google.logging.v2.CreateViewRequest + * @instance + */ + CreateViewRequest.prototype.viewId = ""; + + /** + * CreateViewRequest view. + * @member {google.logging.v2.ILogView|null|undefined} view + * @memberof google.logging.v2.CreateViewRequest + * @instance + */ + CreateViewRequest.prototype.view = null; + + /** + * Creates a new CreateViewRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {google.logging.v2.ICreateViewRequest=} [properties] Properties to set + * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest instance + */ + CreateViewRequest.create = function create(properties) { + return new CreateViewRequest(properties); + }; + + /** + * Encodes the specified CreateViewRequest message. Does not implicitly {@link google.logging.v2.CreateViewRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {google.logging.v2.ICreateViewRequest} message CreateViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateViewRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.viewId != null && Object.hasOwnProperty.call(message, "viewId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.viewId); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.google.logging.v2.LogView.encode(message.view, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {google.logging.v2.ICreateViewRequest} message CreateViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CreateViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateViewRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.viewId = reader.string(); + break; + } + case 3: { + message.view = $root.google.logging.v2.LogView.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateViewRequest message. + * @function verify + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateViewRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.viewId != null && Object.hasOwnProperty.call(message, "viewId")) + if (!$util.isString(message.viewId)) + return "viewId: string expected"; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) { + var error = $root.google.logging.v2.LogView.verify(message.view, long + 1); + if (error) + return "view." + error; + } + return null; + }; + + /** + * Creates a CreateViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CreateViewRequest} CreateViewRequest + */ + CreateViewRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CreateViewRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CreateViewRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CreateViewRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.viewId != null) + message.viewId = String(object.viewId); + if (object.view != null) { + if (!$util.isObject(object.view)) + throw TypeError(".google.logging.v2.CreateViewRequest.view: object expected"); + message.view = $root.google.logging.v2.LogView.fromObject(object.view, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {google.logging.v2.CreateViewRequest} message CreateViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateViewRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.viewId = ""; + object.view = null; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.viewId != null && Object.hasOwnProperty.call(message, "viewId")) + object.viewId = message.viewId; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + object.view = $root.google.logging.v2.LogView.toObject(message.view, options, q + 1); + return object; + }; + + /** + * Converts this CreateViewRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CreateViewRequest + * @instance + * @returns {Object.} JSON object + */ + CreateViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateViewRequest + * @function getTypeUrl + * @memberof google.logging.v2.CreateViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CreateViewRequest"; + }; + + return CreateViewRequest; + })(); + + v2.UpdateViewRequest = (function() { + + /** + * Properties of an UpdateViewRequest. + * @memberof google.logging.v2 + * @interface IUpdateViewRequest + * @property {string|null} [name] UpdateViewRequest name + * @property {google.logging.v2.ILogView|null} [view] UpdateViewRequest view + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateViewRequest updateMask + */ + + /** + * Constructs a new UpdateViewRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateViewRequest. + * @implements IUpdateViewRequest + * @constructor + * @param {google.logging.v2.IUpdateViewRequest=} [properties] Properties to set + */ + function UpdateViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateViewRequest name. + * @member {string} name + * @memberof google.logging.v2.UpdateViewRequest + * @instance + */ + UpdateViewRequest.prototype.name = ""; + + /** + * UpdateViewRequest view. + * @member {google.logging.v2.ILogView|null|undefined} view + * @memberof google.logging.v2.UpdateViewRequest + * @instance + */ + UpdateViewRequest.prototype.view = null; + + /** + * UpdateViewRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateViewRequest + * @instance + */ + UpdateViewRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateViewRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {google.logging.v2.IUpdateViewRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest instance + */ + UpdateViewRequest.create = function create(properties) { + return new UpdateViewRequest(properties); + }; + + /** + * Encodes the specified UpdateViewRequest message. Does not implicitly {@link google.logging.v2.UpdateViewRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {google.logging.v2.IUpdateViewRequest} message UpdateViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateViewRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.google.logging.v2.LogView.encode(message.view, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {google.logging.v2.IUpdateViewRequest} message UpdateViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateViewRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = $root.google.logging.v2.LogView.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateViewRequest message. + * @function verify + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateViewRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) { + var error = $root.google.logging.v2.LogView.verify(message.view, long + 1); + if (error) + return "view." + error; + } + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateViewRequest} UpdateViewRequest + */ + UpdateViewRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UpdateViewRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateViewRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateViewRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.view != null) { + if (!$util.isObject(object.view)) + throw TypeError(".google.logging.v2.UpdateViewRequest.view: object expected"); + message.view = $root.google.logging.v2.LogView.fromObject(object.view, long + 1); + } + if (object.updateMask != null) { + if (!$util.isObject(object.updateMask)) + throw TypeError(".google.logging.v2.UpdateViewRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {google.logging.v2.UpdateViewRequest} message UpdateViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateViewRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = null; + object.updateMask = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + object.view = $root.google.logging.v2.LogView.toObject(message.view, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + return object; + }; + + /** + * Converts this UpdateViewRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateViewRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateViewRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateViewRequest"; + }; + + return UpdateViewRequest; + })(); + + v2.GetViewRequest = (function() { + + /** + * Properties of a GetViewRequest. + * @memberof google.logging.v2 + * @interface IGetViewRequest + * @property {string|null} [name] GetViewRequest name + */ + + /** + * Constructs a new GetViewRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetViewRequest. + * @implements IGetViewRequest + * @constructor + * @param {google.logging.v2.IGetViewRequest=} [properties] Properties to set + */ + function GetViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetViewRequest name. + * @member {string} name + * @memberof google.logging.v2.GetViewRequest + * @instance + */ + GetViewRequest.prototype.name = ""; + + /** + * Creates a new GetViewRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {google.logging.v2.IGetViewRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetViewRequest} GetViewRequest instance + */ + GetViewRequest.create = function create(properties) { + return new GetViewRequest(properties); + }; + + /** + * Encodes the specified GetViewRequest message. Does not implicitly {@link google.logging.v2.GetViewRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {google.logging.v2.IGetViewRequest} message GetViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetViewRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {google.logging.v2.IGetViewRequest} message GetViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetViewRequest} GetViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetViewRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetViewRequest} GetViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetViewRequest message. + * @function verify + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetViewRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetViewRequest} GetViewRequest + */ + GetViewRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.GetViewRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetViewRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetViewRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {google.logging.v2.GetViewRequest} message GetViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetViewRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetViewRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetViewRequest + * @instance + * @returns {Object.} JSON object + */ + GetViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetViewRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetViewRequest"; + }; + + return GetViewRequest; + })(); + + v2.DeleteViewRequest = (function() { + + /** + * Properties of a DeleteViewRequest. + * @memberof google.logging.v2 + * @interface IDeleteViewRequest + * @property {string|null} [name] DeleteViewRequest name + */ + + /** + * Constructs a new DeleteViewRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteViewRequest. + * @implements IDeleteViewRequest + * @constructor + * @param {google.logging.v2.IDeleteViewRequest=} [properties] Properties to set + */ + function DeleteViewRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteViewRequest name. + * @member {string} name + * @memberof google.logging.v2.DeleteViewRequest + * @instance + */ + DeleteViewRequest.prototype.name = ""; + + /** + * Creates a new DeleteViewRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {google.logging.v2.IDeleteViewRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest instance + */ + DeleteViewRequest.create = function create(properties) { + return new DeleteViewRequest(properties); + }; + + /** + * Encodes the specified DeleteViewRequest message. Does not implicitly {@link google.logging.v2.DeleteViewRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {google.logging.v2.IDeleteViewRequest} message DeleteViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteViewRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteViewRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteViewRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {google.logging.v2.IDeleteViewRequest} message DeleteViewRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteViewRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteViewRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteViewRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteViewRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteViewRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteViewRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteViewRequest message. + * @function verify + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteViewRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteViewRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteViewRequest} DeleteViewRequest + */ + DeleteViewRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.DeleteViewRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteViewRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.DeleteViewRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteViewRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {google.logging.v2.DeleteViewRequest} message DeleteViewRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteViewRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteViewRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteViewRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteViewRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteViewRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteViewRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteViewRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteViewRequest"; + }; + + return DeleteViewRequest; + })(); + + v2.ListSinksRequest = (function() { + + /** + * Properties of a ListSinksRequest. + * @memberof google.logging.v2 + * @interface IListSinksRequest + * @property {string|null} [parent] ListSinksRequest parent + * @property {string|null} [pageToken] ListSinksRequest pageToken + * @property {number|null} [pageSize] ListSinksRequest pageSize + */ + + /** + * Constructs a new ListSinksRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListSinksRequest. + * @implements IListSinksRequest + * @constructor + * @param {google.logging.v2.IListSinksRequest=} [properties] Properties to set + */ + function ListSinksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSinksRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListSinksRequest + * @instance + */ + ListSinksRequest.prototype.parent = ""; + + /** + * ListSinksRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListSinksRequest + * @instance + */ + ListSinksRequest.prototype.pageToken = ""; + + /** + * ListSinksRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListSinksRequest + * @instance + */ + ListSinksRequest.prototype.pageSize = 0; + + /** + * Creates a new ListSinksRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {google.logging.v2.IListSinksRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest instance + */ + ListSinksRequest.create = function create(properties) { + return new ListSinksRequest(properties); + }; + + /** + * Encodes the specified ListSinksRequest message. Does not implicitly {@link google.logging.v2.ListSinksRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {google.logging.v2.IListSinksRequest} message ListSinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSinksRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 ListSinksRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListSinksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {google.logging.v2.IListSinksRequest} message ListSinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSinksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListSinksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSinksRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListSinksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSinksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSinksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSinksRequest message. + * @function verify + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSinksRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListSinksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListSinksRequest} ListSinksRequest + */ + ListSinksRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListSinksRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListSinksRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListSinksRequest(); + 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; + }; + + /** + * Creates a plain object from a ListSinksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {google.logging.v2.ListSinksRequest} message ListSinksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSinksRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListSinksRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListSinksRequest + * @instance + * @returns {Object.} JSON object + */ + ListSinksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSinksRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListSinksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListSinksRequest"; + }; + + return ListSinksRequest; + })(); + + v2.ListSinksResponse = (function() { + + /** + * Properties of a ListSinksResponse. + * @memberof google.logging.v2 + * @interface IListSinksResponse + * @property {Array.|null} [sinks] ListSinksResponse sinks + * @property {string|null} [nextPageToken] ListSinksResponse nextPageToken + */ + + /** + * Constructs a new ListSinksResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListSinksResponse. + * @implements IListSinksResponse + * @constructor + * @param {google.logging.v2.IListSinksResponse=} [properties] Properties to set + */ + function ListSinksResponse(properties) { + this.sinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSinksResponse sinks. + * @member {Array.} sinks + * @memberof google.logging.v2.ListSinksResponse + * @instance + */ + ListSinksResponse.prototype.sinks = $util.emptyArray; + + /** + * ListSinksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListSinksResponse + * @instance + */ + ListSinksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSinksResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {google.logging.v2.IListSinksResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse instance + */ + ListSinksResponse.create = function create(properties) { + return new ListSinksResponse(properties); + }; + + /** + * Encodes the specified ListSinksResponse message. Does not implicitly {@link google.logging.v2.ListSinksResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {google.logging.v2.IListSinksResponse} message ListSinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSinksResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sinks != null && message.sinks.length) + for (var i = 0; i < message.sinks.length; ++i) + $root.google.logging.v2.LogSink.encode(message.sinks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSinksResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListSinksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {google.logging.v2.IListSinksResponse} message ListSinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSinksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListSinksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSinksResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListSinksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sinks && message.sinks.length)) + message.sinks = []; + message.sinks.push($root.google.logging.v2.LogSink.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListSinksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSinksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSinksResponse message. + * @function verify + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSinksResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sinks != null && Object.hasOwnProperty.call(message, "sinks")) { + if (!Array.isArray(message.sinks)) + return "sinks: array expected"; + for (var i = 0; i < message.sinks.length; ++i) { + var error = $root.google.logging.v2.LogSink.verify(message.sinks[i], long + 1); + if (error) + return "sinks." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSinksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListSinksResponse} ListSinksResponse + */ + ListSinksResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListSinksResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListSinksResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListSinksResponse(); + if (object.sinks) { + if (!Array.isArray(object.sinks)) + throw TypeError(".google.logging.v2.ListSinksResponse.sinks: array expected"); + message.sinks = []; + for (var i = 0; i < object.sinks.length; ++i) { + if (!$util.isObject(object.sinks[i])) + throw TypeError(".google.logging.v2.ListSinksResponse.sinks: object expected"); + message.sinks[i] = $root.google.logging.v2.LogSink.fromObject(object.sinks[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSinksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {google.logging.v2.ListSinksResponse} message ListSinksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSinksResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.sinks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sinks && message.sinks.length) { + object.sinks = []; + for (var j = 0; j < message.sinks.length; ++j) + object.sinks[j] = $root.google.logging.v2.LogSink.toObject(message.sinks[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSinksResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListSinksResponse + * @instance + * @returns {Object.} JSON object + */ + ListSinksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSinksResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListSinksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListSinksResponse"; + }; + + return ListSinksResponse; + })(); + + v2.GetSinkRequest = (function() { + + /** + * Properties of a GetSinkRequest. + * @memberof google.logging.v2 + * @interface IGetSinkRequest + * @property {string|null} [sinkName] GetSinkRequest sinkName + */ + + /** + * Constructs a new GetSinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetSinkRequest. + * @implements IGetSinkRequest + * @constructor + * @param {google.logging.v2.IGetSinkRequest=} [properties] Properties to set + */ + function GetSinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSinkRequest sinkName. + * @member {string} sinkName + * @memberof google.logging.v2.GetSinkRequest + * @instance + */ + GetSinkRequest.prototype.sinkName = ""; + + /** + * Creates a new GetSinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {google.logging.v2.IGetSinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest instance + */ + GetSinkRequest.create = function create(properties) { + return new GetSinkRequest(properties); + }; + + /** + * Encodes the specified GetSinkRequest message. Does not implicitly {@link google.logging.v2.GetSinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {google.logging.v2.IGetSinkRequest} message GetSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sinkName); + return writer; + }; + + /** + * Encodes the specified GetSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetSinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {google.logging.v2.IGetSinkRequest} message GetSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetSinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetSinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sinkName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetSinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSinkRequest message. + * @function verify + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + if (!$util.isString(message.sinkName)) + return "sinkName: string expected"; + return null; + }; + + /** + * Creates a GetSinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetSinkRequest} GetSinkRequest + */ + GetSinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.GetSinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetSinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetSinkRequest(); + if (object.sinkName != null) + message.sinkName = String(object.sinkName); + return message; + }; + + /** + * Creates a plain object from a GetSinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {google.logging.v2.GetSinkRequest} message GetSinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.sinkName = ""; + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + object.sinkName = message.sinkName; + return object; + }; + + /** + * Converts this GetSinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetSinkRequest + * @instance + * @returns {Object.} JSON object + */ + GetSinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetSinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetSinkRequest"; + }; + + return GetSinkRequest; + })(); + + v2.CreateSinkRequest = (function() { + + /** + * Properties of a CreateSinkRequest. + * @memberof google.logging.v2 + * @interface ICreateSinkRequest + * @property {string|null} [parent] CreateSinkRequest parent + * @property {google.logging.v2.ILogSink|null} [sink] CreateSinkRequest sink + * @property {boolean|null} [uniqueWriterIdentity] CreateSinkRequest uniqueWriterIdentity + */ + + /** + * Constructs a new CreateSinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CreateSinkRequest. + * @implements ICreateSinkRequest + * @constructor + * @param {google.logging.v2.ICreateSinkRequest=} [properties] Properties to set + */ + function CreateSinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSinkRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateSinkRequest + * @instance + */ + CreateSinkRequest.prototype.parent = ""; + + /** + * CreateSinkRequest sink. + * @member {google.logging.v2.ILogSink|null|undefined} sink + * @memberof google.logging.v2.CreateSinkRequest + * @instance + */ + CreateSinkRequest.prototype.sink = null; + + /** + * CreateSinkRequest uniqueWriterIdentity. + * @member {boolean} uniqueWriterIdentity + * @memberof google.logging.v2.CreateSinkRequest + * @instance + */ + CreateSinkRequest.prototype.uniqueWriterIdentity = false; + + /** + * Creates a new CreateSinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {google.logging.v2.ICreateSinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest instance + */ + CreateSinkRequest.create = function create(properties) { + return new CreateSinkRequest(properties); + }; + + /** + * Encodes the specified CreateSinkRequest message. Does not implicitly {@link google.logging.v2.CreateSinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {google.logging.v2.ICreateSinkRequest} message CreateSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) + $root.google.logging.v2.LogSink.encode(message.sink, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.uniqueWriterIdentity); + return writer; + }; + + /** + * Encodes the specified CreateSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateSinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {google.logging.v2.ICreateSinkRequest} message CreateSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CreateSinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateSinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sink = $root.google.logging.v2.LogSink.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.uniqueWriterIdentity = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSinkRequest message. + * @function verify + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) { + var error = $root.google.logging.v2.LogSink.verify(message.sink, long + 1); + if (error) + return "sink." + error; + } + if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) + if (typeof message.uniqueWriterIdentity !== "boolean") + return "uniqueWriterIdentity: boolean expected"; + return null; + }; + + /** + * Creates a CreateSinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CreateSinkRequest} CreateSinkRequest + */ + CreateSinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CreateSinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CreateSinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CreateSinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sink != null) { + if (!$util.isObject(object.sink)) + throw TypeError(".google.logging.v2.CreateSinkRequest.sink: object expected"); + message.sink = $root.google.logging.v2.LogSink.fromObject(object.sink, long + 1); + } + if (object.uniqueWriterIdentity != null) + message.uniqueWriterIdentity = Boolean(object.uniqueWriterIdentity); + return message; + }; + + /** + * Creates a plain object from a CreateSinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {google.logging.v2.CreateSinkRequest} message CreateSinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sink = null; + object.uniqueWriterIdentity = false; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) + object.sink = $root.google.logging.v2.LogSink.toObject(message.sink, options, q + 1); + if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) + object.uniqueWriterIdentity = message.uniqueWriterIdentity; + return object; + }; + + /** + * Converts this CreateSinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CreateSinkRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.CreateSinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CreateSinkRequest"; + }; + + return CreateSinkRequest; + })(); + + v2.UpdateSinkRequest = (function() { + + /** + * Properties of an UpdateSinkRequest. + * @memberof google.logging.v2 + * @interface IUpdateSinkRequest + * @property {string|null} [sinkName] UpdateSinkRequest sinkName + * @property {google.logging.v2.ILogSink|null} [sink] UpdateSinkRequest sink + * @property {boolean|null} [uniqueWriterIdentity] UpdateSinkRequest uniqueWriterIdentity + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSinkRequest updateMask + */ + + /** + * Constructs a new UpdateSinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateSinkRequest. + * @implements IUpdateSinkRequest + * @constructor + * @param {google.logging.v2.IUpdateSinkRequest=} [properties] Properties to set + */ + function UpdateSinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSinkRequest sinkName. + * @member {string} sinkName + * @memberof google.logging.v2.UpdateSinkRequest + * @instance + */ + UpdateSinkRequest.prototype.sinkName = ""; + + /** + * UpdateSinkRequest sink. + * @member {google.logging.v2.ILogSink|null|undefined} sink + * @memberof google.logging.v2.UpdateSinkRequest + * @instance + */ + UpdateSinkRequest.prototype.sink = null; + + /** + * UpdateSinkRequest uniqueWriterIdentity. + * @member {boolean} uniqueWriterIdentity + * @memberof google.logging.v2.UpdateSinkRequest + * @instance + */ + UpdateSinkRequest.prototype.uniqueWriterIdentity = false; + + /** + * UpdateSinkRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateSinkRequest + * @instance + */ + UpdateSinkRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {google.logging.v2.IUpdateSinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest instance + */ + UpdateSinkRequest.create = function create(properties) { + return new UpdateSinkRequest(properties); + }; + + /** + * Encodes the specified UpdateSinkRequest message. Does not implicitly {@link google.logging.v2.UpdateSinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {google.logging.v2.IUpdateSinkRequest} message UpdateSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sinkName); + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) + $root.google.logging.v2.LogSink.encode(message.sink, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.uniqueWriterIdentity); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateSinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {google.logging.v2.IUpdateSinkRequest} message UpdateSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateSinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateSinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sinkName = reader.string(); + break; + } + case 2: { + message.sink = $root.google.logging.v2.LogSink.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.uniqueWriterIdentity = reader.bool(); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSinkRequest message. + * @function verify + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + if (!$util.isString(message.sinkName)) + return "sinkName: string expected"; + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) { + var error = $root.google.logging.v2.LogSink.verify(message.sink, long + 1); + if (error) + return "sink." + error; + } + if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) + if (typeof message.uniqueWriterIdentity !== "boolean") + return "uniqueWriterIdentity: boolean expected"; + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateSinkRequest} UpdateSinkRequest + */ + UpdateSinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UpdateSinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateSinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateSinkRequest(); + if (object.sinkName != null) + message.sinkName = String(object.sinkName); + if (object.sink != null) { + if (!$util.isObject(object.sink)) + throw TypeError(".google.logging.v2.UpdateSinkRequest.sink: object expected"); + message.sink = $root.google.logging.v2.LogSink.fromObject(object.sink, long + 1); + } + if (object.uniqueWriterIdentity != null) + message.uniqueWriterIdentity = Boolean(object.uniqueWriterIdentity); + if (object.updateMask != null) { + if (!$util.isObject(object.updateMask)) + throw TypeError(".google.logging.v2.UpdateSinkRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {google.logging.v2.UpdateSinkRequest} message UpdateSinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.sinkName = ""; + object.sink = null; + object.uniqueWriterIdentity = false; + object.updateMask = null; + } + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + object.sinkName = message.sinkName; + if (message.sink != null && Object.hasOwnProperty.call(message, "sink")) + object.sink = $root.google.logging.v2.LogSink.toObject(message.sink, options, q + 1); + if (message.uniqueWriterIdentity != null && Object.hasOwnProperty.call(message, "uniqueWriterIdentity")) + object.uniqueWriterIdentity = message.uniqueWriterIdentity; + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + return object; + }; + + /** + * Converts this UpdateSinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateSinkRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateSinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateSinkRequest"; + }; + + return UpdateSinkRequest; + })(); + + v2.DeleteSinkRequest = (function() { + + /** + * Properties of a DeleteSinkRequest. + * @memberof google.logging.v2 + * @interface IDeleteSinkRequest + * @property {string|null} [sinkName] DeleteSinkRequest sinkName + */ + + /** + * Constructs a new DeleteSinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteSinkRequest. + * @implements IDeleteSinkRequest + * @constructor + * @param {google.logging.v2.IDeleteSinkRequest=} [properties] Properties to set + */ + function DeleteSinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSinkRequest sinkName. + * @member {string} sinkName + * @memberof google.logging.v2.DeleteSinkRequest + * @instance + */ + DeleteSinkRequest.prototype.sinkName = ""; + + /** + * Creates a new DeleteSinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {google.logging.v2.IDeleteSinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest instance + */ + DeleteSinkRequest.create = function create(properties) { + return new DeleteSinkRequest(properties); + }; + + /** + * Encodes the specified DeleteSinkRequest message. Does not implicitly {@link google.logging.v2.DeleteSinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {google.logging.v2.IDeleteSinkRequest} message DeleteSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sinkName); + return writer; + }; + + /** + * Encodes the specified DeleteSinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteSinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {google.logging.v2.IDeleteSinkRequest} message DeleteSinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteSinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteSinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sinkName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSinkRequest message. + * @function verify + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + if (!$util.isString(message.sinkName)) + return "sinkName: string expected"; + return null; + }; + + /** + * Creates a DeleteSinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteSinkRequest} DeleteSinkRequest + */ + DeleteSinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.DeleteSinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteSinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.DeleteSinkRequest(); + if (object.sinkName != null) + message.sinkName = String(object.sinkName); + return message; + }; + + /** + * Creates a plain object from a DeleteSinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {google.logging.v2.DeleteSinkRequest} message DeleteSinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.sinkName = ""; + if (message.sinkName != null && Object.hasOwnProperty.call(message, "sinkName")) + object.sinkName = message.sinkName; + return object; + }; + + /** + * Converts this DeleteSinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteSinkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteSinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteSinkRequest"; + }; + + return DeleteSinkRequest; + })(); + + v2.CreateLinkRequest = (function() { + + /** + * Properties of a CreateLinkRequest. + * @memberof google.logging.v2 + * @interface ICreateLinkRequest + * @property {string|null} [parent] CreateLinkRequest parent + * @property {google.logging.v2.ILink|null} [link] CreateLinkRequest link + * @property {string|null} [linkId] CreateLinkRequest linkId + */ + + /** + * Constructs a new CreateLinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CreateLinkRequest. + * @implements ICreateLinkRequest + * @constructor + * @param {google.logging.v2.ICreateLinkRequest=} [properties] Properties to set + */ + function CreateLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLinkRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateLinkRequest + * @instance + */ + CreateLinkRequest.prototype.parent = ""; + + /** + * CreateLinkRequest link. + * @member {google.logging.v2.ILink|null|undefined} link + * @memberof google.logging.v2.CreateLinkRequest + * @instance + */ + CreateLinkRequest.prototype.link = null; + + /** + * CreateLinkRequest linkId. + * @member {string} linkId + * @memberof google.logging.v2.CreateLinkRequest + * @instance + */ + CreateLinkRequest.prototype.linkId = ""; + + /** + * Creates a new CreateLinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {google.logging.v2.ICreateLinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.CreateLinkRequest} CreateLinkRequest instance + */ + CreateLinkRequest.create = function create(properties) { + return new CreateLinkRequest(properties); + }; + + /** + * Encodes the specified CreateLinkRequest message. Does not implicitly {@link google.logging.v2.CreateLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {google.logging.v2.ICreateLinkRequest} message CreateLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.link != null && Object.hasOwnProperty.call(message, "link")) + $root.google.logging.v2.Link.encode(message.link, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.linkId != null && Object.hasOwnProperty.call(message, "linkId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.linkId); + return writer; + }; + + /** + * Encodes the specified CreateLinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {google.logging.v2.ICreateLinkRequest} message CreateLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CreateLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CreateLinkRequest} CreateLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.link = $root.google.logging.v2.Link.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.linkId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CreateLinkRequest} CreateLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateLinkRequest message. + * @function verify + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateLinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.link != null && Object.hasOwnProperty.call(message, "link")) { + var error = $root.google.logging.v2.Link.verify(message.link, long + 1); + if (error) + return "link." + error; + } + if (message.linkId != null && Object.hasOwnProperty.call(message, "linkId")) + if (!$util.isString(message.linkId)) + return "linkId: string expected"; + return null; + }; + + /** + * Creates a CreateLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CreateLinkRequest} CreateLinkRequest + */ + CreateLinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CreateLinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CreateLinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CreateLinkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.link != null) { + if (!$util.isObject(object.link)) + throw TypeError(".google.logging.v2.CreateLinkRequest.link: object expected"); + message.link = $root.google.logging.v2.Link.fromObject(object.link, long + 1); + } + if (object.linkId != null) + message.linkId = String(object.linkId); + return message; + }; + + /** + * Creates a plain object from a CreateLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {google.logging.v2.CreateLinkRequest} message CreateLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateLinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.link = null; + object.linkId = ""; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.link != null && Object.hasOwnProperty.call(message, "link")) + object.link = $root.google.logging.v2.Link.toObject(message.link, options, q + 1); + if (message.linkId != null && Object.hasOwnProperty.call(message, "linkId")) + object.linkId = message.linkId; + return object; + }; + + /** + * Converts this CreateLinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CreateLinkRequest + * @instance + * @returns {Object.} JSON object + */ + CreateLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateLinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.CreateLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CreateLinkRequest"; + }; + + return CreateLinkRequest; + })(); + + v2.DeleteLinkRequest = (function() { + + /** + * Properties of a DeleteLinkRequest. + * @memberof google.logging.v2 + * @interface IDeleteLinkRequest + * @property {string|null} [name] DeleteLinkRequest name + */ + + /** + * Constructs a new DeleteLinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteLinkRequest. + * @implements IDeleteLinkRequest + * @constructor + * @param {google.logging.v2.IDeleteLinkRequest=} [properties] Properties to set + */ + function DeleteLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLinkRequest name. + * @member {string} name + * @memberof google.logging.v2.DeleteLinkRequest + * @instance + */ + DeleteLinkRequest.prototype.name = ""; + + /** + * Creates a new DeleteLinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {google.logging.v2.IDeleteLinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteLinkRequest} DeleteLinkRequest instance + */ + DeleteLinkRequest.create = function create(properties) { + return new DeleteLinkRequest(properties); + }; + + /** + * Encodes the specified DeleteLinkRequest message. Does not implicitly {@link google.logging.v2.DeleteLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {google.logging.v2.IDeleteLinkRequest} message DeleteLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteLinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {google.logging.v2.IDeleteLinkRequest} message DeleteLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteLinkRequest} DeleteLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteLinkRequest} DeleteLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLinkRequest message. + * @function verify + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteLinkRequest} DeleteLinkRequest + */ + DeleteLinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.DeleteLinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteLinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.DeleteLinkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {google.logging.v2.DeleteLinkRequest} message DeleteLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteLinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteLinkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteLinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteLinkRequest"; + }; + + return DeleteLinkRequest; + })(); + + v2.ListLinksRequest = (function() { + + /** + * Properties of a ListLinksRequest. + * @memberof google.logging.v2 + * @interface IListLinksRequest + * @property {string|null} [parent] ListLinksRequest parent + * @property {string|null} [pageToken] ListLinksRequest pageToken + * @property {number|null} [pageSize] ListLinksRequest pageSize + */ + + /** + * Constructs a new ListLinksRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListLinksRequest. + * @implements IListLinksRequest + * @constructor + * @param {google.logging.v2.IListLinksRequest=} [properties] Properties to set + */ + function ListLinksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLinksRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListLinksRequest + * @instance + */ + ListLinksRequest.prototype.parent = ""; + + /** + * ListLinksRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListLinksRequest + * @instance + */ + ListLinksRequest.prototype.pageToken = ""; + + /** + * ListLinksRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListLinksRequest + * @instance + */ + ListLinksRequest.prototype.pageSize = 0; + + /** + * Creates a new ListLinksRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {google.logging.v2.IListLinksRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListLinksRequest} ListLinksRequest instance + */ + ListLinksRequest.create = function create(properties) { + return new ListLinksRequest(properties); + }; + + /** + * Encodes the specified ListLinksRequest message. Does not implicitly {@link google.logging.v2.ListLinksRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {google.logging.v2.IListLinksRequest} message ListLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinksRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 ListLinksRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListLinksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {google.logging.v2.IListLinksRequest} message ListLinksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListLinksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLinksRequest} ListLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinksRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLinksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListLinksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLinksRequest} ListLinksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLinksRequest message. + * @function verify + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLinksRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListLinksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLinksRequest} ListLinksRequest + */ + ListLinksRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListLinksRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLinksRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListLinksRequest(); + 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; + }; + + /** + * Creates a plain object from a ListLinksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {google.logging.v2.ListLinksRequest} message ListLinksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLinksRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListLinksRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLinksRequest + * @instance + * @returns {Object.} JSON object + */ + ListLinksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLinksRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListLinksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLinksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLinksRequest"; + }; + + return ListLinksRequest; + })(); + + v2.ListLinksResponse = (function() { + + /** + * Properties of a ListLinksResponse. + * @memberof google.logging.v2 + * @interface IListLinksResponse + * @property {Array.|null} [links] ListLinksResponse links + * @property {string|null} [nextPageToken] ListLinksResponse nextPageToken + */ + + /** + * Constructs a new ListLinksResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListLinksResponse. + * @implements IListLinksResponse + * @constructor + * @param {google.logging.v2.IListLinksResponse=} [properties] Properties to set + */ + function ListLinksResponse(properties) { + this.links = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLinksResponse links. + * @member {Array.} links + * @memberof google.logging.v2.ListLinksResponse + * @instance + */ + ListLinksResponse.prototype.links = $util.emptyArray; + + /** + * ListLinksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListLinksResponse + * @instance + */ + ListLinksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListLinksResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {google.logging.v2.IListLinksResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListLinksResponse} ListLinksResponse instance + */ + ListLinksResponse.create = function create(properties) { + return new ListLinksResponse(properties); + }; + + /** + * Encodes the specified ListLinksResponse message. Does not implicitly {@link google.logging.v2.ListLinksResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {google.logging.v2.IListLinksResponse} message ListLinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinksResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.links != null && message.links.length) + for (var i = 0; i < message.links.length; ++i) + $root.google.logging.v2.Link.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListLinksResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListLinksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {google.logging.v2.IListLinksResponse} message ListLinksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLinksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListLinksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListLinksResponse} ListLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinksResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLinksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.google.logging.v2.Link.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListLinksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListLinksResponse} ListLinksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLinksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLinksResponse message. + * @function verify + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLinksResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.links != null && Object.hasOwnProperty.call(message, "links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.google.logging.v2.Link.verify(message.links[i], long + 1); + if (error) + return "links." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListLinksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListLinksResponse} ListLinksResponse + */ + ListLinksResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListLinksResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLinksResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListLinksResponse(); + if (object.links) { + if (!Array.isArray(object.links)) + throw TypeError(".google.logging.v2.ListLinksResponse.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (!$util.isObject(object.links[i])) + throw TypeError(".google.logging.v2.ListLinksResponse.links: object expected"); + message.links[i] = $root.google.logging.v2.Link.fromObject(object.links[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListLinksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {google.logging.v2.ListLinksResponse} message ListLinksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLinksResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.links = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) + object.links[j] = $root.google.logging.v2.Link.toObject(message.links[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListLinksResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListLinksResponse + * @instance + * @returns {Object.} JSON object + */ + ListLinksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListLinksResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListLinksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLinksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLinksResponse"; + }; + + return ListLinksResponse; + })(); + + v2.GetLinkRequest = (function() { + + /** + * Properties of a GetLinkRequest. + * @memberof google.logging.v2 + * @interface IGetLinkRequest + * @property {string|null} [name] GetLinkRequest name + */ + + /** + * Constructs a new GetLinkRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetLinkRequest. + * @implements IGetLinkRequest + * @constructor + * @param {google.logging.v2.IGetLinkRequest=} [properties] Properties to set + */ + function GetLinkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLinkRequest name. + * @member {string} name + * @memberof google.logging.v2.GetLinkRequest + * @instance + */ + GetLinkRequest.prototype.name = ""; + + /** + * Creates a new GetLinkRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {google.logging.v2.IGetLinkRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetLinkRequest} GetLinkRequest instance + */ + GetLinkRequest.create = function create(properties) { + return new GetLinkRequest(properties); + }; + + /** + * Encodes the specified GetLinkRequest message. Does not implicitly {@link google.logging.v2.GetLinkRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {google.logging.v2.IGetLinkRequest} message GetLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLinkRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetLinkRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetLinkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {google.logging.v2.IGetLinkRequest} message GetLinkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLinkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetLinkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetLinkRequest} GetLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLinkRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetLinkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetLinkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetLinkRequest} GetLinkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLinkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLinkRequest message. + * @function verify + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLinkRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetLinkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetLinkRequest} GetLinkRequest + */ + GetLinkRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.GetLinkRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetLinkRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetLinkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetLinkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {google.logging.v2.GetLinkRequest} message GetLinkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLinkRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetLinkRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetLinkRequest + * @instance + * @returns {Object.} JSON object + */ + GetLinkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetLinkRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetLinkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLinkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetLinkRequest"; + }; + + return GetLinkRequest; + })(); + + v2.LogExclusion = (function() { + + /** + * Properties of a LogExclusion. + * @memberof google.logging.v2 + * @interface ILogExclusion + * @property {string|null} [name] LogExclusion name + * @property {string|null} [description] LogExclusion description + * @property {string|null} [filter] LogExclusion filter + * @property {boolean|null} [disabled] LogExclusion disabled + * @property {google.protobuf.ITimestamp|null} [createTime] LogExclusion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] LogExclusion updateTime + */ + + /** + * Constructs a new LogExclusion. + * @memberof google.logging.v2 + * @classdesc Represents a LogExclusion. + * @implements ILogExclusion + * @constructor + * @param {google.logging.v2.ILogExclusion=} [properties] Properties to set + */ + function LogExclusion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogExclusion name. + * @member {string} name + * @memberof google.logging.v2.LogExclusion + * @instance + */ + LogExclusion.prototype.name = ""; + + /** + * LogExclusion description. + * @member {string} description + * @memberof google.logging.v2.LogExclusion + * @instance + */ + LogExclusion.prototype.description = ""; + + /** + * LogExclusion filter. + * @member {string} filter + * @memberof google.logging.v2.LogExclusion + * @instance + */ + LogExclusion.prototype.filter = ""; + + /** + * LogExclusion disabled. + * @member {boolean} disabled + * @memberof google.logging.v2.LogExclusion + * @instance + */ + LogExclusion.prototype.disabled = false; + + /** + * LogExclusion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.LogExclusion + * @instance + */ + LogExclusion.prototype.createTime = null; + + /** + * LogExclusion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.logging.v2.LogExclusion + * @instance + */ + LogExclusion.prototype.updateTime = null; + + /** + * Creates a new LogExclusion instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogExclusion + * @static + * @param {google.logging.v2.ILogExclusion=} [properties] Properties to set + * @returns {google.logging.v2.LogExclusion} LogExclusion instance + */ + LogExclusion.create = function create(properties) { + return new LogExclusion(properties); + }; + + /** + * Encodes the specified LogExclusion message. Does not implicitly {@link google.logging.v2.LogExclusion.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogExclusion + * @static + * @param {google.logging.v2.ILogExclusion} message LogExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogExclusion.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disabled); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogExclusion message, length delimited. Does not implicitly {@link google.logging.v2.LogExclusion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogExclusion + * @static + * @param {google.logging.v2.ILogExclusion} message LogExclusion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogExclusion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogExclusion message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LogExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LogExclusion} LogExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogExclusion.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LogExclusion(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.disabled = reader.bool(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogExclusion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogExclusion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LogExclusion} LogExclusion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogExclusion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogExclusion message. + * @function verify + * @memberof google.logging.v2.LogExclusion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogExclusion.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a LogExclusion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogExclusion + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogExclusion} LogExclusion + */ + LogExclusion.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogExclusion) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogExclusion: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LogExclusion(); + 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.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.LogExclusion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (!$util.isObject(object.updateTime)) + throw TypeError(".google.logging.v2.LogExclusion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LogExclusion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogExclusion + * @static + * @param {google.logging.v2.LogExclusion} message LogExclusion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogExclusion.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.filter = ""; + object.disabled = false; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + object.disabled = message.disabled; + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + return object; + }; + + /** + * Converts this LogExclusion to JSON. + * @function toJSON + * @memberof google.logging.v2.LogExclusion + * @instance + * @returns {Object.} JSON object + */ + LogExclusion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogExclusion + * @function getTypeUrl + * @memberof google.logging.v2.LogExclusion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogExclusion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogExclusion"; + }; + + return LogExclusion; + })(); + + v2.ListExclusionsRequest = (function() { + + /** + * Properties of a ListExclusionsRequest. + * @memberof google.logging.v2 + * @interface IListExclusionsRequest + * @property {string|null} [parent] ListExclusionsRequest parent + * @property {string|null} [pageToken] ListExclusionsRequest pageToken + * @property {number|null} [pageSize] ListExclusionsRequest pageSize + */ + + /** + * Constructs a new ListExclusionsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a ListExclusionsRequest. + * @implements IListExclusionsRequest + * @constructor + * @param {google.logging.v2.IListExclusionsRequest=} [properties] Properties to set + */ + function ListExclusionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExclusionsRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListExclusionsRequest + * @instance + */ + ListExclusionsRequest.prototype.parent = ""; + + /** + * ListExclusionsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListExclusionsRequest + * @instance + */ + ListExclusionsRequest.prototype.pageToken = ""; + + /** + * ListExclusionsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListExclusionsRequest + * @instance + */ + ListExclusionsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListExclusionsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {google.logging.v2.IListExclusionsRequest=} [properties] Properties to set + * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest instance + */ + ListExclusionsRequest.create = function create(properties) { + return new ListExclusionsRequest(properties); + }; + + /** + * Encodes the specified ListExclusionsRequest message. Does not implicitly {@link google.logging.v2.ListExclusionsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {google.logging.v2.IListExclusionsRequest} message ListExclusionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExclusionsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 ListExclusionsRequest message, length delimited. Does not implicitly {@link google.logging.v2.ListExclusionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {google.logging.v2.IListExclusionsRequest} message ListExclusionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExclusionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListExclusionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExclusionsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListExclusionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExclusionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExclusionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExclusionsRequest message. + * @function verify + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExclusionsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListExclusionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListExclusionsRequest} ListExclusionsRequest + */ + ListExclusionsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListExclusionsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListExclusionsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListExclusionsRequest(); + 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; + }; + + /** + * Creates a plain object from a ListExclusionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {google.logging.v2.ListExclusionsRequest} message ListExclusionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExclusionsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListExclusionsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.ListExclusionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListExclusionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExclusionsRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListExclusionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExclusionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListExclusionsRequest"; + }; + + return ListExclusionsRequest; + })(); + + v2.ListExclusionsResponse = (function() { + + /** + * Properties of a ListExclusionsResponse. + * @memberof google.logging.v2 + * @interface IListExclusionsResponse + * @property {Array.|null} [exclusions] ListExclusionsResponse exclusions + * @property {string|null} [nextPageToken] ListExclusionsResponse nextPageToken + */ + + /** + * Constructs a new ListExclusionsResponse. + * @memberof google.logging.v2 + * @classdesc Represents a ListExclusionsResponse. + * @implements IListExclusionsResponse + * @constructor + * @param {google.logging.v2.IListExclusionsResponse=} [properties] Properties to set + */ + function ListExclusionsResponse(properties) { + this.exclusions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExclusionsResponse exclusions. + * @member {Array.} exclusions + * @memberof google.logging.v2.ListExclusionsResponse + * @instance + */ + ListExclusionsResponse.prototype.exclusions = $util.emptyArray; + + /** + * ListExclusionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListExclusionsResponse + * @instance + */ + ListExclusionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListExclusionsResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {google.logging.v2.IListExclusionsResponse=} [properties] Properties to set + * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse instance + */ + ListExclusionsResponse.create = function create(properties) { + return new ListExclusionsResponse(properties); + }; + + /** + * Encodes the specified ListExclusionsResponse message. Does not implicitly {@link google.logging.v2.ListExclusionsResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {google.logging.v2.IListExclusionsResponse} message ListExclusionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExclusionsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.exclusions != null && message.exclusions.length) + for (var i = 0; i < message.exclusions.length; ++i) + $root.google.logging.v2.LogExclusion.encode(message.exclusions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListExclusionsResponse message, length delimited. Does not implicitly {@link google.logging.v2.ListExclusionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {google.logging.v2.IListExclusionsResponse} message ListExclusionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExclusionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ListExclusionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExclusionsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListExclusionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.exclusions && message.exclusions.length)) + message.exclusions = []; + message.exclusions.push($root.google.logging.v2.LogExclusion.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListExclusionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExclusionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExclusionsResponse message. + * @function verify + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExclusionsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.exclusions != null && Object.hasOwnProperty.call(message, "exclusions")) { + if (!Array.isArray(message.exclusions)) + return "exclusions: array expected"; + for (var i = 0; i < message.exclusions.length; ++i) { + var error = $root.google.logging.v2.LogExclusion.verify(message.exclusions[i], long + 1); + if (error) + return "exclusions." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListExclusionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.ListExclusionsResponse} ListExclusionsResponse + */ + ListExclusionsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.ListExclusionsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListExclusionsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.ListExclusionsResponse(); + if (object.exclusions) { + if (!Array.isArray(object.exclusions)) + throw TypeError(".google.logging.v2.ListExclusionsResponse.exclusions: array expected"); + message.exclusions = []; + for (var i = 0; i < object.exclusions.length; ++i) { + if (!$util.isObject(object.exclusions[i])) + throw TypeError(".google.logging.v2.ListExclusionsResponse.exclusions: object expected"); + message.exclusions[i] = $root.google.logging.v2.LogExclusion.fromObject(object.exclusions[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListExclusionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {google.logging.v2.ListExclusionsResponse} message ListExclusionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExclusionsResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.exclusions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.exclusions && message.exclusions.length) { + object.exclusions = []; + for (var j = 0; j < message.exclusions.length; ++j) + object.exclusions[j] = $root.google.logging.v2.LogExclusion.toObject(message.exclusions[j], options, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListExclusionsResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.ListExclusionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListExclusionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListExclusionsResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListExclusionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListExclusionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListExclusionsResponse"; + }; + + return ListExclusionsResponse; + })(); + + v2.GetExclusionRequest = (function() { + + /** + * Properties of a GetExclusionRequest. + * @memberof google.logging.v2 + * @interface IGetExclusionRequest + * @property {string|null} [name] GetExclusionRequest name + */ + + /** + * Constructs a new GetExclusionRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetExclusionRequest. + * @implements IGetExclusionRequest + * @constructor + * @param {google.logging.v2.IGetExclusionRequest=} [properties] Properties to set + */ + function GetExclusionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExclusionRequest name. + * @member {string} name + * @memberof google.logging.v2.GetExclusionRequest + * @instance + */ + GetExclusionRequest.prototype.name = ""; + + /** + * Creates a new GetExclusionRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {google.logging.v2.IGetExclusionRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest instance + */ + GetExclusionRequest.create = function create(properties) { + return new GetExclusionRequest(properties); + }; + + /** + * Encodes the specified GetExclusionRequest message. Does not implicitly {@link google.logging.v2.GetExclusionRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {google.logging.v2.IGetExclusionRequest} message GetExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExclusionRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetExclusionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {google.logging.v2.IGetExclusionRequest} message GetExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetExclusionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExclusionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetExclusionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetExclusionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExclusionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExclusionRequest message. + * @function verify + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExclusionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetExclusionRequest} GetExclusionRequest + */ + GetExclusionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.GetExclusionRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetExclusionRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetExclusionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetExclusionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {google.logging.v2.GetExclusionRequest} message GetExclusionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExclusionRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetExclusionRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetExclusionRequest + * @instance + * @returns {Object.} JSON object + */ + GetExclusionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetExclusionRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetExclusionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetExclusionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetExclusionRequest"; + }; + + return GetExclusionRequest; + })(); + + v2.CreateExclusionRequest = (function() { + + /** + * Properties of a CreateExclusionRequest. + * @memberof google.logging.v2 + * @interface ICreateExclusionRequest + * @property {string|null} [parent] CreateExclusionRequest parent + * @property {google.logging.v2.ILogExclusion|null} [exclusion] CreateExclusionRequest exclusion + */ + + /** + * Constructs a new CreateExclusionRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CreateExclusionRequest. + * @implements ICreateExclusionRequest + * @constructor + * @param {google.logging.v2.ICreateExclusionRequest=} [properties] Properties to set + */ + function CreateExclusionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExclusionRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateExclusionRequest + * @instance + */ + CreateExclusionRequest.prototype.parent = ""; + + /** + * CreateExclusionRequest exclusion. + * @member {google.logging.v2.ILogExclusion|null|undefined} exclusion + * @memberof google.logging.v2.CreateExclusionRequest + * @instance + */ + CreateExclusionRequest.prototype.exclusion = null; + + /** + * Creates a new CreateExclusionRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {google.logging.v2.ICreateExclusionRequest=} [properties] Properties to set + * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest instance + */ + CreateExclusionRequest.create = function create(properties) { + return new CreateExclusionRequest(properties); + }; + + /** + * Encodes the specified CreateExclusionRequest message. Does not implicitly {@link google.logging.v2.CreateExclusionRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {google.logging.v2.ICreateExclusionRequest} message CreateExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExclusionRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + $root.google.logging.v2.LogExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.CreateExclusionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {google.logging.v2.ICreateExclusionRequest} message CreateExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CreateExclusionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExclusionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateExclusionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.exclusion = $root.google.logging.v2.LogExclusion.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExclusionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExclusionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExclusionRequest message. + * @function verify + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExclusionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) { + var error = $root.google.logging.v2.LogExclusion.verify(message.exclusion, long + 1); + if (error) + return "exclusion." + error; + } + return null; + }; + + /** + * Creates a CreateExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CreateExclusionRequest} CreateExclusionRequest + */ + CreateExclusionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CreateExclusionRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CreateExclusionRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CreateExclusionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.exclusion != null) { + if (!$util.isObject(object.exclusion)) + throw TypeError(".google.logging.v2.CreateExclusionRequest.exclusion: object expected"); + message.exclusion = $root.google.logging.v2.LogExclusion.fromObject(object.exclusion, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CreateExclusionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {google.logging.v2.CreateExclusionRequest} message CreateExclusionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExclusionRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.exclusion = null; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + object.exclusion = $root.google.logging.v2.LogExclusion.toObject(message.exclusion, options, q + 1); + return object; + }; + + /** + * Converts this CreateExclusionRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CreateExclusionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateExclusionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExclusionRequest + * @function getTypeUrl + * @memberof google.logging.v2.CreateExclusionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExclusionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CreateExclusionRequest"; + }; + + return CreateExclusionRequest; + })(); + + v2.UpdateExclusionRequest = (function() { + + /** + * Properties of an UpdateExclusionRequest. + * @memberof google.logging.v2 + * @interface IUpdateExclusionRequest + * @property {string|null} [name] UpdateExclusionRequest name + * @property {google.logging.v2.ILogExclusion|null} [exclusion] UpdateExclusionRequest exclusion + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateExclusionRequest updateMask + */ + + /** + * Constructs a new UpdateExclusionRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateExclusionRequest. + * @implements IUpdateExclusionRequest + * @constructor + * @param {google.logging.v2.IUpdateExclusionRequest=} [properties] Properties to set + */ + function UpdateExclusionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateExclusionRequest name. + * @member {string} name + * @memberof google.logging.v2.UpdateExclusionRequest + * @instance + */ + UpdateExclusionRequest.prototype.name = ""; + + /** + * UpdateExclusionRequest exclusion. + * @member {google.logging.v2.ILogExclusion|null|undefined} exclusion + * @memberof google.logging.v2.UpdateExclusionRequest + * @instance + */ + UpdateExclusionRequest.prototype.exclusion = null; + + /** + * UpdateExclusionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateExclusionRequest + * @instance + */ + UpdateExclusionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateExclusionRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {google.logging.v2.IUpdateExclusionRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest instance + */ + UpdateExclusionRequest.create = function create(properties) { + return new UpdateExclusionRequest(properties); + }; + + /** + * Encodes the specified UpdateExclusionRequest message. Does not implicitly {@link google.logging.v2.UpdateExclusionRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {google.logging.v2.IUpdateExclusionRequest} message UpdateExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExclusionRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + $root.google.logging.v2.LogExclusion.encode(message.exclusion, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateExclusionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {google.logging.v2.IUpdateExclusionRequest} message UpdateExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateExclusionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExclusionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateExclusionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.exclusion = $root.google.logging.v2.LogExclusion.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateExclusionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateExclusionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateExclusionRequest message. + * @function verify + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateExclusionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) { + var error = $root.google.logging.v2.LogExclusion.verify(message.exclusion, long + 1); + if (error) + return "exclusion." + error; + } + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateExclusionRequest} UpdateExclusionRequest + */ + UpdateExclusionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UpdateExclusionRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateExclusionRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateExclusionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.exclusion != null) { + if (!$util.isObject(object.exclusion)) + throw TypeError(".google.logging.v2.UpdateExclusionRequest.exclusion: object expected"); + message.exclusion = $root.google.logging.v2.LogExclusion.fromObject(object.exclusion, long + 1); + } + if (object.updateMask != null) { + if (!$util.isObject(object.updateMask)) + throw TypeError(".google.logging.v2.UpdateExclusionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateExclusionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {google.logging.v2.UpdateExclusionRequest} message UpdateExclusionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateExclusionRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.exclusion = null; + object.updateMask = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.exclusion != null && Object.hasOwnProperty.call(message, "exclusion")) + object.exclusion = $root.google.logging.v2.LogExclusion.toObject(message.exclusion, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + return object; + }; + + /** + * Converts this UpdateExclusionRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateExclusionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateExclusionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateExclusionRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateExclusionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateExclusionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateExclusionRequest"; + }; + + return UpdateExclusionRequest; + })(); + + v2.DeleteExclusionRequest = (function() { + + /** + * Properties of a DeleteExclusionRequest. + * @memberof google.logging.v2 + * @interface IDeleteExclusionRequest + * @property {string|null} [name] DeleteExclusionRequest name + */ + + /** + * Constructs a new DeleteExclusionRequest. + * @memberof google.logging.v2 + * @classdesc Represents a DeleteExclusionRequest. + * @implements IDeleteExclusionRequest + * @constructor + * @param {google.logging.v2.IDeleteExclusionRequest=} [properties] Properties to set + */ + function DeleteExclusionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExclusionRequest name. + * @member {string} name + * @memberof google.logging.v2.DeleteExclusionRequest + * @instance + */ + DeleteExclusionRequest.prototype.name = ""; + + /** + * Creates a new DeleteExclusionRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {google.logging.v2.IDeleteExclusionRequest=} [properties] Properties to set + * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest instance + */ + DeleteExclusionRequest.create = function create(properties) { + return new DeleteExclusionRequest(properties); + }; + + /** + * Encodes the specified DeleteExclusionRequest message. Does not implicitly {@link google.logging.v2.DeleteExclusionRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {google.logging.v2.IDeleteExclusionRequest} message DeleteExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExclusionRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteExclusionRequest message, length delimited. Does not implicitly {@link google.logging.v2.DeleteExclusionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {google.logging.v2.IDeleteExclusionRequest} message DeleteExclusionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExclusionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DeleteExclusionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExclusionRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteExclusionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExclusionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExclusionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExclusionRequest message. + * @function verify + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExclusionRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteExclusionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.DeleteExclusionRequest} DeleteExclusionRequest + */ + DeleteExclusionRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.DeleteExclusionRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteExclusionRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.DeleteExclusionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteExclusionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {google.logging.v2.DeleteExclusionRequest} message DeleteExclusionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExclusionRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteExclusionRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.DeleteExclusionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExclusionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteExclusionRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteExclusionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteExclusionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteExclusionRequest"; + }; + + return DeleteExclusionRequest; + })(); + + v2.GetCmekSettingsRequest = (function() { + + /** + * Properties of a GetCmekSettingsRequest. + * @memberof google.logging.v2 + * @interface IGetCmekSettingsRequest + * @property {string|null} [name] GetCmekSettingsRequest name + */ + + /** + * Constructs a new GetCmekSettingsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetCmekSettingsRequest. + * @implements IGetCmekSettingsRequest + * @constructor + * @param {google.logging.v2.IGetCmekSettingsRequest=} [properties] Properties to set + */ + function GetCmekSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCmekSettingsRequest name. + * @member {string} name + * @memberof google.logging.v2.GetCmekSettingsRequest + * @instance + */ + GetCmekSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetCmekSettingsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {google.logging.v2.IGetCmekSettingsRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest instance + */ + GetCmekSettingsRequest.create = function create(properties) { + return new GetCmekSettingsRequest(properties); + }; + + /** + * Encodes the specified GetCmekSettingsRequest message. Does not implicitly {@link google.logging.v2.GetCmekSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {google.logging.v2.IGetCmekSettingsRequest} message GetCmekSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCmekSettingsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetCmekSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.GetCmekSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {google.logging.v2.IGetCmekSettingsRequest} message GetCmekSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCmekSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GetCmekSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCmekSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetCmekSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetCmekSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCmekSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCmekSettingsRequest message. + * @function verify + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCmekSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetCmekSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.GetCmekSettingsRequest} GetCmekSettingsRequest + */ + GetCmekSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.GetCmekSettingsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetCmekSettingsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetCmekSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCmekSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {google.logging.v2.GetCmekSettingsRequest} message GetCmekSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCmekSettingsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetCmekSettingsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetCmekSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetCmekSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCmekSettingsRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetCmekSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCmekSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetCmekSettingsRequest"; + }; + + return GetCmekSettingsRequest; + })(); + + v2.UpdateCmekSettingsRequest = (function() { + + /** + * Properties of an UpdateCmekSettingsRequest. + * @memberof google.logging.v2 + * @interface IUpdateCmekSettingsRequest + * @property {string|null} [name] UpdateCmekSettingsRequest name + * @property {google.logging.v2.ICmekSettings|null} [cmekSettings] UpdateCmekSettingsRequest cmekSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCmekSettingsRequest updateMask + */ + + /** + * Constructs a new UpdateCmekSettingsRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateCmekSettingsRequest. + * @implements IUpdateCmekSettingsRequest + * @constructor + * @param {google.logging.v2.IUpdateCmekSettingsRequest=} [properties] Properties to set + */ + function UpdateCmekSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCmekSettingsRequest name. + * @member {string} name + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @instance + */ + UpdateCmekSettingsRequest.prototype.name = ""; + + /** + * UpdateCmekSettingsRequest cmekSettings. + * @member {google.logging.v2.ICmekSettings|null|undefined} cmekSettings + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @instance + */ + UpdateCmekSettingsRequest.prototype.cmekSettings = null; + + /** + * UpdateCmekSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @instance + */ + UpdateCmekSettingsRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCmekSettingsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {google.logging.v2.IUpdateCmekSettingsRequest=} [properties] Properties to set + * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest instance + */ + UpdateCmekSettingsRequest.create = function create(properties) { + return new UpdateCmekSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateCmekSettingsRequest message. Does not implicitly {@link google.logging.v2.UpdateCmekSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {google.logging.v2.IUpdateCmekSettingsRequest} message UpdateCmekSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCmekSettingsRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) + $root.google.logging.v2.CmekSettings.encode(message.cmekSettings, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateCmekSettingsRequest message, length delimited. Does not implicitly {@link google.logging.v2.UpdateCmekSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {google.logging.v2.IUpdateCmekSettingsRequest} message UpdateCmekSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCmekSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an UpdateCmekSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCmekSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateCmekSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.cmekSettings = $root.google.logging.v2.CmekSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateCmekSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCmekSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCmekSettingsRequest message. + * @function verify + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCmekSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) { + var error = $root.google.logging.v2.CmekSettings.verify(message.cmekSettings, long + 1); + if (error) + return "cmekSettings." + error; + } + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateCmekSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.UpdateCmekSettingsRequest} UpdateCmekSettingsRequest + */ + UpdateCmekSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UpdateCmekSettingsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateCmekSettingsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateCmekSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.cmekSettings != null) { + if (!$util.isObject(object.cmekSettings)) + throw TypeError(".google.logging.v2.UpdateCmekSettingsRequest.cmekSettings: object expected"); + message.cmekSettings = $root.google.logging.v2.CmekSettings.fromObject(object.cmekSettings, long + 1); + } + if (object.updateMask != null) { + if (!$util.isObject(object.updateMask)) + throw TypeError(".google.logging.v2.UpdateCmekSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCmekSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {google.logging.v2.UpdateCmekSettingsRequest} message UpdateCmekSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCmekSettingsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.cmekSettings = null; + object.updateMask = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.cmekSettings != null && Object.hasOwnProperty.call(message, "cmekSettings")) + object.cmekSettings = $root.google.logging.v2.CmekSettings.toObject(message.cmekSettings, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + return object; + }; + + /** + * Converts this UpdateCmekSettingsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCmekSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCmekSettingsRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateCmekSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCmekSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateCmekSettingsRequest"; + }; + + return UpdateCmekSettingsRequest; + })(); + + v2.CmekSettings = (function() { + + /** + * Properties of a CmekSettings. + * @memberof google.logging.v2 + * @interface ICmekSettings + * @property {string|null} [name] CmekSettings name + * @property {string|null} [kmsKeyName] CmekSettings kmsKeyName + * @property {string|null} [kmsKeyVersionName] CmekSettings kmsKeyVersionName + * @property {string|null} [serviceAccountId] CmekSettings serviceAccountId + */ + + /** + * Constructs a new CmekSettings. + * @memberof google.logging.v2 + * @classdesc Represents a CmekSettings. + * @implements ICmekSettings + * @constructor + * @param {google.logging.v2.ICmekSettings=} [properties] Properties to set + */ + function CmekSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CmekSettings name. + * @member {string} name + * @memberof google.logging.v2.CmekSettings + * @instance + */ + CmekSettings.prototype.name = ""; + + /** + * CmekSettings kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.logging.v2.CmekSettings + * @instance + */ + CmekSettings.prototype.kmsKeyName = ""; + + /** + * CmekSettings kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.logging.v2.CmekSettings + * @instance + */ + CmekSettings.prototype.kmsKeyVersionName = ""; + + /** + * CmekSettings serviceAccountId. + * @member {string} serviceAccountId + * @memberof google.logging.v2.CmekSettings + * @instance + */ + CmekSettings.prototype.serviceAccountId = ""; + + /** + * Creates a new CmekSettings instance using the specified properties. + * @function create + * @memberof google.logging.v2.CmekSettings + * @static + * @param {google.logging.v2.ICmekSettings=} [properties] Properties to set + * @returns {google.logging.v2.CmekSettings} CmekSettings instance + */ + CmekSettings.create = function create(properties) { + return new CmekSettings(properties); + }; + + /** + * Encodes the specified CmekSettings message. Does not implicitly {@link google.logging.v2.CmekSettings.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CmekSettings + * @static + * @param {google.logging.v2.ICmekSettings} message CmekSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CmekSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.serviceAccountId != null && Object.hasOwnProperty.call(message, "serviceAccountId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountId); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kmsKeyVersionName); + return writer; + }; + + /** + * Encodes the specified CmekSettings message, length delimited. Does not implicitly {@link google.logging.v2.CmekSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CmekSettings + * @static + * @param {google.logging.v2.ICmekSettings} message CmekSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CmekSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CmekSettings message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.CmekSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.CmekSettings} CmekSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CmekSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CmekSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 4: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 3: { + message.serviceAccountId = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CmekSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CmekSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.CmekSettings} CmekSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CmekSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CmekSettings message. + * @function verify + * @memberof google.logging.v2.CmekSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CmekSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + if (message.serviceAccountId != null && Object.hasOwnProperty.call(message, "serviceAccountId")) + if (!$util.isString(message.serviceAccountId)) + return "serviceAccountId: string expected"; + return null; + }; + + /** + * Creates a CmekSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CmekSettings + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CmekSettings} CmekSettings + */ + CmekSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CmekSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CmekSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CmekSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.serviceAccountId != null) + message.serviceAccountId = String(object.serviceAccountId); + return message; + }; + + /** + * Creates a plain object from a CmekSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CmekSettings + * @static + * @param {google.logging.v2.CmekSettings} message CmekSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CmekSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.kmsKeyName = ""; + object.serviceAccountId = ""; + object.kmsKeyVersionName = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.serviceAccountId != null && Object.hasOwnProperty.call(message, "serviceAccountId")) + object.serviceAccountId = message.serviceAccountId; + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + return object; + }; + + /** + * Converts this CmekSettings to JSON. + * @function toJSON + * @memberof google.logging.v2.CmekSettings + * @instance + * @returns {Object.} JSON object + */ + CmekSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CmekSettings + * @function getTypeUrl + * @memberof google.logging.v2.CmekSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CmekSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CmekSettings"; + }; + + return CmekSettings; + })(); + + v2.GetSettingsRequest = (function() { + + /** + * Properties of a GetSettingsRequest. + * @memberof google.logging.v2 + * @interface IGetSettingsRequest + * @property {string|null} [name] GetSettingsRequest name + */ + + /** + * Constructs a new GetSettingsRequest. + * @memberof google.logging.v2 + * @classdesc Represents a GetSettingsRequest. + * @implements IGetSettingsRequest + * @constructor + * @param {google.logging.v2.IGetSettingsRequest=} [properties] Properties to set + */ + function GetSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSettingsRequest name. + * @member {string} name + * @memberof google.logging.v2.GetSettingsRequest + * @instance + */ + GetSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetSettingsRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {google.logging.v2.IGetSettingsRequest=} [properties] Properties to set + * @returns {google.logging.v2.GetSettingsRequest} GetSettingsRequest instance + */ + GetSettingsRequest.create = function create(properties) { + return new GetSettingsRequest(properties); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * 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 + */ + GetSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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 + */ + GetSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * 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, long) { + if (object instanceof $root.google.logging.v2.GetSettingsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetSettingsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSettingsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.GetSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSettingsRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetSettingsRequest"; + }; + + return GetSettingsRequest; + })(); + + v2.UpdateSettingsRequest = (function() { + + /** + * 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 + */ + + /** + * Constructs a new UpdateSettingsRequest. + * @memberof google.logging.v2 + * @classdesc Represents an UpdateSettingsRequest. + * @implements IUpdateSettingsRequest + * @constructor + * @param {google.logging.v2.IUpdateSettingsRequest=} [properties] Properties to set + */ + function UpdateSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSettingsRequest name. + * @member {string} name + * @memberof google.logging.v2.UpdateSettingsRequest + * @instance + */ + UpdateSettingsRequest.prototype.name = ""; + + /** + * UpdateSettingsRequest settings. + * @member {google.logging.v2.ISettings|null|undefined} settings + * @memberof google.logging.v2.UpdateSettingsRequest + * @instance + */ + UpdateSettingsRequest.prototype.settings = null; + + /** + * UpdateSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.logging.v2.UpdateSettingsRequest + * @instance + */ + UpdateSettingsRequest.prototype.updateMask = null; + + /** + * 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 + */ + UpdateSettingsRequest.create = function create(properties) { + return new UpdateSettingsRequest(properties); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).ldelim(); + return writer; + }; + + /** + * 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 + */ + UpdateSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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 + */ + UpdateSettingsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.settings = $root.google.logging.v2.Settings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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 + */ + UpdateSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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 + */ + UpdateSettingsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) { + var error = $root.google.logging.v2.Settings.verify(message.settings, long + 1); + if (error) + return "settings." + error; + } + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * 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 + */ + UpdateSettingsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.UpdateSettingsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateSettingsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.settings != null) { + if (!$util.isObject(object.settings)) + throw TypeError(".google.logging.v2.UpdateSettingsRequest.settings: object expected"); + message.settings = $root.google.logging.v2.Settings.fromObject(object.settings, long + 1); + } + if (object.updateMask != null) { + if (!$util.isObject(object.updateMask)) + throw TypeError(".google.logging.v2.UpdateSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); + } + return message; + }; + + /** + * 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 + */ + UpdateSettingsRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.settings = null; + object.updateMask = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + object.settings = $root.google.logging.v2.Settings.toObject(message.settings, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + return object; + }; + + /** + * Converts this UpdateSettingsRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.UpdateSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSettingsRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateSettingsRequest"; + }; + + return UpdateSettingsRequest; + })(); + + v2.Settings = (function() { + + /** + * Properties of a Settings. + * @memberof google.logging.v2 + * @interface ISettings + * @property {string|null} [name] Settings name + * @property {string|null} [kmsKeyName] Settings kmsKeyName + * @property {string|null} [kmsServiceAccountId] Settings kmsServiceAccountId + * @property {string|null} [storageLocation] Settings storageLocation + * @property {boolean|null} [disableDefaultSink] Settings disableDefaultSink + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Settings name. + * @member {string} name + * @memberof google.logging.v2.Settings + * @instance + */ + Settings.prototype.name = ""; + + /** + * Settings kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.logging.v2.Settings + * @instance + */ + Settings.prototype.kmsKeyName = ""; + + /** + * Settings kmsServiceAccountId. + * @member {string} kmsServiceAccountId + * @memberof google.logging.v2.Settings + * @instance + */ + Settings.prototype.kmsServiceAccountId = ""; + + /** + * Settings storageLocation. + * @member {string} storageLocation + * @memberof google.logging.v2.Settings + * @instance + */ + Settings.prototype.storageLocation = ""; + + /** + * Settings disableDefaultSink. + * @member {boolean} disableDefaultSink + * @memberof google.logging.v2.Settings + * @instance + */ + Settings.prototype.disableDefaultSink = false; + + /** + * Creates a new Settings instance using the specified properties. + * @function create + * @memberof google.logging.v2.Settings + * @static + * @param {google.logging.v2.ISettings=} [properties] Properties to set + * @returns {google.logging.v2.Settings} Settings instance + */ + Settings.create = function create(properties) { + return new Settings(properties); + }; + + /** + * Encodes the specified Settings message. Does not implicitly {@link google.logging.v2.Settings.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.Settings + * @static + * @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 + */ + Settings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); + if (message.kmsServiceAccountId != null && Object.hasOwnProperty.call(message, "kmsServiceAccountId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsServiceAccountId); + 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 Settings message, length delimited. Does not implicitly {@link google.logging.v2.Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.Settings + * @static + * @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 + */ + Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @function decode + * @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.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + message.kmsServiceAccountId = reader.string(); + break; + } + case 4: { + message.storageLocation = reader.string(); + break; + } + case 5: { + message.disableDefaultSink = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Settings message. + * @function verify + * @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 + */ + Settings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsServiceAccountId != null && Object.hasOwnProperty.call(message, "kmsServiceAccountId")) + if (!$util.isString(message.kmsServiceAccountId)) + return "kmsServiceAccountId: string expected"; + if (message.storageLocation != null && Object.hasOwnProperty.call(message, "storageLocation")) + if (!$util.isString(message.storageLocation)) + return "storageLocation: string expected"; + if (message.disableDefaultSink != null && Object.hasOwnProperty.call(message, "disableDefaultSink")) + if (typeof message.disableDefaultSink !== "boolean") + return "disableDefaultSink: boolean expected"; + return null; + }; + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.Settings + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.Settings} Settings + */ + Settings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.Settings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.Settings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.Settings(); + if (object.name != null) + message.name = String(object.name); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsServiceAccountId != null) + message.kmsServiceAccountId = String(object.kmsServiceAccountId); + 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 Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.Settings + * @static + * @param {google.logging.v2.Settings} message Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Settings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.kmsKeyName = ""; + object.kmsServiceAccountId = ""; + object.storageLocation = ""; + object.disableDefaultSink = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsServiceAccountId != null && Object.hasOwnProperty.call(message, "kmsServiceAccountId")) + object.kmsServiceAccountId = message.kmsServiceAccountId; + if (message.storageLocation != null && Object.hasOwnProperty.call(message, "storageLocation")) + object.storageLocation = message.storageLocation; + if (message.disableDefaultSink != null && Object.hasOwnProperty.call(message, "disableDefaultSink")) + object.disableDefaultSink = message.disableDefaultSink; + return object; + }; + + /** + * Converts this Settings to JSON. + * @function toJSON + * @memberof google.logging.v2.Settings + * @instance + * @returns {Object.} JSON object + */ + Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Settings + * @function getTypeUrl + * @memberof google.logging.v2.Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.Settings"; + }; + + return Settings; + })(); + + v2.CopyLogEntriesRequest = (function() { + + /** + * Properties of a CopyLogEntriesRequest. + * @memberof google.logging.v2 + * @interface ICopyLogEntriesRequest + * @property {string|null} [name] CopyLogEntriesRequest name + * @property {string|null} [filter] CopyLogEntriesRequest filter + * @property {string|null} [destination] CopyLogEntriesRequest destination + */ + + /** + * Constructs a new CopyLogEntriesRequest. + * @memberof google.logging.v2 + * @classdesc Represents a CopyLogEntriesRequest. + * @implements ICopyLogEntriesRequest + * @constructor + * @param {google.logging.v2.ICopyLogEntriesRequest=} [properties] Properties to set + */ + function CopyLogEntriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyLogEntriesRequest name. + * @member {string} name + * @memberof google.logging.v2.CopyLogEntriesRequest + * @instance + */ + CopyLogEntriesRequest.prototype.name = ""; + + /** + * CopyLogEntriesRequest filter. + * @member {string} filter + * @memberof google.logging.v2.CopyLogEntriesRequest + * @instance + */ + CopyLogEntriesRequest.prototype.filter = ""; + + /** + * CopyLogEntriesRequest destination. + * @member {string} destination + * @memberof google.logging.v2.CopyLogEntriesRequest + * @instance + */ + CopyLogEntriesRequest.prototype.destination = ""; + + /** + * Creates a new CopyLogEntriesRequest instance using the specified properties. + * @function create + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @param {google.logging.v2.ICopyLogEntriesRequest=} [properties] Properties to set + * @returns {google.logging.v2.CopyLogEntriesRequest} CopyLogEntriesRequest instance + */ + CopyLogEntriesRequest.create = function create(properties) { + return new CopyLogEntriesRequest(properties); + }; + + /** + * Encodes the specified CopyLogEntriesRequest message. Does not implicitly {@link google.logging.v2.CopyLogEntriesRequest.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @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 + */ + CopyLogEntriesRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 CopyLogEntriesRequest message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @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 + */ + CopyLogEntriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer. + * @function decode + * @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.CopyLogEntriesRequest} CopyLogEntriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyLogEntriesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CopyLogEntriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.destination = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CopyLogEntriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CopyLogEntriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyLogEntriesRequest message. + * @function verify + * @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 + */ + CopyLogEntriesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + return null; + }; + + /** + * Creates a CopyLogEntriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CopyLogEntriesRequest} CopyLogEntriesRequest + */ + CopyLogEntriesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CopyLogEntriesRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CopyLogEntriesRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 CopyLogEntriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @param {google.logging.v2.CopyLogEntriesRequest} message CopyLogEntriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyLogEntriesRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.filter = ""; + object.destination = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + object.destination = message.destination; + return object; + }; + + /** + * Converts this CopyLogEntriesRequest to JSON. + * @function toJSON + * @memberof google.logging.v2.CopyLogEntriesRequest + * @instance + * @returns {Object.} JSON object + */ + CopyLogEntriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyLogEntriesRequest + * @function getTypeUrl + * @memberof google.logging.v2.CopyLogEntriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyLogEntriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CopyLogEntriesRequest"; + }; + + return CopyLogEntriesRequest; + })(); + + v2.CopyLogEntriesMetadata = (function() { + + /** + * Properties of a CopyLogEntriesMetadata. + * @memberof google.logging.v2 + * @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 CopyLogEntriesMetadata. + * @memberof google.logging.v2 + * @classdesc Represents a CopyLogEntriesMetadata. + * @implements ICopyLogEntriesMetadata + * @constructor + * @param {google.logging.v2.ICopyLogEntriesMetadata=} [properties] Properties to set + */ + function CopyLogEntriesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyLogEntriesMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.startTime = null; + + /** + * CopyLogEntriesMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + */ + CopyLogEntriesMetadata.prototype.endTime = null; + + /** + * 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.CopyLogEntriesMetadata + * @static + * @param {google.logging.v2.ICopyLogEntriesMetadata=} [properties] Properties to set + * @returns {google.logging.v2.CopyLogEntriesMetadata} CopyLogEntriesMetadata instance + */ + CopyLogEntriesMetadata.create = function create(properties) { + return new CopyLogEntriesMetadata(properties); + }; + + /** + * Encodes the specified CopyLogEntriesMetadata message. Does not implicitly {@link google.logging.v2.CopyLogEntriesMetadata.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @static + * @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 + */ + CopyLogEntriesMetadata.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(), q + 1).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(), q + 1).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 CopyLogEntriesMetadata message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @static + * @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 + */ + CopyLogEntriesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer. + * @function decode + * @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.CopyLogEntriesMetadata} CopyLogEntriesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyLogEntriesMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CopyLogEntriesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + 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(), undefined, long + 1); + break; + } + case 6: { + message.progress = reader.int32(); + break; + } + case 7: { + message.writerIdentity = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CopyLogEntriesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CopyLogEntriesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyLogEntriesMetadata message. + * @function verify + * @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 + */ + CopyLogEntriesMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + if (message.state != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "cancellationRequested")) + if (typeof message.cancellationRequested !== "boolean") + return "cancellationRequested: boolean expected"; + if (message.request != null && Object.hasOwnProperty.call(message, "request")) { + var error = $root.google.logging.v2.CopyLogEntriesRequest.verify(message.request, long + 1); + if (error) + return "request." + error; + } + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + if (!$util.isInteger(message.progress)) + return "progress: integer expected"; + if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) + if (!$util.isString(message.writerIdentity)) + return "writerIdentity: string expected"; + return null; + }; + + /** + * Creates a CopyLogEntriesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CopyLogEntriesMetadata} CopyLogEntriesMetadata + */ + CopyLogEntriesMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CopyLogEntriesMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CopyLogEntriesMetadata(); + if (object.startTime != null) { + if (!$util.isObject(object.startTime)) + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (!$util.isObject(object.endTime)) + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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.cancellationRequested != null) + message.cancellationRequested = Boolean(object.cancellationRequested); + if (object.request != null) { + if (!$util.isObject(object.request)) + throw TypeError(".google.logging.v2.CopyLogEntriesMetadata.request: object expected"); + message.request = $root.google.logging.v2.CopyLogEntriesRequest.fromObject(object.request, long + 1); + } + 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 CopyLogEntriesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @static + * @param {google.logging.v2.CopyLogEntriesMetadata} message CopyLogEntriesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyLogEntriesMetadata.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + 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.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + object.state = options.enums === String ? $root.google.logging.v2.OperationState[message.state] === undefined ? message.state : $root.google.logging.v2.OperationState[message.state] : message.state; + if (message.cancellationRequested != null && Object.hasOwnProperty.call(message, "cancellationRequested")) + object.cancellationRequested = message.cancellationRequested; + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + object.request = $root.google.logging.v2.CopyLogEntriesRequest.toObject(message.request, options, q + 1); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = message.progress; + if (message.writerIdentity != null && Object.hasOwnProperty.call(message, "writerIdentity")) + object.writerIdentity = message.writerIdentity; + return object; + }; + + /** + * Converts this CopyLogEntriesMetadata to JSON. + * @function toJSON + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @instance + * @returns {Object.} JSON object + */ + CopyLogEntriesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyLogEntriesMetadata + * @function getTypeUrl + * @memberof google.logging.v2.CopyLogEntriesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyLogEntriesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CopyLogEntriesMetadata"; + }; + + return CopyLogEntriesMetadata; + })(); + + v2.CopyLogEntriesResponse = (function() { + + /** + * Properties of a CopyLogEntriesResponse. + * @memberof google.logging.v2 + * @interface ICopyLogEntriesResponse + * @property {number|Long|null} [logEntriesCopiedCount] CopyLogEntriesResponse logEntriesCopiedCount + */ + + /** + * Constructs a new CopyLogEntriesResponse. + * @memberof google.logging.v2 + * @classdesc Represents a CopyLogEntriesResponse. + * @implements ICopyLogEntriesResponse + * @constructor + * @param {google.logging.v2.ICopyLogEntriesResponse=} [properties] Properties to set + */ + function CopyLogEntriesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyLogEntriesResponse logEntriesCopiedCount. + * @member {number|Long} logEntriesCopiedCount + * @memberof google.logging.v2.CopyLogEntriesResponse + * @instance + */ + CopyLogEntriesResponse.prototype.logEntriesCopiedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CopyLogEntriesResponse instance using the specified properties. + * @function create + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @param {google.logging.v2.ICopyLogEntriesResponse=} [properties] Properties to set + * @returns {google.logging.v2.CopyLogEntriesResponse} CopyLogEntriesResponse instance + */ + CopyLogEntriesResponse.create = function create(properties) { + return new CopyLogEntriesResponse(properties); + }; + + /** + * Encodes the specified CopyLogEntriesResponse message. Does not implicitly {@link google.logging.v2.CopyLogEntriesResponse.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @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 + */ + CopyLogEntriesResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.logEntriesCopiedCount != null && Object.hasOwnProperty.call(message, "logEntriesCopiedCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.logEntriesCopiedCount); + return writer; + }; + + /** + * Encodes the specified CopyLogEntriesResponse message, length delimited. Does not implicitly {@link google.logging.v2.CopyLogEntriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @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 + */ + CopyLogEntriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer. + * @function decode + * @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.CopyLogEntriesResponse} CopyLogEntriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyLogEntriesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CopyLogEntriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logEntriesCopiedCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CopyLogEntriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CopyLogEntriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyLogEntriesResponse message. + * @function verify + * @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 + */ + CopyLogEntriesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logEntriesCopiedCount != null && Object.hasOwnProperty.call(message, "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 CopyLogEntriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.CopyLogEntriesResponse} CopyLogEntriesResponse + */ + CopyLogEntriesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.CopyLogEntriesResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CopyLogEntriesResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CopyLogEntriesResponse(); + if (object.logEntriesCopiedCount != null) + if ($util.Long) + message.logEntriesCopiedCount = $util.Long.fromValue(object.logEntriesCopiedCount, 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 CopyLogEntriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @param {google.logging.v2.CopyLogEntriesResponse} message CopyLogEntriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyLogEntriesResponse.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.logEntriesCopiedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.logEntriesCopiedCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.logEntriesCopiedCount != null && Object.hasOwnProperty.call(message, "logEntriesCopiedCount")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.logEntriesCopiedCount = typeof message.logEntriesCopiedCount === "number" ? BigInt(message.logEntriesCopiedCount) : $util.Long.fromBits(message.logEntriesCopiedCount.low >>> 0, message.logEntriesCopiedCount.high >>> 0, false).toBigInt(); + else 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 CopyLogEntriesResponse to JSON. + * @function toJSON + * @memberof google.logging.v2.CopyLogEntriesResponse + * @instance + * @returns {Object.} JSON object + */ + CopyLogEntriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyLogEntriesResponse + * @function getTypeUrl + * @memberof google.logging.v2.CopyLogEntriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyLogEntriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CopyLogEntriesResponse"; + }; + + return CopyLogEntriesResponse; + })(); + + v2.BucketMetadata = (function() { + + /** + * Properties of a BucketMetadata. + * @memberof google.logging.v2 + * @interface IBucketMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] BucketMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] BucketMetadata endTime + * @property {google.logging.v2.OperationState|null} [state] BucketMetadata state + * @property {google.logging.v2.ICreateBucketRequest|null} [createBucketRequest] BucketMetadata createBucketRequest + * @property {google.logging.v2.IUpdateBucketRequest|null} [updateBucketRequest] BucketMetadata updateBucketRequest + */ + + /** + * Constructs a new BucketMetadata. + * @memberof google.logging.v2 + * @classdesc Represents a BucketMetadata. + * @implements IBucketMetadata + * @constructor + * @param {google.logging.v2.IBucketMetadata=} [properties] Properties to set + */ + function BucketMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BucketMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.logging.v2.BucketMetadata + * @instance + */ + BucketMetadata.prototype.startTime = null; + + /** + * BucketMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.logging.v2.BucketMetadata + * @instance + */ + BucketMetadata.prototype.endTime = null; + + /** + * BucketMetadata state. + * @member {google.logging.v2.OperationState} state + * @memberof google.logging.v2.BucketMetadata + * @instance + */ + BucketMetadata.prototype.state = 0; + + /** + * BucketMetadata createBucketRequest. + * @member {google.logging.v2.ICreateBucketRequest|null|undefined} createBucketRequest + * @memberof google.logging.v2.BucketMetadata + * @instance + */ + BucketMetadata.prototype.createBucketRequest = null; + + /** + * BucketMetadata updateBucketRequest. + * @member {google.logging.v2.IUpdateBucketRequest|null|undefined} updateBucketRequest + * @memberof google.logging.v2.BucketMetadata + * @instance + */ + BucketMetadata.prototype.updateBucketRequest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BucketMetadata request. + * @member {"createBucketRequest"|"updateBucketRequest"|undefined} request + * @memberof google.logging.v2.BucketMetadata + * @instance + */ + Object.defineProperty(BucketMetadata.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["createBucketRequest", "updateBucketRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BucketMetadata instance using the specified properties. + * @function create + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {google.logging.v2.IBucketMetadata=} [properties] Properties to set + * @returns {google.logging.v2.BucketMetadata} BucketMetadata instance + */ + BucketMetadata.create = function create(properties) { + return new BucketMetadata(properties); + }; + + /** + * Encodes the specified BucketMetadata message. Does not implicitly {@link google.logging.v2.BucketMetadata.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {google.logging.v2.IBucketMetadata} message BucketMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketMetadata.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(), q + 1).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createBucketRequest != null && Object.hasOwnProperty.call(message, "createBucketRequest")) + $root.google.logging.v2.CreateBucketRequest.encode(message.createBucketRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.updateBucketRequest != null && Object.hasOwnProperty.call(message, "updateBucketRequest")) + $root.google.logging.v2.UpdateBucketRequest.encode(message.updateBucketRequest, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified BucketMetadata message, length delimited. Does not implicitly {@link google.logging.v2.BucketMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {google.logging.v2.IBucketMetadata} message BucketMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a BucketMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.BucketMetadata} BucketMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.BucketMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.createBucketRequest = $root.google.logging.v2.CreateBucketRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.updateBucketRequest = $root.google.logging.v2.UpdateBucketRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BucketMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.BucketMetadata} BucketMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BucketMetadata message. + * @function verify + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BucketMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + if (message.state != null && Object.hasOwnProperty.call(message, "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.createBucketRequest != null && Object.hasOwnProperty.call(message, "createBucketRequest")) { + properties.request = 1; + { + var error = $root.google.logging.v2.CreateBucketRequest.verify(message.createBucketRequest, long + 1); + if (error) + return "createBucketRequest." + error; + } + } + if (message.updateBucketRequest != null && Object.hasOwnProperty.call(message, "updateBucketRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.logging.v2.UpdateBucketRequest.verify(message.updateBucketRequest, long + 1); + if (error) + return "updateBucketRequest." + error; + } + } + return null; + }; + + /** + * Creates a BucketMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.BucketMetadata} BucketMetadata + */ + BucketMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.BucketMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.BucketMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.BucketMetadata(); + if (object.startTime != null) { + if (!$util.isObject(object.startTime)) + throw TypeError(".google.logging.v2.BucketMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (!$util.isObject(object.endTime)) + throw TypeError(".google.logging.v2.BucketMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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.createBucketRequest != null) { + if (!$util.isObject(object.createBucketRequest)) + throw TypeError(".google.logging.v2.BucketMetadata.createBucketRequest: object expected"); + message.createBucketRequest = $root.google.logging.v2.CreateBucketRequest.fromObject(object.createBucketRequest, long + 1); + } + if (object.updateBucketRequest != null) { + if (!$util.isObject(object.updateBucketRequest)) + throw TypeError(".google.logging.v2.BucketMetadata.updateBucketRequest: object expected"); + message.updateBucketRequest = $root.google.logging.v2.UpdateBucketRequest.fromObject(object.updateBucketRequest, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a BucketMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {google.logging.v2.BucketMetadata} message BucketMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BucketMetadata.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + } + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + object.state = options.enums === String ? $root.google.logging.v2.OperationState[message.state] === undefined ? message.state : $root.google.logging.v2.OperationState[message.state] : message.state; + if (message.createBucketRequest != null && Object.hasOwnProperty.call(message, "createBucketRequest")) { + object.createBucketRequest = $root.google.logging.v2.CreateBucketRequest.toObject(message.createBucketRequest, options, q + 1); + if (options.oneofs) + object.request = "createBucketRequest"; + } + if (message.updateBucketRequest != null && Object.hasOwnProperty.call(message, "updateBucketRequest")) { + object.updateBucketRequest = $root.google.logging.v2.UpdateBucketRequest.toObject(message.updateBucketRequest, options, q + 1); + if (options.oneofs) + object.request = "updateBucketRequest"; + } + return object; + }; + + /** + * Converts this BucketMetadata to JSON. + * @function toJSON + * @memberof google.logging.v2.BucketMetadata + * @instance + * @returns {Object.} JSON object + */ + BucketMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BucketMetadata + * @function getTypeUrl + * @memberof google.logging.v2.BucketMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BucketMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.BucketMetadata"; + }; + + return BucketMetadata; + })(); + + v2.LinkMetadata = (function() { + + /** + * Properties of a LinkMetadata. + * @memberof google.logging.v2 + * @interface ILinkMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] LinkMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] LinkMetadata endTime + * @property {google.logging.v2.OperationState|null} [state] LinkMetadata state + * @property {google.logging.v2.ICreateLinkRequest|null} [createLinkRequest] LinkMetadata createLinkRequest + * @property {google.logging.v2.IDeleteLinkRequest|null} [deleteLinkRequest] LinkMetadata deleteLinkRequest + */ + + /** + * Constructs a new LinkMetadata. + * @memberof google.logging.v2 + * @classdesc Represents a LinkMetadata. + * @implements ILinkMetadata + * @constructor + * @param {google.logging.v2.ILinkMetadata=} [properties] Properties to set + */ + function LinkMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LinkMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.logging.v2.LinkMetadata + * @instance + */ + LinkMetadata.prototype.startTime = null; + + /** + * LinkMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.logging.v2.LinkMetadata + * @instance + */ + LinkMetadata.prototype.endTime = null; + + /** + * LinkMetadata state. + * @member {google.logging.v2.OperationState} state + * @memberof google.logging.v2.LinkMetadata + * @instance + */ + LinkMetadata.prototype.state = 0; + + /** + * LinkMetadata createLinkRequest. + * @member {google.logging.v2.ICreateLinkRequest|null|undefined} createLinkRequest + * @memberof google.logging.v2.LinkMetadata + * @instance + */ + LinkMetadata.prototype.createLinkRequest = null; + + /** + * LinkMetadata deleteLinkRequest. + * @member {google.logging.v2.IDeleteLinkRequest|null|undefined} deleteLinkRequest + * @memberof google.logging.v2.LinkMetadata + * @instance + */ + LinkMetadata.prototype.deleteLinkRequest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LinkMetadata request. + * @member {"createLinkRequest"|"deleteLinkRequest"|undefined} request + * @memberof google.logging.v2.LinkMetadata + * @instance + */ + Object.defineProperty(LinkMetadata.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["createLinkRequest", "deleteLinkRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LinkMetadata instance using the specified properties. + * @function create + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {google.logging.v2.ILinkMetadata=} [properties] Properties to set + * @returns {google.logging.v2.LinkMetadata} LinkMetadata instance + */ + LinkMetadata.create = function create(properties) { + return new LinkMetadata(properties); + }; + + /** + * Encodes the specified LinkMetadata message. Does not implicitly {@link google.logging.v2.LinkMetadata.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {google.logging.v2.ILinkMetadata} message LinkMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkMetadata.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(), q + 1).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createLinkRequest != null && Object.hasOwnProperty.call(message, "createLinkRequest")) + $root.google.logging.v2.CreateLinkRequest.encode(message.createLinkRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + if (message.deleteLinkRequest != null && Object.hasOwnProperty.call(message, "deleteLinkRequest")) + $root.google.logging.v2.DeleteLinkRequest.encode(message.deleteLinkRequest, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LinkMetadata message, length delimited. Does not implicitly {@link google.logging.v2.LinkMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {google.logging.v2.ILinkMetadata} message LinkMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LinkMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LinkMetadata} LinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LinkMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.createLinkRequest = $root.google.logging.v2.CreateLinkRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.deleteLinkRequest = $root.google.logging.v2.DeleteLinkRequest.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LinkMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LinkMetadata} LinkMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkMetadata message. + * @function verify + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); + if (error) + return "startTime." + error; + } + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); + if (error) + return "endTime." + error; + } + if (message.state != null && Object.hasOwnProperty.call(message, "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.createLinkRequest != null && Object.hasOwnProperty.call(message, "createLinkRequest")) { + properties.request = 1; + { + var error = $root.google.logging.v2.CreateLinkRequest.verify(message.createLinkRequest, long + 1); + if (error) + return "createLinkRequest." + error; + } + } + if (message.deleteLinkRequest != null && Object.hasOwnProperty.call(message, "deleteLinkRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.logging.v2.DeleteLinkRequest.verify(message.deleteLinkRequest, long + 1); + if (error) + return "deleteLinkRequest." + error; + } + } + return null; + }; + + /** + * Creates a LinkMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LinkMetadata} LinkMetadata + */ + LinkMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LinkMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LinkMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LinkMetadata(); + if (object.startTime != null) { + if (!$util.isObject(object.startTime)) + throw TypeError(".google.logging.v2.LinkMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); + } + if (object.endTime != null) { + if (!$util.isObject(object.endTime)) + throw TypeError(".google.logging.v2.LinkMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + 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.createLinkRequest != null) { + if (!$util.isObject(object.createLinkRequest)) + throw TypeError(".google.logging.v2.LinkMetadata.createLinkRequest: object expected"); + message.createLinkRequest = $root.google.logging.v2.CreateLinkRequest.fromObject(object.createLinkRequest, long + 1); + } + if (object.deleteLinkRequest != null) { + if (!$util.isObject(object.deleteLinkRequest)) + throw TypeError(".google.logging.v2.LinkMetadata.deleteLinkRequest: object expected"); + message.deleteLinkRequest = $root.google.logging.v2.DeleteLinkRequest.fromObject(object.deleteLinkRequest, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LinkMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {google.logging.v2.LinkMetadata} message LinkMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkMetadata.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + } + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + object.state = options.enums === String ? $root.google.logging.v2.OperationState[message.state] === undefined ? message.state : $root.google.logging.v2.OperationState[message.state] : message.state; + if (message.createLinkRequest != null && Object.hasOwnProperty.call(message, "createLinkRequest")) { + object.createLinkRequest = $root.google.logging.v2.CreateLinkRequest.toObject(message.createLinkRequest, options, q + 1); + if (options.oneofs) + object.request = "createLinkRequest"; + } + if (message.deleteLinkRequest != null && Object.hasOwnProperty.call(message, "deleteLinkRequest")) { + object.deleteLinkRequest = $root.google.logging.v2.DeleteLinkRequest.toObject(message.deleteLinkRequest, options, q + 1); + if (options.oneofs) + object.request = "deleteLinkRequest"; + } + return object; + }; + + /** + * Converts this LinkMetadata to JSON. + * @function toJSON + * @memberof google.logging.v2.LinkMetadata + * @instance + * @returns {Object.} JSON object + */ + LinkMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkMetadata + * @function getTypeUrl + * @memberof google.logging.v2.LinkMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LinkMetadata"; + }; + + return LinkMetadata; + })(); + + /** + * 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; + })(); + + /** + * 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 + * @property {number} UPDATING=3 UPDATING value + * @property {number} CREATING=4 CREATING value + * @property {number} FAILED=5 FAILED 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; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "FAILED"] = 5; + return values; + })(); + + /** + * IndexType enum. + * @name google.logging.v2.IndexType + * @enum {number} + * @property {number} INDEX_TYPE_UNSPECIFIED=0 INDEX_TYPE_UNSPECIFIED value + * @property {number} INDEX_TYPE_STRING=1 INDEX_TYPE_STRING value + * @property {number} INDEX_TYPE_INTEGER=2 INDEX_TYPE_INTEGER value + */ + v2.IndexType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INDEX_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INDEX_TYPE_STRING"] = 1; + values[valuesById[2] = "INDEX_TYPE_INTEGER"] = 2; + return values; + })(); + + v2.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.logging.v2 + * @interface ILocationMetadata + * @property {boolean|null} [logAnalyticsEnabled] LocationMetadata logAnalyticsEnabled + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.logging.v2 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.logging.v2.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata logAnalyticsEnabled. + * @member {boolean} logAnalyticsEnabled + * @memberof google.logging.v2.LocationMetadata + * @instance + */ + LocationMetadata.prototype.logAnalyticsEnabled = false; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {google.logging.v2.ILocationMetadata=} [properties] Properties to set + * @returns {google.logging.v2.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.logging.v2.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {google.logging.v2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.logAnalyticsEnabled != null && Object.hasOwnProperty.call(message, "logAnalyticsEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.logAnalyticsEnabled); + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.logging.v2.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {google.logging.v2.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.logging.v2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.logAnalyticsEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.logging.v2.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.logAnalyticsEnabled != null && Object.hasOwnProperty.call(message, "logAnalyticsEnabled")) + if (typeof message.logAnalyticsEnabled !== "boolean") + return "logAnalyticsEnabled: boolean expected"; + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LocationMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LocationMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.LocationMetadata(); + if (object.logAnalyticsEnabled != null) + message.logAnalyticsEnabled = Boolean(object.logAnalyticsEnabled); + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {google.logging.v2.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.logAnalyticsEnabled = false; + if (message.logAnalyticsEnabled != null && Object.hasOwnProperty.call(message, "logAnalyticsEnabled")) + object.logAnalyticsEnabled = message.logAnalyticsEnabled; + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.logging.v2.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.logging.v2.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + v2.MetricsServiceV2 = (function() { + + /** + * Constructs a new MetricsServiceV2 service. + * @memberof google.logging.v2 + * @classdesc Represents a MetricsServiceV2 + * @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 MetricsServiceV2(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MetricsServiceV2.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsServiceV2; + + /** + * 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. + */ + MetricsServiceV2.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * 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 + */ + Object.defineProperty(MetricsServiceV2.prototype.listLogMetrics = function listLogMetrics(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listLogMetrics, $root.google.logging.v2.ListLogMetricsRequest, $root.google.logging.v2.ListLogMetricsResponse, request, callback); + }, "name", { value: "ListLogMetrics" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + Object.defineProperty(MetricsServiceV2.prototype.getLogMetric = function getLogMetric(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getLogMetric, $root.google.logging.v2.GetLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); + }, "name", { value: "GetLogMetric" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + Object.defineProperty(MetricsServiceV2.prototype.createLogMetric = function createLogMetric(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createLogMetric, $root.google.logging.v2.CreateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); + }, "name", { value: "CreateLogMetric" }); + + /** + * 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 + */ + + /** + * 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 + */ + + /** + * 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 + */ + Object.defineProperty(MetricsServiceV2.prototype.updateLogMetric = function updateLogMetric(request, callback) { + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateLogMetric, $root.google.logging.v2.UpdateLogMetricRequest, $root.google.logging.v2.LogMetric, request, callback); + }, "name", { value: "UpdateLogMetric" }); + + /** + * 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, 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.LogMetric = (function() { + + /** + * 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 {string|null} [bucketName] LogMetric bucketName + * @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 LogMetric. + * @memberof google.logging.v2 + * @classdesc Represents a LogMetric. + * @implements ILogMetric + * @constructor + * @param {google.logging.v2.ILogMetric=} [properties] Properties to set + */ + function LogMetric(properties) { + this.labelExtractors = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogMetric name. + * @member {string} name + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.name = ""; + + /** + * LogMetric description. + * @member {string} description + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.description = ""; + + /** + * LogMetric filter. + * @member {string} filter + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.filter = ""; + + /** + * LogMetric bucketName. + * @member {string} bucketName + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.bucketName = ""; + + /** + * LogMetric disabled. + * @member {boolean} disabled + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.disabled = false; + + /** + * LogMetric metricDescriptor. + * @member {google.api.IMetricDescriptor|null|undefined} metricDescriptor + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.metricDescriptor = null; + + /** + * LogMetric valueExtractor. + * @member {string} valueExtractor + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.valueExtractor = ""; + + /** + * LogMetric labelExtractors. + * @member {Object.} labelExtractors + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.labelExtractors = $util.emptyObject; + + /** + * LogMetric bucketOptions. + * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.bucketOptions = null; + + /** + * LogMetric createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.createTime = null; + + /** + * LogMetric updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.updateTime = null; + + /** + * LogMetric version. + * @member {google.logging.v2.LogMetric.ApiVersion} version + * @memberof google.logging.v2.LogMetric + * @instance + */ + LogMetric.prototype.version = 0; + + /** + * Creates a new LogMetric instance using the specified properties. + * @function create + * @memberof google.logging.v2.LogMetric + * @static + * @param {google.logging.v2.ILogMetric=} [properties] Properties to set + * @returns {google.logging.v2.LogMetric} LogMetric instance + */ + LogMetric.create = function create(properties) { + return new LogMetric(properties); + }; + + /** + * Encodes the specified LogMetric message. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. + * @function encode + * @memberof google.logging.v2.LogMetric + * @static + * @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 + */ + LogMetric.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).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(), q + 1).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(), q + 1).ldelim(); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.disabled); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.bucketName); + return writer; + }; + + /** + * Encodes the specified LogMetric message, length delimited. Does not implicitly {@link google.logging.v2.LogMetric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.logging.v2.LogMetric + * @static + * @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 + */ + LogMetric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LogMetric message from the specified reader or buffer. + * @function decode + * @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.LogMetric} LogMetric + * @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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 13: { + message.bucketName = reader.string(); + break; + } + case 12: { + message.disabled = reader.bool(); + break; + } + case 5: { + message.metricDescriptor = $root.google.api.MetricDescriptor.decode(reader, reader.uint32(), undefined, long + 1); + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labelExtractors, key); + message.labelExtractors[key] = value; + break; + } + case 8: { + message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.version = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LogMetric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.logging.v2.LogMetric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + LogMetric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogMetric message. + * @function verify + * @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 + */ + LogMetric.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.metricDescriptor != null && Object.hasOwnProperty.call(message, "metricDescriptor")) { + var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptor, long + 1); + if (error) + return "metricDescriptor." + error; + } + if (message.valueExtractor != null && Object.hasOwnProperty.call(message, "valueExtractor")) + if (!$util.isString(message.valueExtractor)) + return "valueExtractor: string expected"; + if (message.labelExtractors != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "bucketOptions")) { + var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions, long + 1); + if (error) + return "bucketOptions." + error; + } + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); + if (error) + return "updateTime." + error; + } + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a LogMetric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.logging.v2.LogMetric + * @static + * @param {Object.} object Plain object + * @returns {google.logging.v2.LogMetric} LogMetric + */ + LogMetric.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.logging.v2.LogMetric) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.LogMetric: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.metricDescriptor != null) { + if (!$util.isObject(object.metricDescriptor)) + throw TypeError(".google.logging.v2.LogMetric.metricDescriptor: object expected"); + message.metricDescriptor = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptor, long + 1); + } + if (object.valueExtractor != null) + message.valueExtractor = String(object.valueExtractor); + if (object.labelExtractors) { + if (!$util.isObject(object.labelExtractors)) + throw TypeError(".google.logging.v2.LogMetric.labelExtractors: object expected"); + message.labelExtractors = {}; + for (var keys = Object.keys(object.labelExtractors), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labelExtractors, keys[i]); + message.labelExtractors[keys[i]] = String(object.labelExtractors[keys[i]]); + } + } + if (object.bucketOptions != null) { + if (!$util.isObject(object.bucketOptions)) + throw TypeError(".google.logging.v2.LogMetric.bucketOptions: object expected"); + message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions, long + 1); + } + if (object.createTime != null) { + if (!$util.isObject(object.createTime)) + throw TypeError(".google.logging.v2.LogMetric.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); + } + if (object.updateTime != null) { + if (!$util.isObject(object.updateTime)) + throw TypeError(".google.logging.v2.LogMetric.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); + } + switch (object.version) { + default: + if (typeof object.version === "number") { + message.version = object.version; + break; + } + break; + case "V2": + case 0: + message.version = 0; + break; + case "V1": + case 1: + message.version = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a LogMetric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.logging.v2.LogMetric + * @static + * @param {google.logging.v2.LogMetric} message LogMetric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogMetric.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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.disabled = false; + object.bucketName = ""; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + object.version = options.enums === String ? $root.google.logging.v2.LogMetric.ApiVersion[message.version] === undefined ? message.version : $root.google.logging.v2.LogMetric.ApiVersion[message.version] : message.version; + if (message.metricDescriptor != null && Object.hasOwnProperty.call(message, "metricDescriptor")) + object.metricDescriptor = $root.google.api.MetricDescriptor.toObject(message.metricDescriptor, options, q + 1); + if (message.valueExtractor != null && Object.hasOwnProperty.call(message, "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) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labelExtractors, keys2[j]); + object.labelExtractors[keys2[j]] = message.labelExtractors[keys2[j]]; + } + } + if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) + object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options, q + 1); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + object.disabled = message.disabled; + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + object.bucketName = message.bucketName; + return object; + }; + + /** + * Converts this LogMetric to JSON. + * @function toJSON + * @memberof google.logging.v2.LogMetric + * @instance + * @returns {Object.} JSON object + */ + LogMetric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogMetric + * @function getTypeUrl + * @memberof google.logging.v2.LogMetric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogMetric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.LogMetric"; + }; + + /** + * 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; + })(); + + v2.ListLogMetricsRequest = (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 + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogMetricsRequest parent. + * @member {string} parent + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + */ + ListLogMetricsRequest.prototype.parent = ""; + + /** + * ListLogMetricsRequest pageToken. + * @member {string} pageToken + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + */ + ListLogMetricsRequest.prototype.pageToken = ""; + + /** + * ListLogMetricsRequest pageSize. + * @member {number} pageSize + * @memberof google.logging.v2.ListLogMetricsRequest + * @instance + */ + ListLogMetricsRequest.prototype.pageSize = 0; + + /** + * 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 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogMetricsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * 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, long) { + if (object instanceof $root.google.logging.v2.ListLogMetricsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLogMetricsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ListLogMetricsRequest + * @function getTypeUrl + * @memberof google.logging.v2.ListLogMetricsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogMetricsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLogMetricsRequest"; + }; + + return ListLogMetricsRequest; + })(); + + v2.ListLogMetricsResponse = (function() { + + /** + * Properties of a ListLogMetricsResponse. + * @memberof google.logging.v2 + * @interface IListLogMetricsResponse + * @property {Array.|null} [metrics] ListLogMetricsResponse metrics + * @property {string|null} [nextPageToken] ListLogMetricsResponse nextPageToken + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLogMetricsResponse metrics. + * @member {Array.} metrics + * @memberof google.logging.v2.ListLogMetricsResponse + * @instance + */ + ListLogMetricsResponse.prototype.metrics = $util.emptyArray; + + /** + * ListLogMetricsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.logging.v2.ListLogMetricsResponse + * @instance + */ + ListLogMetricsResponse.prototype.nextPageToken = ""; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.ListLogMetricsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metrics != null && Object.hasOwnProperty.call(message, "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], long + 1); + if (error) + return "metrics." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * 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, long) { + if (object instanceof $root.google.logging.v2.ListLogMetricsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.ListLogMetricsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 (!$util.isObject(object.metrics[i])) + throw TypeError(".google.logging.v2.ListLogMetricsResponse.metrics: object expected"); + message.metrics[i] = $root.google.logging.v2.LogMetric.fromObject(object.metrics[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ListLogMetricsResponse + * @function getTypeUrl + * @memberof google.logging.v2.ListLogMetricsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListLogMetricsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.ListLogMetricsResponse"; + }; + + return ListLogMetricsResponse; + })(); + + v2.GetLogMetricRequest = (function() { + + /** + * Properties of a GetLogMetricRequest. + * @memberof google.logging.v2 + * @interface IGetLogMetricRequest + * @property {string|null} [metricName] GetLogMetricRequest metricName + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLogMetricRequest metricName. + * @member {string} metricName + * @memberof google.logging.v2.GetLogMetricRequest + * @instance + */ + GetLogMetricRequest.prototype.metricName = ""; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.GetLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + return null; + }; + + /** + * 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, long) { + if (object instanceof $root.google.logging.v2.GetLogMetricRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.GetLogMetricRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.GetLogMetricRequest(); + if (object.metricName != null) + message.metricName = String(object.metricName); + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + object.metricName = message.metricName; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for GetLogMetricRequest + * @function getTypeUrl + * @memberof google.logging.v2.GetLogMetricRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetLogMetricRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.GetLogMetricRequest"; + }; + + return GetLogMetricRequest; + })(); + + v2.CreateLogMetricRequest = (function() { + + /** + * 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 + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateLogMetricRequest parent. + * @member {string} parent + * @memberof google.logging.v2.CreateLogMetricRequest + * @instance + */ + CreateLogMetricRequest.prototype.parent = ""; + + /** + * CreateLogMetricRequest metric. + * @member {google.logging.v2.ILogMetric|null|undefined} metric + * @memberof google.logging.v2.CreateLogMetricRequest + * @instance + */ + CreateLogMetricRequest.prototype.metric = null; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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 + */ + CreateLogMetricRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.CreateLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + 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 + */ + 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 + */ + CreateLogMetricRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) { + var error = $root.google.logging.v2.LogMetric.verify(message.metric, long + 1); + if (error) + return "metric." + error; + } + return null; + }; + + /** + * 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, long) { + if (object instanceof $root.google.logging.v2.CreateLogMetricRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.CreateLogMetricRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.CreateLogMetricRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.metric != null) { + if (!$util.isObject(object.metric)) + throw TypeError(".google.logging.v2.CreateLogMetricRequest.metric: object expected"); + message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric, long + 1); + } + 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 + */ + CreateLogMetricRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.parent = ""; + object.metric = null; + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + object.parent = message.parent; + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options, q + 1); + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for CreateLogMetricRequest + * @function getTypeUrl + * @memberof google.logging.v2.CreateLogMetricRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateLogMetricRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.CreateLogMetricRequest"; + }; + + return CreateLogMetricRequest; + })(); + + v2.UpdateLogMetricRequest = (function() { + + /** + * 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 + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.UpdateLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + case 2: { + message.metric = $root.google.logging.v2.LogMetric.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + if (!$util.isString(message.metricName)) + return "metricName: string expected"; + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) { + var error = $root.google.logging.v2.LogMetric.verify(message.metric, long + 1); + 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, long) { + if (object instanceof $root.google.logging.v2.UpdateLogMetricRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.UpdateLogMetricRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.logging.v2.UpdateLogMetricRequest(); + if (object.metricName != null) + message.metricName = String(object.metricName); + if (object.metric != null) { + if (!$util.isObject(object.metric)) + throw TypeError(".google.logging.v2.UpdateLogMetricRequest.metric: object expected"); + message.metric = $root.google.logging.v2.LogMetric.fromObject(object.metric, long + 1); + } + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.metricName = ""; + object.metric = null; + } + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + object.metricName = message.metricName; + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + object.metric = $root.google.logging.v2.LogMetric.toObject(message.metric, options, q + 1); + 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); + }; + + /** + * Gets the default type url for UpdateLogMetricRequest + * @function getTypeUrl + * @memberof google.logging.v2.UpdateLogMetricRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateLogMetricRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.UpdateLogMetricRequest"; + }; + + return UpdateLogMetricRequest; + })(); + + v2.DeleteLogMetricRequest = (function() { + + /** + * Properties of a DeleteLogMetricRequest. + * @memberof google.logging.v2 + * @interface IDeleteLogMetricRequest + * @property {string|null} [metricName] DeleteLogMetricRequest metricName + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLogMetricRequest metricName. + * @member {string} metricName + * @memberof google.logging.v2.DeleteLogMetricRequest + * @instance + */ + DeleteLogMetricRequest.prototype.metricName = ""; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.metricName != null && Object.hasOwnProperty.call(message, "metricName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricName); + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.logging.v2.DeleteLogMetricRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metricName = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.metricName != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.logging.v2.DeleteLogMetricRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.logging.v2.DeleteLogMetricRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.metricName = ""; + if (message.metricName != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for DeleteLogMetricRequest + * @function getTypeUrl + * @memberof google.logging.v2.DeleteLogMetricRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteLogMetricRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.logging.v2.DeleteLogMetricRequest"; + }; + + return DeleteLogMetricRequest; + })(); + + return v2; + })(); + + return logging; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + * @property {number} IDENTIFIER=8 IDENTIFIER 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; + values[valuesById[8] = "IDENTIFIER"] = 8; + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MonitoredResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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(), undefined, long + 1)); + break; + } + case 7: { + message.launchStage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.labels != null && Object.hasOwnProperty.call(message, "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], long + 1); + if (error) + return "labels." + error; + } + } + if (message.launchStage != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.MonitoredResourceDescriptor) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MonitoredResourceDescriptor: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 (!$util.isObject(object.labels[i])) + throw TypeError(".google.api.MonitoredResourceDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i], long + 1); + } + } + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + object.displayName = message.displayName; + if (message.description != null && Object.hasOwnProperty.call(message, "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, q + 1); + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $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); + }; + + /** + * Gets the default type url for MonitoredResourceDescriptor + * @function getTypeUrl + * @memberof google.api.MonitoredResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoredResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MonitoredResourceDescriptor"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.labels != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.MonitoredResource) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MonitoredResource: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MonitoredResource(); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.api.MonitoredResource.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) + object.type = ""; + if (message.type != null && Object.hasOwnProperty.call(message, "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) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[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); + }; + + /** + * Gets the default type url for MonitoredResource + * @function getTypeUrl + * @memberof google.api.MonitoredResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoredResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MonitoredResource"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) + $root.google.protobuf.Struct.encode(message.systemLabels, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.systemLabels = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.userLabels, key); + message.userLabels[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) { + var error = $root.google.protobuf.Struct.verify(message.systemLabels, long + 1); + if (error) + return "systemLabels." + error; + } + if (message.userLabels != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.MonitoredResourceMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MonitoredResourceMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MonitoredResourceMetadata(); + if (object.systemLabels != null) { + if (!$util.isObject(object.systemLabels)) + throw TypeError(".google.api.MonitoredResourceMetadata.systemLabels: object expected"); + message.systemLabels = $root.google.protobuf.Struct.fromObject(object.systemLabels, long + 1); + } + if (object.userLabels) { + if (!$util.isObject(object.userLabels)) + throw TypeError(".google.api.MonitoredResourceMetadata.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.userLabels, keys[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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.userLabels = {}; + if (options.defaults) + object.systemLabels = null; + if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) + object.systemLabels = $root.google.protobuf.Struct.toObject(message.systemLabels, options, q + 1); + var keys2; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.userLabels, keys2[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); + }; + + /** + * Gets the default type url for MonitoredResourceMetadata + * @function getTypeUrl + * @memberof google.api.MonitoredResourceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MonitoredResourceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MonitoredResourceMetadata"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.LabelDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.description != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.LabelDescriptor) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.LabelDescriptor: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.LabelDescriptor(); + if (object.key != null) + message.key = String(object.key); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.key = ""; + object.valueType = options.enums === String ? "STRING" : 0; + object.description = ""; + } + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + object.key = message.key; + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + object.valueType = options.enums === String ? $root.google.api.LabelDescriptor.ValueType[message.valueType] === undefined ? message.valueType : $root.google.api.LabelDescriptor.ValueType[message.valueType] : message.valueType; + if (message.description != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for LabelDescriptor + * @function getTypeUrl + * @memberof google.api.LabelDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.LabelDescriptor"; + }; + + /** + * 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && Object.hasOwnProperty.call(message, "style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ResourceDescriptor: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + 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: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "nameField")) + object.nameField = message.nameField; + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + object.plural = message.plural; + if (message.singular != null && Object.hasOwnProperty.call(message, "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]] === undefined ? message.style[j] : $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); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.ResourceReference) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ResourceReference: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.childType != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.rules != null && Object.hasOwnProperty.call(message, "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], long + 1); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.Http) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Http: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 (!$util.isObject(object.rules[i])) + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i], long + 1); + } + } + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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, q + 1); + } + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).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 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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(), undefined, long + 1); + 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(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && Object.hasOwnProperty.call(message, "get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom, long + 1); + if (error) + return "custom." + error; + } + } + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && Object.hasOwnProperty.call(message, "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], long + 1); + if (error) + return "additionalBindings." + error; + } + } + 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, long) { + if (object instanceof $root.google.api.HttpRule) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.HttpRule: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 (!$util.isObject(object.custom)) + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom, long + 1); + } + 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 (!$util.isObject(object.additionalBindings[i])) + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i], long + 1); + } + } + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + object.selector = message.selector; + if (message.get != null && Object.hasOwnProperty.call(message, "get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && Object.hasOwnProperty.call(message, "put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && Object.hasOwnProperty.call(message, "post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = message.body; + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options, q + 1); + 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, q + 1); + } + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CustomHttpPattern: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + object.kind = message.kind; + if (message.path != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * CommonLanguageSettings selectiveGapicGeneration. + * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.selectiveGapicGeneration = null; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + case 3: { + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && Object.hasOwnProperty.call(message, "destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) { + var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration, long + 1); + if (error) + return "selectiveGapicGeneration." + error; + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CommonLanguageSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + if (object.selectiveGapicGeneration != null) { + if (!$util.isObject(object.selectiveGapicGeneration)) + throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); + message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.referenceDocsUri = ""; + object.selectiveGapicGeneration = null; + } + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options, q + 1); + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && Object.hasOwnProperty.call(message, "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.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings, long + 1); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings, long + 1); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings, long + 1); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings, long + 1); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings, long + 1); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings, long + 1); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings, long + 1); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings, long + 1); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ClientLibrarySettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + 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.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (!$util.isObject(object.javaSettings)) + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings, long + 1); + } + if (object.cppSettings != null) { + if (!$util.isObject(object.cppSettings)) + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings, long + 1); + } + if (object.phpSettings != null) { + if (!$util.isObject(object.phpSettings)) + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings, long + 1); + } + if (object.pythonSettings != null) { + if (!$util.isObject(object.pythonSettings)) + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings, long + 1); + } + if (object.nodeSettings != null) { + if (!$util.isObject(object.nodeSettings)) + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings, long + 1); + } + if (object.dotnetSettings != null) { + if (!$util.isObject(object.dotnetSettings)) + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings, long + 1); + } + if (object.rubySettings != null) { + if (!$util.isObject(object.rubySettings)) + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings, long + 1); + } + if (object.goSettings != null) { + if (!$util.isObject(object.goSettings)) + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + object.version = message.version; + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options, q + 1); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options, q + 1); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options, q + 1); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options, q + 1); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options, q + 1); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options, q + 1); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options, q + 1); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options, q + 1); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork(), q + 1).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.methodSettings != null && Object.hasOwnProperty.call(message, "methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i], long + 1); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && Object.hasOwnProperty.call(message, "codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && Object.hasOwnProperty.call(message, "librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i], long + 1); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.Publishing) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Publishing: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (!$util.isObject(object.methodSettings[i])) + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i], long + 1); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (!$util.isObject(object.librarySettings[i])) + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i], long + 1); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options, q + 1); + } + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options, q + 1); + } + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), 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.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.serviceClassNames, key); + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.JavaSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.JavaSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (!$util.isObject(object.serviceClassNames)) + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.serviceClassNames, keys[i]); + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + } + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.serviceClassNames, keys2[j]); + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + } + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.CppSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CppSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PhpSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PhpSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * PythonSettings experimentalFeatures. + * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.experimentalFeatures = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) { + var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures, long + 1); + if (error) + return "experimentalFeatures." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PythonSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PythonSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.experimentalFeatures != null) { + if (!$util.isObject(object.experimentalFeatures)) + throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); + message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.common = null; + object.experimentalFeatures = null; + } + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options, q + 1); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + PythonSettings.ExperimentalFeatures = (function() { + + /** + * Properties of an ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @interface IExperimentalFeatures + * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled + * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled + * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled + */ + + /** + * Constructs a new ExperimentalFeatures. + * @memberof google.api.PythonSettings + * @classdesc Represents an ExperimentalFeatures. + * @implements IExperimentalFeatures + * @constructor + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + */ + function ExperimentalFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExperimentalFeatures restAsyncIoEnabled. + * @member {boolean} restAsyncIoEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.restAsyncIoEnabled = false; + + /** + * ExperimentalFeatures protobufPythonicTypesEnabled. + * @member {boolean} protobufPythonicTypesEnabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; + + /** + * ExperimentalFeatures unversionedPackageDisabled. + * @member {boolean} unversionedPackageDisabled + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + */ + ExperimentalFeatures.prototype.unversionedPackageDisabled = false; + + /** + * Creates a new ExperimentalFeatures instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance + */ + ExperimentalFeatures.create = function create(properties) { + return new ExperimentalFeatures(properties); + }; + + /** + * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); + return writer; + }; + + /** + * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.restAsyncIoEnabled = reader.bool(); + break; + } + case 2: { + message.protobufPythonicTypesEnabled = reader.bool(); + break; + } + case 3: { + message.unversionedPackageDisabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExperimentalFeatures message. + * @function verify + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExperimentalFeatures.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + if (typeof message.restAsyncIoEnabled !== "boolean") + return "restAsyncIoEnabled: boolean expected"; + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + if (typeof message.protobufPythonicTypesEnabled !== "boolean") + return "protobufPythonicTypesEnabled: boolean expected"; + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + if (typeof message.unversionedPackageDisabled !== "boolean") + return "unversionedPackageDisabled: boolean expected"; + return null; + }; + + /** + * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures + */ + ExperimentalFeatures.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PythonSettings.ExperimentalFeatures: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); + if (object.restAsyncIoEnabled != null) + message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); + if (object.protobufPythonicTypesEnabled != null) + message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); + if (object.unversionedPackageDisabled != null) + message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); + return message; + }; + + /** + * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExperimentalFeatures.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.restAsyncIoEnabled = false; + object.protobufPythonicTypesEnabled = false; + object.unversionedPackageDisabled = false; + } + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) + object.restAsyncIoEnabled = message.restAsyncIoEnabled; + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) + object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) + object.unversionedPackageDisabled = message.unversionedPackageDisabled; + return object; + }; + + /** + * Converts this ExperimentalFeatures to JSON. + * @function toJSON + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @instance + * @returns {Object.} JSON object + */ + ExperimentalFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExperimentalFeatures + * @function getTypeUrl + * @memberof google.api.PythonSettings.ExperimentalFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; + }; + + return ExperimentalFeatures; + })(); + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.NodeSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.NodeSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedServices, key); + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedResources, key); + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && Object.hasOwnProperty.call(message, "ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && Object.hasOwnProperty.call(message, "forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && Object.hasOwnProperty.call(message, "handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.DotnetSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.renamedServices) { + if (!$util.isObject(object.renamedServices)) + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedServices, keys[i]); + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + } + if (object.renamedResources) { + if (!$util.isObject(object.renamedResources)) + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedResources, keys[i]); + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedServices, keys2[j]); + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedResources, keys2[j]); + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.RubySettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.RubySettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + * @property {Object.|null} [renamedServices] GoSettings renamedServices + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + this.renamedServices = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * GoSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.renamedServices = $util.emptyObject; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), 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.renamedServices[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.renamedServices, key); + message.renamedServices[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); + if (error) + return "common." + error; + } + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.GoSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.GoSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (!$util.isObject(object.common)) + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); + } + if (object.renamedServices) { + if (!$util.isObject(object.renamedServices)) + throw TypeError(".google.api.GoSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.renamedServices, keys[i]); + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.objects || options.defaults) + object.renamedServices = {}; + if (options.defaults) + object.common = null; + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.renamedServices, keys2[j]); + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + } + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning, long + 1); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && Object.hasOwnProperty.call(message, "autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MethodSettings) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MethodSettings: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (!$util.isObject(object.longRunning)) + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning, long + 1); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + object.selector = message.selector; + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options, q + 1); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay, long + 1); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay, long + 1); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout, long + 1); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MethodSettings.LongRunning: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (!$util.isObject(object.initialPollDelay)) + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay, long + 1); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (!$util.isObject(object.maxPollDelay)) + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay, long + 1); + } + if (object.totalPollTimeout != null) { + if (!$util.isObject(object.totalPollTimeout)) + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options, q + 1); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options, q + 1); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options, q + 1); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + api.SelectiveGapicGeneration = (function() { + + /** + * Properties of a SelectiveGapicGeneration. + * @memberof google.api + * @interface ISelectiveGapicGeneration + * @property {Array.|null} [methods] SelectiveGapicGeneration methods + * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal + */ + + /** + * Constructs a new SelectiveGapicGeneration. + * @memberof google.api + * @classdesc Represents a SelectiveGapicGeneration. + * @implements ISelectiveGapicGeneration + * @constructor + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + */ + function SelectiveGapicGeneration(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectiveGapicGeneration methods. + * @member {Array.} methods + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.methods = $util.emptyArray; + + /** + * SelectiveGapicGeneration generateOmittedAsInternal. + * @member {boolean} generateOmittedAsInternal + * @memberof google.api.SelectiveGapicGeneration + * @instance + */ + SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; + + /** + * Creates a new SelectiveGapicGeneration instance using the specified properties. + * @function create + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance + */ + SelectiveGapicGeneration.create = function create(properties) { + return new SelectiveGapicGeneration(properties); + }; + + /** + * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); + return writer; + }; + + /** + * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. + * @function decode + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 2: { + message.generateOmittedAsInternal = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectiveGapicGeneration message. + * @function verify + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectiveGapicGeneration.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.methods != null && Object.hasOwnProperty.call(message, "methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + if (typeof message.generateOmittedAsInternal !== "boolean") + return "generateOmittedAsInternal: boolean expected"; + return null; + }; + + /** + * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {Object.} object Plain object + * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration + */ + SelectiveGapicGeneration.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.SelectiveGapicGeneration) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.SelectiveGapicGeneration: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.SelectiveGapicGeneration(); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.generateOmittedAsInternal != null) + message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); + return message; + }; + + /** + * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectiveGapicGeneration.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.generateOmittedAsInternal = false; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) + object.generateOmittedAsInternal = message.generateOmittedAsInternal; + return object; + }; + + /** + * Converts this SelectiveGapicGeneration to JSON. + * @function toJSON + * @memberof google.api.SelectiveGapicGeneration + * @instance + * @returns {Object.} JSON object + */ + SelectiveGapicGeneration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectiveGapicGeneration + * @function getTypeUrl + * @memberof google.api.SelectiveGapicGeneration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; + }; + + return SelectiveGapicGeneration; + })(); + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).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(), q + 1).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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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(), undefined, long + 1); + break; + } + case 6: { + message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32(), undefined, long + 1); + 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(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.count != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "mean")) + if (typeof message.mean !== "number") + return "mean: number expected"; + if (message.sumOfSquaredDeviation != null && Object.hasOwnProperty.call(message, "sumOfSquaredDeviation")) + if (typeof message.sumOfSquaredDeviation !== "number") + return "sumOfSquaredDeviation: number expected"; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { + var error = $root.google.api.Distribution.Range.verify(message.range, long + 1); + if (error) + return "range." + error; + } + if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) { + var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions, long + 1); + if (error) + return "bucketOptions." + error; + } + if (message.bucketCounts != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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], long + 1); + 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, long) { + if (object instanceof $root.google.api.Distribution) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Distribution(); + if (object.count != null) + if ($util.Long) + message.count = $util.Long.fromValue(object.count, 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 (!$util.isObject(object.range)) + throw TypeError(".google.api.Distribution.range: object expected"); + message.range = $root.google.api.Distribution.Range.fromObject(object.range, long + 1); + } + if (object.bucketOptions != null) { + if (!$util.isObject(object.bucketOptions)) + throw TypeError(".google.api.Distribution.bucketOptions: object expected"); + message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions, long + 1); + } + 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], 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 (!$util.isObject(object.exemplars[i])) + throw TypeError(".google.api.Distribution.exemplars: object expected"); + message.exemplars[i] = $root.google.api.Distribution.Exemplar.fromObject(object.exemplars[i], long + 1); + } + } + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.count = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.mean = 0; + object.sumOfSquaredDeviation = 0; + object.range = null; + object.bucketOptions = null; + } + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.count = typeof message.count === "number" ? BigInt(message.count) : $util.Long.fromBits(message.count.low >>> 0, message.count.high >>> 0, false).toBigInt(); + else 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 && Object.hasOwnProperty.call(message, "mean")) + object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; + if (message.sumOfSquaredDeviation != null && Object.hasOwnProperty.call(message, "sumOfSquaredDeviation")) + object.sumOfSquaredDeviation = options.json && !isFinite(message.sumOfSquaredDeviation) ? String(message.sumOfSquaredDeviation) : message.sumOfSquaredDeviation; + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + object.range = $root.google.api.Distribution.Range.toObject(message.range, options, q + 1); + if (message.bucketOptions != null && Object.hasOwnProperty.call(message, "bucketOptions")) + object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options, q + 1); + if (message.bucketCounts && message.bucketCounts.length) { + object.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.bucketCounts[j] = typeof message.bucketCounts[j] === "number" ? BigInt(message.bucketCounts[j]) : $util.Long.fromBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0, false).toBigInt(); + else 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, q + 1); + } + 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); + }; + + /** + * Gets the default type url for Distribution + * @function getTypeUrl + * @memberof google.api.Distribution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Distribution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.min = reader.double(); + break; + } + case 2: { + message.max = reader.double(); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.Distribution.Range) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution.Range: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; + } + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for Range + * @function getTypeUrl + * @memberof google.api.Distribution.Range + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Range.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution.Range"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).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(), q + 1).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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.linearBuckets != null && Object.hasOwnProperty.call(message, "linearBuckets")) { + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Linear.verify(message.linearBuckets, long + 1); + if (error) + return "linearBuckets." + error; + } + } + if (message.exponentialBuckets != null && Object.hasOwnProperty.call(message, "exponentialBuckets")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Exponential.verify(message.exponentialBuckets, long + 1); + if (error) + return "exponentialBuckets." + error; + } + } + if (message.explicitBuckets != null && Object.hasOwnProperty.call(message, "explicitBuckets")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Explicit.verify(message.explicitBuckets, long + 1); + 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, long) { + if (object instanceof $root.google.api.Distribution.BucketOptions) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution.BucketOptions: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Distribution.BucketOptions(); + if (object.linearBuckets != null) { + if (!$util.isObject(object.linearBuckets)) + throw TypeError(".google.api.Distribution.BucketOptions.linearBuckets: object expected"); + message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.fromObject(object.linearBuckets, long + 1); + } + if (object.exponentialBuckets != null) { + if (!$util.isObject(object.exponentialBuckets)) + throw TypeError(".google.api.Distribution.BucketOptions.exponentialBuckets: object expected"); + message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.fromObject(object.exponentialBuckets, long + 1); + } + if (object.explicitBuckets != null) { + if (!$util.isObject(object.explicitBuckets)) + throw TypeError(".google.api.Distribution.BucketOptions.explicitBuckets: object expected"); + message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.fromObject(object.explicitBuckets, long + 1); + } + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (message.linearBuckets != null && Object.hasOwnProperty.call(message, "linearBuckets")) { + object.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.toObject(message.linearBuckets, options, q + 1); + if (options.oneofs) + object.options = "linearBuckets"; + } + if (message.exponentialBuckets != null && Object.hasOwnProperty.call(message, "exponentialBuckets")) { + object.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.toObject(message.exponentialBuckets, options, q + 1); + if (options.oneofs) + object.options = "exponentialBuckets"; + } + if (message.explicitBuckets != null && Object.hasOwnProperty.call(message, "explicitBuckets")) { + object.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.toObject(message.explicitBuckets, options, q + 1); + 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); + }; + + /** + * Gets the default type url for BucketOptions + * @function getTypeUrl + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BucketOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution.BucketOptions"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) + if (!$util.isInteger(message.numFiniteBuckets)) + return "numFiniteBuckets: integer expected"; + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.offset != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Linear) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution.BucketOptions.Linear: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.numFiniteBuckets = 0; + object.width = 0; + object.offset = 0; + } + if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) + object.numFiniteBuckets = message.numFiniteBuckets; + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.offset != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for Linear + * @function getTypeUrl + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Linear.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution.BucketOptions.Linear"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) + if (!$util.isInteger(message.numFiniteBuckets)) + return "numFiniteBuckets: integer expected"; + if (message.growthFactor != null && Object.hasOwnProperty.call(message, "growthFactor")) + if (typeof message.growthFactor !== "number") + return "growthFactor: number expected"; + if (message.scale != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Exponential) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution.BucketOptions.Exponential: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.numFiniteBuckets = 0; + object.growthFactor = 0; + object.scale = 0; + } + if (message.numFiniteBuckets != null && Object.hasOwnProperty.call(message, "numFiniteBuckets")) + object.numFiniteBuckets = message.numFiniteBuckets; + if (message.growthFactor != null && Object.hasOwnProperty.call(message, "growthFactor")) + object.growthFactor = options.json && !isFinite(message.growthFactor) ? String(message.growthFactor) : message.growthFactor; + if (message.scale != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for Exponential + * @function getTypeUrl + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exponential.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution.BucketOptions.Exponential"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.bounds != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Explicit) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution.BucketOptions.Explicit: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Explicit + * @function getTypeUrl + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Explicit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution.BucketOptions.Explicit"; + }; + + return Explicit; + })(); + + return BucketOptions; + })(); + + Distribution.Exemplar = (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 + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exemplar value. + * @member {number} value + * @memberof google.api.Distribution.Exemplar + * @instance + */ + Exemplar.prototype.value = 0; + + /** + * Exemplar timestamp. + * @member {google.protobuf.ITimestamp|null|undefined} timestamp + * @memberof google.api.Distribution.Exemplar + * @instance + */ + Exemplar.prototype.timestamp = null; + + /** + * Exemplar attachments. + * @member {Array.} attachments + * @memberof google.api.Distribution.Exemplar + * @instance + */ + Exemplar.prototype.attachments = $util.emptyArray; + + /** + * 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 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).ldelim(); + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Exemplar(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + case 2: { + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + if (!(message.attachments && message.attachments.length)) + message.attachments = []; + message.attachments.push($root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp, long + 1); + if (error) + return "timestamp." + error; + } + if (message.attachments != null && Object.hasOwnProperty.call(message, "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], long + 1); + 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, long) { + if (object instanceof $root.google.api.Distribution.Exemplar) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Distribution.Exemplar: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Distribution.Exemplar(); + if (object.value != null) + message.value = Number(object.value); + if (object.timestamp != null) { + if (!$util.isObject(object.timestamp)) + throw TypeError(".google.api.Distribution.Exemplar.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp, long + 1); + } + 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 (!$util.isObject(object.attachments[i])) + throw TypeError(".google.api.Distribution.Exemplar.attachments: object expected"); + message.attachments[i] = $root.google.protobuf.Any.fromObject(object.attachments[i], long + 1); + } + } + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.attachments = []; + if (options.defaults) { + object.value = 0; + object.timestamp = null; + } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options, q + 1); + 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, q + 1); + } + 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); + }; + + /** + * Gets the default type url for Exemplar + * @function getTypeUrl + * @memberof google.api.Distribution.Exemplar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exemplar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Distribution.Exemplar"; + }; + + return Exemplar; + })(); + + return Distribution; + })(); + + api.MetricDescriptor = (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 + */ + + /** + * Constructs a new MetricDescriptor. + * @memberof google.api + * @classdesc Represents a MetricDescriptor. + * @implements IMetricDescriptor + * @constructor + * @param {google.api.IMetricDescriptor=} [properties] Properties to set + */ + 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricDescriptor name. + * @member {string} name + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.name = ""; + + /** + * MetricDescriptor type. + * @member {string} type + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.type = ""; + + /** + * MetricDescriptor labels. + * @member {Array.} labels + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.labels = $util.emptyArray; + + /** + * MetricDescriptor metricKind. + * @member {google.api.MetricDescriptor.MetricKind} metricKind + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.metricKind = 0; + + /** + * MetricDescriptor valueType. + * @member {google.api.MetricDescriptor.ValueType} valueType + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.valueType = 0; + + /** + * MetricDescriptor unit. + * @member {string} unit + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.unit = ""; + + /** + * MetricDescriptor description. + * @member {string} description + * @memberof google.api.MetricDescriptor + * @instance + */ + MetricDescriptor.prototype.description = ""; + + /** + * 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.MetricDescriptor + * @static + * @param {google.api.IMetricDescriptor=} [properties] Properties to set + * @returns {google.api.MetricDescriptor} MetricDescriptor instance + */ + MetricDescriptor.create = function create(properties) { + return new MetricDescriptor(properties); + }; + + /** + * Encodes the specified MetricDescriptor message. Does not implicitly {@link google.api.MetricDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricDescriptor.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).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. + * @function encodeDelimited + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.IMetricDescriptor} message MetricDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer. + * @function decode + * @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.MetricDescriptor} MetricDescriptor + * @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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MetricDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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(), undefined, long + 1)); + 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(), undefined, long + 1); + 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, long); + break; + } + } + return message; + }; + + /** + * Decodes a MetricDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MetricDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + MetricDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricDescriptor message. + * @function verify + * @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 + */ + MetricDescriptor.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.labels != null && Object.hasOwnProperty.call(message, "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], long + 1); + if (error) + return "labels." + error; + } + } + if (message.metricKind != null && Object.hasOwnProperty.call(message, "metricKind")) + switch (message.metricKind) { + default: + return "metricKind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.valueType != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { + var error = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + if (message.launchStage != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "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 MetricDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MetricDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.MetricDescriptor} MetricDescriptor + */ + MetricDescriptor.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.api.MetricDescriptor) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MetricDescriptor: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 (!$util.isObject(object.labels[i])) + throw TypeError(".google.api.MetricDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i], long + 1); + } + } + switch (object.metricKind) { + default: + if (typeof object.metricKind === "number") { + message.metricKind = object.metricKind; + break; + } + break; + 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) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + 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 (!$util.isObject(object.metadata)) + throw TypeError(".google.api.MetricDescriptor.metadata: object expected"); + message.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.fromObject(object.metadata, long + 1); + } + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + 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. + * @function toObject + * @memberof google.api.MetricDescriptor + * @static + * @param {google.api.MetricDescriptor} message MetricDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricDescriptor.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) { + object.labels = []; + object.monitoredResourceTypes = []; + } + 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 && Object.hasOwnProperty.call(message, "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, q + 1); + } + if (message.metricKind != null && Object.hasOwnProperty.call(message, "metricKind")) + object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] === undefined ? message.metricKind : $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] === undefined ? message.valueType : $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + object.unit = message.unit; + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + object.description = message.description; + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + object.displayName = message.displayName; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(message.metadata, options, q + 1); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $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. + * @function toJSON + * @memberof google.api.MetricDescriptor + * @instance + * @returns {Object.} JSON object + */ + MetricDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricDescriptor + * @function getTypeUrl + * @memberof google.api.MetricDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MetricDescriptor"; + }; + + /** + * 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; + })(); + + 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 + * @property {Array.|null} [timeSeriesResourceHierarchyLevel] MetricDescriptorMetadata timeSeriesResourceHierarchyLevel + */ + + /** + * 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) { + this.timeSeriesResourceHierarchyLevel = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + 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; + + /** + * MetricDescriptorMetadata timeSeriesResourceHierarchyLevel. + * @member {Array.} timeSeriesResourceHierarchyLevel + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @instance + */ + MetricDescriptorMetadata.prototype.timeSeriesResourceHierarchyLevel = $util.emptyArray; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).ldelim(); + if (message.timeSeriesResourceHierarchyLevel != null && message.timeSeriesResourceHierarchyLevel.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.timeSeriesResourceHierarchyLevel.length; ++i) + writer.int32(message.timeSeriesResourceHierarchyLevel[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.launchStage = reader.int32(); + break; + } + case 2: { + message.samplePeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.ingestDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + if (!(message.timeSeriesResourceHierarchyLevel && message.timeSeriesResourceHierarchyLevel.length)) + message.timeSeriesResourceHierarchyLevel = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.timeSeriesResourceHierarchyLevel.push(reader.int32()); + } else + message.timeSeriesResourceHierarchyLevel.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.launchStage != null && Object.hasOwnProperty.call(message, "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 && Object.hasOwnProperty.call(message, "samplePeriod")) { + var error = $root.google.protobuf.Duration.verify(message.samplePeriod, long + 1); + if (error) + return "samplePeriod." + error; + } + if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) { + var error = $root.google.protobuf.Duration.verify(message.ingestDelay, long + 1); + if (error) + return "ingestDelay." + error; + } + if (message.timeSeriesResourceHierarchyLevel != null && Object.hasOwnProperty.call(message, "timeSeriesResourceHierarchyLevel")) { + if (!Array.isArray(message.timeSeriesResourceHierarchyLevel)) + return "timeSeriesResourceHierarchyLevel: array expected"; + for (var i = 0; i < message.timeSeriesResourceHierarchyLevel.length; ++i) + switch (message.timeSeriesResourceHierarchyLevel[i]) { + default: + return "timeSeriesResourceHierarchyLevel: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return 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, long) { + if (object instanceof $root.google.api.MetricDescriptor.MetricDescriptorMetadata) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.MetricDescriptor.MetricDescriptorMetadata(); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + 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 (!$util.isObject(object.samplePeriod)) + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.samplePeriod: object expected"); + message.samplePeriod = $root.google.protobuf.Duration.fromObject(object.samplePeriod, long + 1); + } + if (object.ingestDelay != null) { + if (!$util.isObject(object.ingestDelay)) + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.ingestDelay: object expected"); + message.ingestDelay = $root.google.protobuf.Duration.fromObject(object.ingestDelay, long + 1); + } + if (object.timeSeriesResourceHierarchyLevel) { + if (!Array.isArray(object.timeSeriesResourceHierarchyLevel)) + throw TypeError(".google.api.MetricDescriptor.MetricDescriptorMetadata.timeSeriesResourceHierarchyLevel: array expected"); + message.timeSeriesResourceHierarchyLevel = []; + for (var i = 0; i < object.timeSeriesResourceHierarchyLevel.length; ++i) + switch (object.timeSeriesResourceHierarchyLevel[i]) { + default: + if (typeof object.timeSeriesResourceHierarchyLevel[i] === "number") { + message.timeSeriesResourceHierarchyLevel[i] = object.timeSeriesResourceHierarchyLevel[i]; + break; + } + case "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED": + case 0: + message.timeSeriesResourceHierarchyLevel[i] = 0; + break; + case "PROJECT": + case 1: + message.timeSeriesResourceHierarchyLevel[i] = 1; + break; + case "ORGANIZATION": + case 2: + message.timeSeriesResourceHierarchyLevel[i] = 2; + break; + case "FOLDER": + case 3: + message.timeSeriesResourceHierarchyLevel[i] = 3; + break; + } + } + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.timeSeriesResourceHierarchyLevel = []; + if (options.defaults) { + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.samplePeriod = null; + object.ingestDelay = null; + } + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.samplePeriod != null && Object.hasOwnProperty.call(message, "samplePeriod")) + object.samplePeriod = $root.google.protobuf.Duration.toObject(message.samplePeriod, options, q + 1); + if (message.ingestDelay != null && Object.hasOwnProperty.call(message, "ingestDelay")) + object.ingestDelay = $root.google.protobuf.Duration.toObject(message.ingestDelay, options, q + 1); + if (message.timeSeriesResourceHierarchyLevel && message.timeSeriesResourceHierarchyLevel.length) { + object.timeSeriesResourceHierarchyLevel = []; + for (var j = 0; j < message.timeSeriesResourceHierarchyLevel.length; ++j) + object.timeSeriesResourceHierarchyLevel[j] = options.enums === String ? $root.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[message.timeSeriesResourceHierarchyLevel[j]] === undefined ? message.timeSeriesResourceHierarchyLevel[j] : $root.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel[message.timeSeriesResourceHierarchyLevel[j]] : message.timeSeriesResourceHierarchyLevel[j]; + } + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for MetricDescriptorMetadata + * @function getTypeUrl + * @memberof google.api.MetricDescriptor.MetricDescriptorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricDescriptorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MetricDescriptor.MetricDescriptorMetadata"; + }; + + /** + * TimeSeriesResourceHierarchyLevel enum. + * @name google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + * @enum {number} + * @property {number} TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED=0 TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED value + * @property {number} PROJECT=1 PROJECT value + * @property {number} ORGANIZATION=2 ORGANIZATION value + * @property {number} FOLDER=3 FOLDER value + */ + MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROJECT"] = 1; + values[valuesById[2] = "ORGANIZATION"] = 2; + values[valuesById[3] = "FOLDER"] = 3; + return values; + })(); + + return MetricDescriptorMetadata; + })(); + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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(); + if (tag === error) + break; + 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, long); + break; + } + } + if (key === "__proto__") + $util.makeProp(message.labels, key); + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.labels != null && Object.hasOwnProperty.call(message, "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 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, long) { + if (object instanceof $root.google.api.Metric) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Metric: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.api.Metric(); + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (!$util.isObject(object.labels)) + throw TypeError(".google.api.Metric.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.labels, keys[i]); + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + } + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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) { + if (keys2[j] === "__proto__") + $util.makeProp(object.labels, keys2[j]); + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + } + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = message.type; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.api.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Metric"; + }; + + return Metric; + })(); + + return api; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && Object.hasOwnProperty.call(message, "details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i], long + 1); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.rpc.Status) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.Status: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (!$util.isObject(object.details[i])) + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + object.code = message.code; + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options, q + 1); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * 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); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * 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); + }; + + /** + * 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 + */ + + /** + * 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * 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 + */ + + /** + * 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * 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 + */ + + /** + * 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * 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 + */ + + /** + * 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * 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 + */ + + /** + * 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 $protobuf.rpc.Service.prototype.rpcCall.call(this, waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * 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 + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * 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; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * 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) + }); + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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(), q + 1).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(), q + 1).ldelim(); + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + var properties = {}; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata, long + 1); + if (error) + return "metadata." + error; + } + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error, long + 1); + if (error) + return "error." + error; + } + } + if (message.response != null && Object.hasOwnProperty.call(message, "response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response, long + 1); + 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, long) { + if (object instanceof $root.google.longrunning.Operation) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.Operation: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (!$util.isObject(object.metadata)) + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata, long + 1); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (!$util.isObject(object.error)) + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); + } + if (object.response != null) { + if (!$util.isObject(object.response)) + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response, long + 1); + } + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options, q + 1); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + object.done = message.done; + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && Object.hasOwnProperty.call(message, "response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options, q + 1); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.GetOperationRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * 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 + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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; + }; + + /** + * 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 && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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, long); + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "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, long) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.ListOperationsRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + object.filter = message.filter; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * 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 + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * 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 + */ + ListOperationsResponse.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * 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 + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * 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 + */ + ListOperationsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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 + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * 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 + */ + ListOperationsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.operations != null && Object.hasOwnProperty.call(message, "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], long + 1); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * 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 + */ + ListOperationsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.ListOperationsResponse: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 (!$util.isObject(object.operations[i])) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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, q + 1); + } + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + 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 + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @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.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @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 + */ + CancelOperationRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + 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, long) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.CancelOperationRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "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); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + 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 && keys[i] !== "__proto__") + 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.DeleteOperationRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * 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 && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * 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); + }; + + /** + * 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, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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(), q + 1).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 && writer.len ? writer.fork() : 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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * 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()); + }; + + /** + * 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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * 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 + */ + WaitOperationRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.WaitOperationRequest: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (!$util.isObject(object.timeout)) + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); + } + return message; + }; + + /** + * 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 + */ + WaitOperationRequest.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + object.name = message.name; + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options, q + 1); + return object; + }; + + /** + * 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); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer, q) { + if (!writer) + writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + 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 OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @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.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @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 + */ + OperationInfo.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object, long) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.OperationInfo: object expected"); + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + 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 an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options, q) { + if (!options) + options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-logging-api/protos/protos.json b/packages/google-cloud-logging-api/protos/protos.json new file mode 100644 index 000000000000..cf79e8a61729 --- /dev/null +++ b/packages/google-cloud-logging-api/protos/protos.json @@ -0,0 +1,6082 @@ +{ + "nested": { + "google": { + "nested": { + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ] + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_LEGACY": 900, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "optionDependency": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 11 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "visibility": { + "type": "SymbolVisibility", + "id": 6 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + }, + "reserved": [ + [ + 4, + 4 + ], + "stream" + ] + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + "php_generic_services", + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false, + "deprecated": true + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "featureSupport": { + "type": "FeatureSupport", + "id": 22 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "FeatureSupport": { + "fields": { + "editionIntroduced": { + "type": "Edition", + "id": 1 + }, + "editionDeprecated": { + "type": "Edition", + "id": 2 + }, + "deprecationWarning": { + "type": "string", + "id": 3 + }, + "editionRemoved": { + "type": "Edition", + "id": 4 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "featureSupport": { + "type": "FieldOptions.FeatureSupport", + "id": 4 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_LEGACY", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2023", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + }, + "enforceNamingStyle": { + "type": "EnforceNamingStyle", + "id": 7, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_METHOD", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "STYLE2024" + } + }, + "defaultSymbolVisibility": { + "type": "VisibilityFeature.DefaultSymbolVisibility", + "id": 8, + "options": { + "retention": "RETENTION_SOURCE", + "targets": "TARGET_TYPE_FILE", + "feature_support.edition_introduced": "EDITION_2024", + "edition_defaults.edition": "EDITION_2024", + "edition_defaults.value": "EXPORT_TOP_LEVEL" + } + } + }, + "extensions": [ + [ + 1000, + 9994 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + }, + "reserved": [ + [ + 1, + 1 + ] + ] + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + }, + "EnforceNamingStyle": { + "values": { + "ENFORCE_NAMING_STYLE_UNKNOWN": 0, + "STYLE2024": 1, + "STYLE_LEGACY": 2 + } + }, + "VisibilityFeature": { + "fields": {}, + "reserved": [ + [ + 1, + 536870911 + ] + ], + "nested": { + "DefaultSymbolVisibility": { + "values": { + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4 + } + } + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "overridableFeatures": { + "type": "FeatureSet", + "id": 4 + }, + "fixedFeatures": { + "type": "FeatureSet", + "id": 5 + } + }, + "reserved": [ + [ + 1, + 1 + ], + [ + 2, + 2 + ], + "features" + ] + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "extensions": [ + [ + 536000000, + 536000000 + ] + ], + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "SymbolVisibility": { + "edition": "proto2", + "values": { + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2 + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "logging": { + "nested": { + "type": { + "options": { + "csharp_namespace": "Google.Cloud.Logging.Type", + "go_package": "google.golang.org/genproto/googleapis/logging/type;ltype", + "java_multiple_files": true, + "java_outer_classname": "LogSeverityProto", + "java_package": "com.google.logging.type", + "php_namespace": "Google\\Cloud\\Logging\\Type", + "ruby_package": "Google::Cloud::Logging::Type", + "objc_class_prefix": "GLOG" + }, + "nested": { + "HttpRequest": { + "fields": { + "requestMethod": { + "type": "string", + "id": 1 + }, + "requestUrl": { + "type": "string", + "id": 2 + }, + "requestSize": { + "type": "int64", + "id": 3 + }, + "status": { + "type": "int32", + "id": 4 + }, + "responseSize": { + "type": "int64", + "id": 5 + }, + "userAgent": { + "type": "string", + "id": 6 + }, + "remoteIp": { + "type": "string", + "id": 7 + }, + "serverIp": { + "type": "string", + "id": 13 + }, + "referer": { + "type": "string", + "id": 8 + }, + "latency": { + "type": "google.protobuf.Duration", + "id": 14 + }, + "cacheLookup": { + "type": "bool", + "id": 11 + }, + "cacheHit": { + "type": "bool", + "id": 9 + }, + "cacheValidatedWithOriginServer": { + "type": "bool", + "id": 10 + }, + "cacheFillBytes": { + "type": "int64", + "id": 12 + }, + "protocol": { + "type": "string", + "id": 15 + } + } + }, + "LogSeverity": { + "values": { + "DEFAULT": 0, + "DEBUG": 100, + "INFO": 200, + "NOTICE": 300, + "WARNING": 400, + "ERROR": 500, + "CRITICAL": 600, + "ALERT": 700, + "EMERGENCY": 800 + } + } + } + }, + "v2": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Logging.V2", + "go_package": "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb", + "java_multiple_files": true, + "java_outer_classname": "LoggingMetricsProto", + "java_package": "com.google.logging.v2", + "php_namespace": "Google\\Cloud\\Logging\\V2", + "ruby_package": "Google::Cloud::Logging::V2", + "(google.api.resource_definition).type": "logging.googleapis.com/BillingAccountLocation", + "(google.api.resource_definition).pattern": "billingAccounts/{billing_account}/locations/{location}" + }, + "nested": { + "LogEntry": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/Log", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/logs/{log}", + "(google.api.resource).name_field": "log_name" + }, + "oneofs": { + "payload": { + "oneof": [ + "protoPayload", + "textPayload", + "jsonPayload" + ] + } + }, + "fields": { + "logName": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "google.api.MonitoredResource", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "protoPayload": { + "type": "google.protobuf.Any", + "id": 2 + }, + "textPayload": { + "type": "string", + "id": 3 + }, + "jsonPayload": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "timestamp": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "receiveTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "severity": { + "type": "google.logging.type.LogSeverity", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "insertId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpRequest": { + "type": "google.logging.type.HttpRequest", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "operation": { + "type": "LogEntryOperation", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trace": { + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "spanId": { + "type": "string", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "traceSampled": { + "type": "bool", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sourceLocation": { + "type": "LogEntrySourceLocation", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "split": { + "type": "LogSplit", + "id": 35, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LogEntryOperation": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "producer": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "first": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "last": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LogEntrySourceLocation": { + "fields": { + "file": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "line": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "function": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,https://www.googleapis.com/auth/logging.write" + }, + "methods": { + "DeleteLog": { + "requestType": "DeleteLogRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{log_name=projects/*/logs/*}", + "(google.api.http).additional_bindings.delete": "/v2/{log_name=billingAccounts/*/logs/*}", + "(google.api.method_signature)": "log_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{log_name=projects/*/logs/*}", + "additional_bindings": [ + { + "delete": "/v2/{log_name=*/*/logs/*}" + }, + { + "delete": "/v2/{log_name=organizations/*/logs/*}" + }, + { + "delete": "/v2/{log_name=folders/*/logs/*}" + }, + { + "delete": "/v2/{log_name=billingAccounts/*/logs/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "log_name" + } + ] + }, + "WriteLogEntries": { + "requestType": "WriteLogEntriesRequest", + "responseType": "WriteLogEntriesResponse", + "options": { + "(google.api.http).post": "/v2/entries:write", + "(google.api.http).body": "*", + "(google.api.method_signature)": "log_name,resource,labels,entries" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/entries:write", + "body": "*" + } + }, + { + "(google.api.method_signature)": "log_name,resource,labels,entries" + } + ] + }, + "ListLogEntries": { + "requestType": "ListLogEntriesRequest", + "responseType": "ListLogEntriesResponse", + "options": { + "(google.api.http).post": "/v2/entries:list", + "(google.api.http).body": "*", + "(google.api.method_signature)": "resource_names,filter,order_by" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/entries:list", + "body": "*" + } + }, + { + "(google.api.method_signature)": "resource_names,filter,order_by" + } + ] + }, + "ListMonitoredResourceDescriptors": { + "requestType": "ListMonitoredResourceDescriptorsRequest", + "responseType": "ListMonitoredResourceDescriptorsResponse", + "options": { + "(google.api.http).get": "/v2/monitoredResourceDescriptors" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/monitoredResourceDescriptors" + } + } + ] + }, + "ListLogs": { + "requestType": "ListLogsRequest", + "responseType": "ListLogsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=*/*}/logs", + "(google.api.http).additional_bindings.get": "/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=*/*}/logs", + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*}/logs" + }, + { + "get": "/v2/{parent=organizations/*}/logs" + }, + { + "get": "/v2/{parent=folders/*}/logs" + }, + { + "get": "/v2/{parent=billingAccounts/*}/logs" + }, + { + "get": "/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs" + }, + { + "get": "/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs" + }, + { + "get": "/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs" + }, + { + "get": "/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "TailLogEntries": { + "requestType": "TailLogEntriesRequest", + "requestStream": true, + "responseType": "TailLogEntriesResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v2/entries:tail", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/entries:tail", + "body": "*" + } + } + ] + } + } + }, + "DeleteLogRequest": { + "fields": { + "logName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/Log" + } + } + } + }, + "WriteLogEntriesRequest": { + "fields": { + "logName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "logging.googleapis.com/Log" + } + }, + "resource": { + "type": "google.api.MonitoredResource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entries": { + "rule": "repeated", + "type": "LogEntry", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partialSuccess": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dryRun": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WriteLogEntriesResponse": { + "fields": {} + }, + "WriteLogEntriesPartialErrors": { + "fields": { + "logEntryErrors": { + "keyType": "int32", + "type": "google.rpc.Status", + "id": 1 + } + } + }, + "ListLogEntriesRequest": { + "fields": { + "resourceNames": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/Log" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLogEntriesResponse": { + "fields": { + "entries": { + "rule": "repeated", + "type": "LogEntry", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListMonitoredResourceDescriptorsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMonitoredResourceDescriptorsResponse": { + "fields": { + "resourceDescriptors": { + "rule": "repeated", + "type": "google.api.MonitoredResourceDescriptor", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListLogsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/Log" + } + }, + "resourceNames": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).child_type": "logging.googleapis.com/Log" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLogsResponse": { + "fields": { + "logNames": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TailLogEntriesRequest": { + "fields": { + "resourceNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bufferWindow": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TailLogEntriesResponse": { + "fields": { + "entries": { + "rule": "repeated", + "type": "LogEntry", + "id": 1 + }, + "suppressionInfo": { + "rule": "repeated", + "type": "SuppressionInfo", + "id": 2 + } + }, + "nested": { + "SuppressionInfo": { + "fields": { + "reason": { + "type": "Reason", + "id": 1 + }, + "suppressedCount": { + "type": "int32", + "id": 2 + } + }, + "nested": { + "Reason": { + "values": { + "REASON_UNSPECIFIED": 0, + "RATE_LIMIT": 1, + "NOT_CONSUMED": 2 + } + } + } + } + } + }, + "ConfigServiceV2": { + "options": { + "(google.api.default_host)": "logging.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read" + }, + "methods": { + "ListBuckets": { + "requestType": "ListBucketsRequest", + "responseType": "ListBucketsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=*/*/locations/*}/buckets", + "(google.api.http).additional_bindings.get": "/v2/{parent=billingAccounts/*/locations/*}/buckets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=*/*/locations/*}/buckets", + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*/locations/*}/buckets" + }, + { + "get": "/v2/{parent=organizations/*/locations/*}/buckets" + }, + { + "get": "/v2/{parent=folders/*/locations/*}/buckets" + }, + { + "get": "/v2/{parent=billingAccounts/*/locations/*}/buckets" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBucket": { + "requestType": "GetBucketRequest", + "responseType": "LogBucket", + "options": { + "(google.api.http).get": "/v2/{name=*/*/locations/*/buckets/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=*/*/locations/*/buckets/*}", + "additional_bindings": [ + { + "get": "/v2/{name=projects/*/locations/*/buckets/*}" + }, + { + "get": "/v2/{name=organizations/*/locations/*/buckets/*}" + }, + { + "get": "/v2/{name=folders/*/locations/*/buckets/*}" + }, + { + "get": "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + ] + } + } + ] + }, + "CreateBucketAsync": { + "requestType": "CreateBucketRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=*/*/locations/*}/buckets:createAsync", + "(google.api.http).body": "bucket", + "(google.api.http).additional_bindings.post": "/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync", + "(google.api.http).additional_bindings.body": "bucket", + "(google.longrunning.operation_info).response_type": "LogBucket", + "(google.longrunning.operation_info).metadata_type": "BucketMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=*/*/locations/*}/buckets:createAsync", + "body": "bucket", + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*/locations/*}/buckets:createAsync", + "body": "bucket" + }, + { + "post": "/v2/{parent=organizations/*/locations/*}/buckets:createAsync", + "body": "bucket" + }, + { + "post": "/v2/{parent=folders/*/locations/*}/buckets:createAsync", + "body": "bucket" + }, + { + "post": "/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync", + "body": "bucket" + } + ] + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LogBucket", + "metadata_type": "BucketMetadata" + } + } + ] + }, + "UpdateBucketAsync": { + "requestType": "UpdateBucketRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=*/*/locations/*/buckets/*}:updateAsync", + "(google.api.http).body": "bucket", + "(google.api.http).additional_bindings.post": "/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync", + "(google.api.http).additional_bindings.body": "bucket", + "(google.longrunning.operation_info).response_type": "LogBucket", + "(google.longrunning.operation_info).metadata_type": "BucketMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=*/*/locations/*/buckets/*}:updateAsync", + "body": "bucket", + "additional_bindings": [ + { + "post": "/v2/{name=projects/*/locations/*/buckets/*}:updateAsync", + "body": "bucket" + }, + { + "post": "/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync", + "body": "bucket" + }, + { + "post": "/v2/{name=folders/*/locations/*/buckets/*}:updateAsync", + "body": "bucket" + }, + { + "post": "/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync", + "body": "bucket" + } + ] + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "LogBucket", + "metadata_type": "BucketMetadata" + } + } + ] + }, + "CreateBucket": { + "requestType": "CreateBucketRequest", + "responseType": "LogBucket", + "options": { + "(google.api.http).post": "/v2/{parent=*/*/locations/*}/buckets", + "(google.api.http).body": "bucket", + "(google.api.http).additional_bindings.post": "/v2/{parent=billingAccounts/*/locations/*}/buckets", + "(google.api.http).additional_bindings.body": "bucket" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=*/*/locations/*}/buckets", + "body": "bucket", + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*/locations/*}/buckets", + "body": "bucket" + }, + { + "post": "/v2/{parent=organizations/*/locations/*}/buckets", + "body": "bucket" + }, + { + "post": "/v2/{parent=folders/*/locations/*}/buckets", + "body": "bucket" + }, + { + "post": "/v2/{parent=billingAccounts/*/locations/*}/buckets", + "body": "bucket" + } + ] + } + } + ] + }, + "UpdateBucket": { + "requestType": "UpdateBucketRequest", + "responseType": "LogBucket", + "options": { + "(google.api.http).patch": "/v2/{name=*/*/locations/*/buckets/*}", + "(google.api.http).body": "bucket", + "(google.api.http).additional_bindings.patch": "/v2/{name=billingAccounts/*/locations/*/buckets/*}", + "(google.api.http).additional_bindings.body": "bucket" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=*/*/locations/*/buckets/*}", + "body": "bucket", + "additional_bindings": [ + { + "patch": "/v2/{name=projects/*/locations/*/buckets/*}", + "body": "bucket" + }, + { + "patch": "/v2/{name=organizations/*/locations/*/buckets/*}", + "body": "bucket" + }, + { + "patch": "/v2/{name=folders/*/locations/*/buckets/*}", + "body": "bucket" + }, + { + "patch": "/v2/{name=billingAccounts/*/locations/*/buckets/*}", + "body": "bucket" + } + ] + } + } + ] + }, + "DeleteBucket": { + "requestType": "DeleteBucketRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=*/*/locations/*/buckets/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=*/*/locations/*/buckets/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=projects/*/locations/*/buckets/*}" + }, + { + "delete": "/v2/{name=organizations/*/locations/*/buckets/*}" + }, + { + "delete": "/v2/{name=folders/*/locations/*/buckets/*}" + }, + { + "delete": "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + ] + } + } + ] + }, + "UndeleteBucket": { + "requestType": "UndeleteBucketRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v2/{name=*/*/locations/*/buckets/*}:undelete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=*/*/locations/*/buckets/*}:undelete", + "body": "*", + "additional_bindings": [ + { + "post": "/v2/{name=projects/*/locations/*/buckets/*}:undelete", + "body": "*" + }, + { + "post": "/v2/{name=organizations/*/locations/*/buckets/*}:undelete", + "body": "*" + }, + { + "post": "/v2/{name=folders/*/locations/*/buckets/*}:undelete", + "body": "*" + }, + { + "post": "/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete", + "body": "*" + } + ] + } + } + ] + }, + "ListViews": { + "requestType": "ListViewsRequest", + "responseType": "ListViewsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=*/*/locations/*/buckets/*}/views", + "(google.api.http).additional_bindings.get": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=*/*/locations/*/buckets/*}/views", + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*/locations/*/buckets/*}/views" + }, + { + "get": "/v2/{parent=organizations/*/locations/*/buckets/*}/views" + }, + { + "get": "/v2/{parent=folders/*/locations/*/buckets/*}/views" + }, + { + "get": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetView": { + "requestType": "GetViewRequest", + "responseType": "LogView", + "options": { + "(google.api.http).get": "/v2/{name=*/*/locations/*/buckets/*/views/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=*/*/locations/*/buckets/*/views/*}", + "additional_bindings": [ + { + "get": "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + }, + { + "get": "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + }, + { + "get": "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + }, + { + "get": "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + } + ] + } + } + ] + }, + "CreateView": { + "requestType": "CreateViewRequest", + "responseType": "LogView", + "options": { + "(google.api.http).post": "/v2/{parent=*/*/locations/*/buckets/*}/views", + "(google.api.http).body": "view", + "(google.api.http).additional_bindings.post": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views", + "(google.api.http).additional_bindings.body": "view" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=*/*/locations/*/buckets/*}/views", + "body": "view", + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*/locations/*/buckets/*}/views", + "body": "view" + }, + { + "post": "/v2/{parent=organizations/*/locations/*/buckets/*}/views", + "body": "view" + }, + { + "post": "/v2/{parent=folders/*/locations/*/buckets/*}/views", + "body": "view" + }, + { + "post": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views", + "body": "view" + } + ] + } + } + ] + }, + "UpdateView": { + "requestType": "UpdateViewRequest", + "responseType": "LogView", + "options": { + "(google.api.http).patch": "/v2/{name=*/*/locations/*/buckets/*/views/*}", + "(google.api.http).body": "view", + "(google.api.http).additional_bindings.patch": "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}", + "(google.api.http).additional_bindings.body": "view" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=*/*/locations/*/buckets/*/views/*}", + "body": "view", + "additional_bindings": [ + { + "patch": "/v2/{name=projects/*/locations/*/buckets/*/views/*}", + "body": "view" + }, + { + "patch": "/v2/{name=organizations/*/locations/*/buckets/*/views/*}", + "body": "view" + }, + { + "patch": "/v2/{name=folders/*/locations/*/buckets/*/views/*}", + "body": "view" + }, + { + "patch": "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}", + "body": "view" + } + ] + } + } + ] + }, + "DeleteView": { + "requestType": "DeleteViewRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=*/*/locations/*/buckets/*/views/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=*/*/locations/*/buckets/*/views/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + }, + { + "delete": "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + }, + { + "delete": "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + }, + { + "delete": "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + } + ] + } + } + ] + }, + "ListSinks": { + "requestType": "ListSinksRequest", + "responseType": "ListSinksResponse", + "options": { + "(google.api.http).get": "/v2/{parent=*/*}/sinks", + "(google.api.http).additional_bindings.get": "/v2/{parent=billingAccounts/*}/sinks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=*/*}/sinks", + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*}/sinks" + }, + { + "get": "/v2/{parent=organizations/*}/sinks" + }, + { + "get": "/v2/{parent=folders/*}/sinks" + }, + { + "get": "/v2/{parent=billingAccounts/*}/sinks" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSink": { + "requestType": "GetSinkRequest", + "responseType": "LogSink", + "options": { + "(google.api.http).get": "/v2/{sink_name=*/*/sinks/*}", + "(google.api.http).additional_bindings.get": "/v2/{sink_name=billingAccounts/*/sinks/*}", + "(google.api.method_signature)": "sink_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{sink_name=*/*/sinks/*}", + "additional_bindings": [ + { + "get": "/v2/{sink_name=projects/*/sinks/*}" + }, + { + "get": "/v2/{sink_name=organizations/*/sinks/*}" + }, + { + "get": "/v2/{sink_name=folders/*/sinks/*}" + }, + { + "get": "/v2/{sink_name=billingAccounts/*/sinks/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "sink_name" + } + ] + }, + "CreateSink": { + "requestType": "CreateSinkRequest", + "responseType": "LogSink", + "options": { + "(google.api.http).post": "/v2/{parent=*/*}/sinks", + "(google.api.http).body": "sink", + "(google.api.http).additional_bindings.post": "/v2/{parent=billingAccounts/*}/sinks", + "(google.api.http).additional_bindings.body": "sink", + "(google.api.method_signature)": "parent,sink" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=*/*}/sinks", + "body": "sink", + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*}/sinks", + "body": "sink" + }, + { + "post": "/v2/{parent=organizations/*}/sinks", + "body": "sink" + }, + { + "post": "/v2/{parent=folders/*}/sinks", + "body": "sink" + }, + { + "post": "/v2/{parent=billingAccounts/*}/sinks", + "body": "sink" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,sink" + } + ] + }, + "UpdateSink": { + "requestType": "UpdateSinkRequest", + "responseType": "LogSink", + "options": { + "(google.api.http).put": "/v2/{sink_name=*/*/sinks/*}", + "(google.api.http).body": "sink", + "(google.api.http).additional_bindings.put": "/v2/{sink_name=billingAccounts/*/sinks/*}", + "(google.api.http).additional_bindings.body": "sink", + "(google.api.http).additional_bindings.patch": "/v2/{sink_name=billingAccounts/*/sinks/*}", + "(google.api.method_signature)": "sink_name,sink" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v2/{sink_name=*/*/sinks/*}", + "body": "sink", + "additional_bindings": [ + { + "put": "/v2/{sink_name=projects/*/sinks/*}", + "body": "sink" + }, + { + "put": "/v2/{sink_name=organizations/*/sinks/*}", + "body": "sink" + }, + { + "put": "/v2/{sink_name=folders/*/sinks/*}", + "body": "sink" + }, + { + "put": "/v2/{sink_name=billingAccounts/*/sinks/*}", + "body": "sink" + }, + { + "patch": "/v2/{sink_name=projects/*/sinks/*}", + "body": "sink" + }, + { + "patch": "/v2/{sink_name=organizations/*/sinks/*}", + "body": "sink" + }, + { + "patch": "/v2/{sink_name=folders/*/sinks/*}", + "body": "sink" + }, + { + "patch": "/v2/{sink_name=billingAccounts/*/sinks/*}", + "body": "sink" + } + ] + } + }, + { + "(google.api.method_signature)": "sink_name,sink,update_mask" + }, + { + "(google.api.method_signature)": "sink_name,sink" + } + ] + }, + "DeleteSink": { + "requestType": "DeleteSinkRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{sink_name=*/*/sinks/*}", + "(google.api.http).additional_bindings.delete": "/v2/{sink_name=billingAccounts/*/sinks/*}", + "(google.api.method_signature)": "sink_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{sink_name=*/*/sinks/*}", + "additional_bindings": [ + { + "delete": "/v2/{sink_name=projects/*/sinks/*}" + }, + { + "delete": "/v2/{sink_name=organizations/*/sinks/*}" + }, + { + "delete": "/v2/{sink_name=folders/*/sinks/*}" + }, + { + "delete": "/v2/{sink_name=billingAccounts/*/sinks/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "sink_name" + } + ] + }, + "CreateLink": { + "requestType": "CreateLinkRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=*/*/locations/*/buckets/*}/links", + "(google.api.http).body": "link", + "(google.api.http).additional_bindings.post": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links", + "(google.api.http).additional_bindings.body": "link", + "(google.api.method_signature)": "parent,link,link_id", + "(google.longrunning.operation_info).response_type": "Link", + "(google.longrunning.operation_info).metadata_type": "LinkMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=*/*/locations/*/buckets/*}/links", + "body": "link", + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*/locations/*/buckets/*}/links", + "body": "link" + }, + { + "post": "/v2/{parent=organizations/*/locations/*/buckets/*}/links", + "body": "link" + }, + { + "post": "/v2/{parent=folders/*/locations/*/buckets/*}/links", + "body": "link" + }, + { + "post": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links", + "body": "link" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,link,link_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Link", + "metadata_type": "LinkMetadata" + } + } + ] + }, + "DeleteLink": { + "requestType": "DeleteLinkRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=*/*/locations/*/buckets/*/links/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "LinkMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=*/*/locations/*/buckets/*/links/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + }, + { + "delete": "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + }, + { + "delete": "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + }, + { + "delete": "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "LinkMetadata" + } + } + ] + }, + "ListLinks": { + "requestType": "ListLinksRequest", + "responseType": "ListLinksResponse", + "options": { + "(google.api.http).get": "/v2/{parent=*/*/locations/*/buckets/*}/links", + "(google.api.http).additional_bindings.get": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=*/*/locations/*/buckets/*}/links", + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*/locations/*/buckets/*}/links" + }, + { + "get": "/v2/{parent=organizations/*/locations/*/buckets/*}/links" + }, + { + "get": "/v2/{parent=folders/*/locations/*/buckets/*}/links" + }, + { + "get": "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetLink": { + "requestType": "GetLinkRequest", + "responseType": "Link", + "options": { + "(google.api.http).get": "/v2/{name=*/*/locations/*/buckets/*/links/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=*/*/locations/*/buckets/*/links/*}", + "additional_bindings": [ + { + "get": "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + }, + { + "get": "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + }, + { + "get": "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + }, + { + "get": "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListExclusions": { + "requestType": "ListExclusionsRequest", + "responseType": "ListExclusionsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=*/*}/exclusions", + "(google.api.http).additional_bindings.get": "/v2/{parent=billingAccounts/*}/exclusions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=*/*}/exclusions", + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*}/exclusions" + }, + { + "get": "/v2/{parent=organizations/*}/exclusions" + }, + { + "get": "/v2/{parent=folders/*}/exclusions" + }, + { + "get": "/v2/{parent=billingAccounts/*}/exclusions" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetExclusion": { + "requestType": "GetExclusionRequest", + "responseType": "LogExclusion", + "options": { + "(google.api.http).get": "/v2/{name=*/*/exclusions/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*/exclusions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=*/*/exclusions/*}", + "additional_bindings": [ + { + "get": "/v2/{name=projects/*/exclusions/*}" + }, + { + "get": "/v2/{name=organizations/*/exclusions/*}" + }, + { + "get": "/v2/{name=folders/*/exclusions/*}" + }, + { + "get": "/v2/{name=billingAccounts/*/exclusions/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateExclusion": { + "requestType": "CreateExclusionRequest", + "responseType": "LogExclusion", + "options": { + "(google.api.http).post": "/v2/{parent=*/*}/exclusions", + "(google.api.http).body": "exclusion", + "(google.api.http).additional_bindings.post": "/v2/{parent=billingAccounts/*}/exclusions", + "(google.api.http).additional_bindings.body": "exclusion", + "(google.api.method_signature)": "parent,exclusion" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=*/*}/exclusions", + "body": "exclusion", + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*}/exclusions", + "body": "exclusion" + }, + { + "post": "/v2/{parent=organizations/*}/exclusions", + "body": "exclusion" + }, + { + "post": "/v2/{parent=folders/*}/exclusions", + "body": "exclusion" + }, + { + "post": "/v2/{parent=billingAccounts/*}/exclusions", + "body": "exclusion" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,exclusion" + } + ] + }, + "UpdateExclusion": { + "requestType": "UpdateExclusionRequest", + "responseType": "LogExclusion", + "options": { + "(google.api.http).patch": "/v2/{name=*/*/exclusions/*}", + "(google.api.http).body": "exclusion", + "(google.api.http).additional_bindings.patch": "/v2/{name=billingAccounts/*/exclusions/*}", + "(google.api.http).additional_bindings.body": "exclusion", + "(google.api.method_signature)": "name,exclusion,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=*/*/exclusions/*}", + "body": "exclusion", + "additional_bindings": [ + { + "patch": "/v2/{name=projects/*/exclusions/*}", + "body": "exclusion" + }, + { + "patch": "/v2/{name=organizations/*/exclusions/*}", + "body": "exclusion" + }, + { + "patch": "/v2/{name=folders/*/exclusions/*}", + "body": "exclusion" + }, + { + "patch": "/v2/{name=billingAccounts/*/exclusions/*}", + "body": "exclusion" + } + ] + } + }, + { + "(google.api.method_signature)": "name,exclusion,update_mask" + } + ] + }, + "DeleteExclusion": { + "requestType": "DeleteExclusionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=*/*/exclusions/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=billingAccounts/*/exclusions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=*/*/exclusions/*}", + "additional_bindings": [ + { + "delete": "/v2/{name=projects/*/exclusions/*}" + }, + { + "delete": "/v2/{name=organizations/*/exclusions/*}" + }, + { + "delete": "/v2/{name=folders/*/exclusions/*}" + }, + { + "delete": "/v2/{name=billingAccounts/*/exclusions/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetCmekSettings": { + "requestType": "GetCmekSettingsRequest", + "responseType": "CmekSettings", + "options": { + "(google.api.http).get": "/v2/{name=*/*}/cmekSettings", + "(google.api.http).additional_bindings.get": "/v2/{name=billingAccounts/*}/cmekSettings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=*/*}/cmekSettings", + "additional_bindings": [ + { + "get": "/v2/{name=projects/*}/cmekSettings" + }, + { + "get": "/v2/{name=organizations/*}/cmekSettings" + }, + { + "get": "/v2/{name=folders/*}/cmekSettings" + }, + { + "get": "/v2/{name=billingAccounts/*}/cmekSettings" + } + ] + } + } + ] + }, + "UpdateCmekSettings": { + "requestType": "UpdateCmekSettingsRequest", + "responseType": "CmekSettings", + "options": { + "(google.api.http).patch": "/v2/{name=*/*}/cmekSettings", + "(google.api.http).body": "cmek_settings", + "(google.api.http).additional_bindings.patch": "/v2/{name=organizations/*}/cmekSettings", + "(google.api.http).additional_bindings.body": "cmek_settings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{name=*/*}/cmekSettings", + "body": "cmek_settings", + "additional_bindings": { + "patch": "/v2/{name=organizations/*}/cmekSettings", + "body": "cmek_settings" + } + } + } + ] + }, + "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" + } + } + ] + } + } + }, + "IndexConfig": { + "fields": { + "fieldPath": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "IndexType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "LogBucket": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/LogBucket", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "retentionDays": { + "type": "int32", + "id": 11 + }, + "locked": { + "type": "bool", + "id": 9 + }, + "lifecycleState": { + "type": "LifecycleState", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "analyticsEnabled": { + "type": "bool", + "id": 14 + }, + "restrictedFields": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "indexConfigs": { + "rule": "repeated", + "type": "IndexConfig", + "id": 17 + }, + "cmekSettings": { + "type": "CmekSettings", + "id": 19 + } + } + }, + "LogView": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/LogView", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "filter": { + "type": "string", + "id": 7 + } + } + }, + "LogSink": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/LogSink", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/sinks/{sink}" + }, + "oneofs": { + "options": { + "oneof": [ + "bigqueryOptions" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destination": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "exclusions": { + "rule": "repeated", + "type": "LogExclusion", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputVersionFormat": { + "type": "VersionFormat", + "id": 6, + "options": { + "deprecated": true + } + }, + "writerIdentity": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "includeChildren": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bigqueryOptions": { + "type": "BigQueryOptions", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "VersionFormat": { + "values": { + "VERSION_FORMAT_UNSPECIFIED": 0, + "V2": 1, + "V1": 2 + } + } + } + }, + "BigQueryDataset": { + "fields": { + "datasetId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Link": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/Link", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lifecycleState": { + "type": "LifecycleState", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "bigqueryDataset": { + "type": "BigQueryDataset", + "id": 5 + } + } + }, + "BigQueryOptions": { + "fields": { + "usePartitionedTables": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "usesTimestampColumnPartitioning": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListBucketsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogBucket" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBucketsResponse": { + "fields": { + "buckets": { + "rule": "repeated", + "type": "LogBucket", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateBucketRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogBucket" + } + }, + "bucketId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bucket": { + "type": "LogBucket", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBucketRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogBucket" + } + }, + "bucket": { + "type": "LogBucket", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBucketRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogBucket" + } + } + } + }, + "DeleteBucketRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogBucket" + } + } + } + }, + "UndeleteBucketRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogBucket" + } + } + } + }, + "ListViewsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListViewsResponse": { + "fields": { + "views": { + "rule": "repeated", + "type": "LogView", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateViewRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "viewId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "view": { + "type": "LogView", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "view": { + "type": "LogView", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogView" + } + } + } + }, + "DeleteViewRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogView" + } + } + } + }, + "ListSinksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogSink" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSinksResponse": { + "fields": { + "sinks": { + "rule": "repeated", + "type": "LogSink", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSinkRequest": { + "fields": { + "sinkName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogSink" + } + } + } + }, + "CreateSinkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogSink" + } + }, + "sink": { + "type": "LogSink", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uniqueWriterIdentity": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateSinkRequest": { + "fields": { + "sinkName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogSink" + } + }, + "sink": { + "type": "LogSink", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uniqueWriterIdentity": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSinkRequest": { + "fields": { + "sinkName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogSink" + } + } + } + }, + "CreateLinkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/Link" + } + }, + "link": { + "type": "Link", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "linkId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteLinkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/Link" + } + } + } + }, + "ListLinksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/Link" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLinksResponse": { + "fields": { + "links": { + "rule": "repeated", + "type": "Link", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetLinkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/Link" + } + } + } + }, + "LogExclusion": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/LogExclusion", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/exclusions/{exclusion}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListExclusionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogExclusion" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListExclusionsResponse": { + "fields": { + "exclusions": { + "rule": "repeated", + "type": "LogExclusion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetExclusionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogExclusion" + } + } + } + }, + "CreateExclusionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogExclusion" + } + }, + "exclusion": { + "type": "LogExclusion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateExclusionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogExclusion" + } + }, + "exclusion": { + "type": "LogExclusion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExclusionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogExclusion" + } + } + } + }, + "GetCmekSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/CmekSettings" + } + } + } + }, + "UpdateCmekSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cmekSettings": { + "type": "CmekSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CmekSettings": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/CmekSettings", + "(google.api.resource).pattern": "billingAccounts/{billing_account}/cmekSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2 + }, + "kmsKeyVersionName": { + "type": "string", + "id": 4 + }, + "serviceAccountId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "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" + } + }, + "kmsKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsServiceAccountId": { + "type": "string", + "id": 3, + "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 + } + } + }, + "BucketMetadata": { + "oneofs": { + "request": { + "oneof": [ + "createBucketRequest", + "updateBucketRequest" + ] + } + }, + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "state": { + "type": "OperationState", + "id": 3 + }, + "createBucketRequest": { + "type": "CreateBucketRequest", + "id": 4 + }, + "updateBucketRequest": { + "type": "UpdateBucketRequest", + "id": 5 + } + } + }, + "LinkMetadata": { + "oneofs": { + "request": { + "oneof": [ + "createLinkRequest", + "deleteLinkRequest" + ] + } + }, + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "state": { + "type": "OperationState", + "id": 3 + }, + "createLinkRequest": { + "type": "CreateLinkRequest", + "id": 4 + }, + "deleteLinkRequest": { + "type": "DeleteLinkRequest", + "id": 5 + } + } + }, + "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 + } + }, + "LifecycleState": { + "values": { + "LIFECYCLE_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DELETE_REQUESTED": 2, + "UPDATING": 3, + "CREATING": 4, + "FAILED": 5 + } + }, + "IndexType": { + "values": { + "INDEX_TYPE_UNSPECIFIED": 0, + "INDEX_TYPE_STRING": 1, + "INDEX_TYPE_INTEGER": 2 + } + }, + "LocationMetadata": { + "fields": { + "logAnalyticsEnabled": { + "type": "bool", + "id": 1 + } + } + }, + "MetricsServiceV2": { + "options": { + "(google.api.default_host)": "logging.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,https://www.googleapis.com/auth/logging.write" + }, + "methods": { + "ListLogMetrics": { + "requestType": "ListLogMetricsRequest", + "responseType": "ListLogMetricsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/metrics", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/metrics" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetLogMetric": { + "requestType": "GetLogMetricRequest", + "responseType": "LogMetric", + "options": { + "(google.api.http).get": "/v2/{metric_name=projects/*/metrics/*}", + "(google.api.method_signature)": "metric_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{metric_name=projects/*/metrics/*}" + } + }, + { + "(google.api.method_signature)": "metric_name" + } + ] + }, + "CreateLogMetric": { + "requestType": "CreateLogMetricRequest", + "responseType": "LogMetric", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/metrics", + "(google.api.http).body": "metric", + "(google.api.method_signature)": "parent,metric" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/metrics", + "body": "metric" + } + }, + { + "(google.api.method_signature)": "parent,metric" + } + ] + }, + "UpdateLogMetric": { + "requestType": "UpdateLogMetricRequest", + "responseType": "LogMetric", + "options": { + "(google.api.http).put": "/v2/{metric_name=projects/*/metrics/*}", + "(google.api.http).body": "metric", + "(google.api.method_signature)": "metric_name,metric" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v2/{metric_name=projects/*/metrics/*}", + "body": "metric" + } + }, + { + "(google.api.method_signature)": "metric_name,metric" + } + ] + }, + "DeleteLogMetric": { + "requestType": "DeleteLogMetricRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{metric_name=projects/*/metrics/*}", + "(google.api.method_signature)": "metric_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{metric_name=projects/*/metrics/*}" + } + }, + { + "(google.api.method_signature)": "metric_name" + } + ] + } + } + }, + "LogMetric": { + "options": { + "(google.api.resource).type": "logging.googleapis.com/LogMetric", + "(google.api.resource).pattern": "projects/{project}/metrics/{metric}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "bucketName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "disabled": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metricDescriptor": { + "type": "google.api.MetricDescriptor", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "valueExtractor": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labelExtractors": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bucketOptions": { + "type": "google.api.Distribution.BucketOptions", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "version": { + "type": "ApiVersion", + "id": 4, + "options": { + "deprecated": true + } + } + }, + "nested": { + "ApiVersion": { + "values": { + "V2": 0, + "V1": 1 + } + } + } + }, + "ListLogMetricsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListLogMetricsResponse": { + "fields": { + "metrics": { + "rule": "repeated", + "type": "LogMetric", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetLogMetricRequest": { + "fields": { + "metricName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogMetric" + } + } + } + }, + "CreateLogMetricRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "logging.googleapis.com/LogMetric" + } + }, + "metric": { + "type": "LogMetric", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateLogMetricRequest": { + "fields": { + "metricName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogMetric" + } + }, + "metric": { + "type": "LogMetric", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteLogMetricRequest": { + "fields": { + "metricName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "logging.googleapis.com/LogMetric" + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/metric;metric", + "java_multiple_files": true, + "java_outer_classname": "MetricProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "MonitoredResourceDescriptor": { + "fields": { + "name": { + "type": "string", + "id": 5 + }, + "type": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "labels": { + "rule": "repeated", + "type": "LabelDescriptor", + "id": 4 + }, + "launchStage": { + "type": "LaunchStage", + "id": 7 + } + } + }, + "MonitoredResource": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MonitoredResourceMetadata": { + "fields": { + "systemLabels": { + "type": "google.protobuf.Struct", + "id": 1 + }, + "userLabels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "LabelDescriptor": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "valueType": { + "type": "ValueType", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ValueType": { + "values": { + "STRING": 0, + "BOOL": 1, + "INT64": 2 + } + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + }, + "selectiveGapicGeneration": { + "type": "SelectiveGapicGeneration", + "id": 3 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "experimentalFeatures": { + "type": "ExperimentalFeatures", + "id": 2 + } + }, + "nested": { + "ExperimentalFeatures": { + "fields": { + "restAsyncIoEnabled": { + "type": "bool", + "id": 1 + }, + "protobufPythonicTypesEnabled": { + "type": "bool", + "id": 2 + }, + "unversionedPackageDisabled": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "SelectiveGapicGeneration": { + "fields": { + "methods": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "generateOmittedAsInternal": { + "type": "bool", + "id": 2 + } + } + }, + "Distribution": { + "fields": { + "count": { + "type": "int64", + "id": 1 + }, + "mean": { + "type": "double", + "id": 2 + }, + "sumOfSquaredDeviation": { + "type": "double", + "id": 3 + }, + "range": { + "type": "Range", + "id": 4 + }, + "bucketOptions": { + "type": "BucketOptions", + "id": 6 + }, + "bucketCounts": { + "rule": "repeated", + "type": "int64", + "id": 7 + }, + "exemplars": { + "rule": "repeated", + "type": "Exemplar", + "id": 10 + } + }, + "nested": { + "Range": { + "fields": { + "min": { + "type": "double", + "id": 1 + }, + "max": { + "type": "double", + "id": 2 + } + } + }, + "BucketOptions": { + "oneofs": { + "options": { + "oneof": [ + "linearBuckets", + "exponentialBuckets", + "explicitBuckets" + ] + } + }, + "fields": { + "linearBuckets": { + "type": "Linear", + "id": 1 + }, + "exponentialBuckets": { + "type": "Exponential", + "id": 2 + }, + "explicitBuckets": { + "type": "Explicit", + "id": 3 + } + }, + "nested": { + "Linear": { + "fields": { + "numFiniteBuckets": { + "type": "int32", + "id": 1 + }, + "width": { + "type": "double", + "id": 2 + }, + "offset": { + "type": "double", + "id": 3 + } + } + }, + "Exponential": { + "fields": { + "numFiniteBuckets": { + "type": "int32", + "id": 1 + }, + "growthFactor": { + "type": "double", + "id": 2 + }, + "scale": { + "type": "double", + "id": 3 + } + } + }, + "Explicit": { + "fields": { + "bounds": { + "rule": "repeated", + "type": "double", + "id": 1 + } + } + } + } + }, + "Exemplar": { + "fields": { + "value": { + "type": "double", + "id": 1 + }, + "timestamp": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "attachments": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "MetricDescriptor": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 8 + }, + "labels": { + "rule": "repeated", + "type": "LabelDescriptor", + "id": 2 + }, + "metricKind": { + "type": "MetricKind", + "id": 3 + }, + "valueType": { + "type": "ValueType", + "id": 4 + }, + "unit": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 7 + }, + "metadata": { + "type": "MetricDescriptorMetadata", + "id": 10 + }, + "launchStage": { + "type": "LaunchStage", + "id": 12 + }, + "monitoredResourceTypes": { + "rule": "repeated", + "type": "string", + "id": 13 + } + }, + "nested": { + "MetricKind": { + "values": { + "METRIC_KIND_UNSPECIFIED": 0, + "GAUGE": 1, + "DELTA": 2, + "CUMULATIVE": 3 + } + }, + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "BOOL": 1, + "INT64": 2, + "DOUBLE": 3, + "STRING": 4, + "DISTRIBUTION": 5, + "MONEY": 6 + } + }, + "MetricDescriptorMetadata": { + "fields": { + "launchStage": { + "type": "LaunchStage", + "id": 1, + "options": { + "deprecated": true + } + }, + "samplePeriod": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "ingestDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "timeSeriesResourceHierarchyLevel": { + "rule": "repeated", + "type": "TimeSeriesResourceHierarchyLevel", + "id": 4 + } + }, + "nested": { + "TimeSeriesResourceHierarchyLevel": { + "values": { + "TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED": 0, + "PROJECT": 1, + "ORGANIZATION": 2, + "FOLDER": 3 + } + } + } + } + } + }, + "Metric": { + "fields": { + "type": { + "type": "string", + "id": 3 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "objc_class_prefix": "GLRUN", + "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 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.copy_log_entries.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.copy_log_entries.js new file mode 100644 index 000000000000..18ca55a72acc --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.copy_log_entries.js @@ -0,0 +1,74 @@ +// Copyright 2026 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-api').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/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_bucket.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_bucket.js new file mode 100644 index 000000000000..9625a9c8efe8 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_bucket.js @@ -0,0 +1,78 @@ +// Copyright 2026 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(parent, bucketId, bucket) { + // [START logging_v2_generated_ConfigServiceV2_CreateBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource in which to create the log bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * 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. + */ + // const bucketId = 'abc123' + /** + * 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 ignored. + */ + // const bucket = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCreateBucket() { + // Construct request + const request = { + parent, + bucketId, + bucket, + }; + + // Run request + const response = await loggingClient.createBucket(request); + console.log(response); + } + + callCreateBucket(); + // [END logging_v2_generated_ConfigServiceV2_CreateBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_bucket_async.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_bucket_async.js new file mode 100644 index 000000000000..4e9f0218f3a3 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_bucket_async.js @@ -0,0 +1,79 @@ +// Copyright 2026 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(parent, bucketId, bucket) { + // [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource in which to create the log bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * 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. + */ + // const bucketId = 'abc123' + /** + * 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 ignored. + */ + // const bucket = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCreateBucketAsync() { + // Construct request + const request = { + parent, + bucketId, + bucket, + }; + + // Run request + const [operation] = await loggingClient.createBucketAsync(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBucketAsync(); + // [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_exclusion.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_exclusion.js new file mode 100644 index 000000000000..37433ecb6c46 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_exclusion.js @@ -0,0 +1,74 @@ +// Copyright 2026 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(parent, exclusion) { + // [START logging_v2_generated_ConfigServiceV2_CreateExclusion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource in which to create the exclusion: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-logging-project"` + * `"organizations/123456789"` + */ + // const parent = 'abc123' + /** + * Required. The new exclusion, whose `name` parameter is an exclusion name + * that is not already used in the parent resource. + */ + // const exclusion = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCreateExclusion() { + // Construct request + const request = { + parent, + exclusion, + }; + + // Run request + const response = await loggingClient.createExclusion(request); + console.log(response); + } + + callCreateExclusion(); + // [END logging_v2_generated_ConfigServiceV2_CreateExclusion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_link.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_link.js new file mode 100644 index 000000000000..ed7892c322d2 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_link.js @@ -0,0 +1,78 @@ +// Copyright 2026 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(parent, link, linkId) { + // [START logging_v2_generated_ConfigServiceV2_CreateLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the bucket to create a link for. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + */ + // const parent = 'abc123' + /** + * Required. The new link. + */ + // const link = {} + /** + * Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + */ + // const linkId = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCreateLink() { + // Construct request + const request = { + parent, + link, + linkId, + }; + + // Run request + const [operation] = await loggingClient.createLink(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateLink(); + // [END logging_v2_generated_ConfigServiceV2_CreateLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_sink.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_sink.js new file mode 100644 index 000000000000..0b5581381dee --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_sink.js @@ -0,0 +1,88 @@ +// Copyright 2026 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(parent, sink) { + // [START logging_v2_generated_ConfigServiceV2_CreateSink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource in which to create the sink: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * For examples: + * `"projects/my-project"` + * `"organizations/123456789"` + */ + // const parent = 'abc123' + /** + * Required. The new sink, whose `name` parameter is a sink identifier that + * is not already in use. + */ + // const 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 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 + * more information, see `writer_identity` in + * LogSink google.logging.v2.LogSink. + */ + // const uniqueWriterIdentity = true + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCreateSink() { + // Construct request + const request = { + parent, + sink, + }; + + // Run request + const response = await loggingClient.createSink(request); + console.log(response); + } + + callCreateSink(); + // [END logging_v2_generated_ConfigServiceV2_CreateSink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_view.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_view.js new file mode 100644 index 000000000000..2ce267d3bd71 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.create_view.js @@ -0,0 +1,76 @@ +// Copyright 2026 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(parent, viewId, view) { + // [START logging_v2_generated_ConfigServiceV2_CreateView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The bucket in which to create the view + * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + */ + // const parent = 'abc123' + /** + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + */ + // const viewId = 'abc123' + /** + * Required. The new view. + */ + // const view = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callCreateView() { + // Construct request + const request = { + parent, + viewId, + view, + }; + + // Run request + const response = await loggingClient.createView(request); + console.log(response); + } + + callCreateView(); + // [END logging_v2_generated_ConfigServiceV2_CreateView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_bucket.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_bucket.js new file mode 100644 index 000000000000..67c65c7b9b66 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_bucket.js @@ -0,0 +1,67 @@ +// Copyright 2026 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_DeleteBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the bucket to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callDeleteBucket() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.deleteBucket(request); + console.log(response); + } + + callDeleteBucket(); + // [END logging_v2_generated_ConfigServiceV2_DeleteBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_exclusion.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_exclusion.js new file mode 100644 index 000000000000..39f4ca830080 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_exclusion.js @@ -0,0 +1,67 @@ +// Copyright 2026 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_DeleteExclusion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of an existing exclusion to delete: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callDeleteExclusion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.deleteExclusion(request); + console.log(response); + } + + callDeleteExclusion(); + // [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_link.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_link.js new file mode 100644 index 000000000000..c1ccfaa24267 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_link.js @@ -0,0 +1,66 @@ +// Copyright 2026 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_DeleteLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the link to delete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callDeleteLink() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await loggingClient.deleteLink(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteLink(); + // [END logging_v2_generated_ConfigServiceV2_DeleteLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_sink.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_sink.js new file mode 100644 index 000000000000..c52f90b434d1 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_sink.js @@ -0,0 +1,68 @@ +// Copyright 2026 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(sinkName) { + // [START logging_v2_generated_ConfigServiceV2_DeleteSink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + */ + // const sinkName = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callDeleteSink() { + // Construct request + const request = { + sinkName, + }; + + // Run request + const response = await loggingClient.deleteSink(request); + console.log(response); + } + + callDeleteSink(); + // [END logging_v2_generated_ConfigServiceV2_DeleteSink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_view.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_view.js new file mode 100644 index 000000000000..93a64e48998b --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.delete_view.js @@ -0,0 +1,64 @@ +// Copyright 2026 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_DeleteView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the view to delete: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callDeleteView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.deleteView(request); + console.log(response); + } + + callDeleteView(); + // [END logging_v2_generated_ConfigServiceV2_DeleteView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_bucket.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_bucket.js new file mode 100644 index 000000000000..7d6b4fc9e71c --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_bucket.js @@ -0,0 +1,67 @@ +// Copyright 2026 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_GetBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the bucket: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetBucket() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.getBucket(request); + console.log(response); + } + + callGetBucket(); + // [END logging_v2_generated_ConfigServiceV2_GetBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_cmek_settings.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_cmek_settings.js new file mode 100644 index 000000000000..93fb33db7642 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_cmek_settings.js @@ -0,0 +1,71 @@ +// Copyright 2026 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_GetCmekSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource for which to retrieve CMEK settings. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * 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' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetCmekSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.getCmekSettings(request); + console.log(response); + } + + callGetCmekSettings(); + // [END logging_v2_generated_ConfigServiceV2_GetCmekSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_exclusion.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_exclusion.js new file mode 100644 index 000000000000..473c624f0982 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_exclusion.js @@ -0,0 +1,67 @@ +// Copyright 2026 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_GetExclusion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of an existing exclusion: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetExclusion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.getExclusion(request); + console.log(response); + } + + callGetExclusion(); + // [END logging_v2_generated_ConfigServiceV2_GetExclusion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_link.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_link.js new file mode 100644 index 000000000000..c0bba6add2f9 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_link.js @@ -0,0 +1,65 @@ +// Copyright 2026 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_GetLink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the link: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetLink() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.getLink(request); + console.log(response); + } + + callGetLink(); + // [END logging_v2_generated_ConfigServiceV2_GetLink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_settings.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_settings.js new file mode 100644 index 000000000000..198004c92186 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_settings.js @@ -0,0 +1,71 @@ +// Copyright 2026 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-api').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/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_sink.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_sink.js new file mode 100644 index 000000000000..077b86a9ace3 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_sink.js @@ -0,0 +1,67 @@ +// Copyright 2026 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(sinkName) { + // [START logging_v2_generated_ConfigServiceV2_GetSink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the sink: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + */ + // const sinkName = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetSink() { + // Construct request + const request = { + sinkName, + }; + + // Run request + const response = await loggingClient.getSink(request); + console.log(response); + } + + callGetSink(); + // [END logging_v2_generated_ConfigServiceV2_GetSink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_view.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_view.js new file mode 100644 index 000000000000..ef713152c620 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.get_view.js @@ -0,0 +1,64 @@ +// Copyright 2026 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_GetView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the policy: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callGetView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.getView(request); + console.log(response); + } + + callGetView(); + // [END logging_v2_generated_ConfigServiceV2_GetView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_buckets.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_buckets.js new file mode 100644 index 000000000000..c649d59b38ae --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_buckets.js @@ -0,0 +1,83 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_ConfigServiceV2_ListBuckets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource whose buckets are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * Note: The locations portion of the resource must be specified, but + * supplying the character `-` in place of LOCATION_ID will return all + * buckets. + */ + // 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. + */ + // 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. + */ + // const pageSize = 1234 + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callListBuckets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listBucketsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBuckets(); + // [END logging_v2_generated_ConfigServiceV2_ListBuckets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_exclusions.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_exclusions.js new file mode 100644 index 000000000000..729900cb7905 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_exclusions.js @@ -0,0 +1,80 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_ConfigServiceV2_ListExclusions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource whose exclusions are to be listed. + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + */ + // 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. + */ + // 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. + */ + // const pageSize = 1234 + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callListExclusions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listExclusionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListExclusions(); + // [END logging_v2_generated_ConfigServiceV2_ListExclusions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_links.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_links.js new file mode 100644 index 000000000000..2877b5f84f71 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_links.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_ConfigServiceV2_ListLinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource whose links are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "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]/ + */ + // 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. + */ + // const pageToken = 'abc123' + /** + * Optional. The maximum number of results to return from this request. + */ + // const pageSize = 1234 + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callListLinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listLinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLinks(); + // [END logging_v2_generated_ConfigServiceV2_ListLinks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_sinks.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_sinks.js new file mode 100644 index 000000000000..de046ee4b2bf --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_sinks.js @@ -0,0 +1,80 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_ConfigServiceV2_ListSinks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource whose sinks are to be listed: + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + */ + // 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. + */ + // 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. + */ + // const pageSize = 1234 + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callListSinks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listSinksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSinks(); + // [END logging_v2_generated_ConfigServiceV2_ListSinks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_views.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_views.js new file mode 100644 index 000000000000..54b2ed6c1c5d --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.list_views.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_ConfigServiceV2_ListViews_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The bucket whose views are to be listed: + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + */ + // 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. + */ + // 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. + */ + // const pageSize = 1234 + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callListViews() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listViewsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListViews(); + // [END logging_v2_generated_ConfigServiceV2_ListViews_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.undelete_bucket.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.undelete_bucket.js new file mode 100644 index 000000000000..f6a623cf61a2 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.undelete_bucket.js @@ -0,0 +1,67 @@ +// Copyright 2026 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_UndeleteBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the bucket to undelete. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + */ + // const name = 'abc123' + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUndeleteBucket() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await loggingClient.undeleteBucket(request); + console.log(response); + } + + callUndeleteBucket(); + // [END logging_v2_generated_ConfigServiceV2_UndeleteBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_bucket.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_bucket.js new file mode 100644 index 000000000000..30b9c4b0daa7 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_bucket.js @@ -0,0 +1,82 @@ +// Copyright 2026 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, bucket, updateMask) { + // [START logging_v2_generated_ConfigServiceV2_UpdateBucket_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the bucket to update. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + */ + // const name = 'abc123' + /** + * Required. The updated bucket. + */ + // 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: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=retention_days` + */ + // const updateMask = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateBucket() { + // Construct request + const request = { + name, + bucket, + updateMask, + }; + + // Run request + const response = await loggingClient.updateBucket(request); + console.log(response); + } + + callUpdateBucket(); + // [END logging_v2_generated_ConfigServiceV2_UpdateBucket_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_bucket_async.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_bucket_async.js new file mode 100644 index 000000000000..581ae1ab7a92 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_bucket_async.js @@ -0,0 +1,83 @@ +// Copyright 2026 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, bucket, updateMask) { + // [START logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the bucket to update. + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket"` + */ + // const name = 'abc123' + /** + * Required. The updated bucket. + */ + // 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: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * For example: `updateMask=retention_days` + */ + // const updateMask = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateBucketAsync() { + // Construct request + const request = { + name, + bucket, + updateMask, + }; + + // Run request + const [operation] = await loggingClient.updateBucketAsync(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBucketAsync(); + // [END logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_cmek_settings.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_cmek_settings.js new file mode 100644 index 000000000000..9215495927ee --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_cmek_settings.js @@ -0,0 +1,86 @@ +// Copyright 2026 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, cmekSettings) { + // [START logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for the CMEK settings to update. + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * 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 Log + * Router (https://cloud.google.com/logging/docs/routing/managed-encryption) + * for more information. + */ + // const cmekSettings = {} + /** + * Optional. Field mask identifying which fields from `cmek_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-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateCmekSettings() { + // Construct request + const request = { + name, + cmekSettings, + }; + + // Run request + const response = await loggingClient.updateCmekSettings(request); + console.log(response); + } + + callUpdateCmekSettings(); + // [END logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_exclusion.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_exclusion.js new file mode 100644 index 000000000000..f5689f24e695 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_exclusion.js @@ -0,0 +1,84 @@ +// Copyright 2026 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, exclusion, updateMask) { + // [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the exclusion to update: + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + * For example: + * `"projects/my-project/exclusions/my-exclusion"` + */ + // const name = 'abc123' + /** + * Required. New values for the existing exclusion. Only the fields specified + * in `update_mask` are relevant. + */ + // const exclusion = {} + /** + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * LogExclusion google.logging.v2.LogExclusion included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + */ + // const updateMask = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateExclusion() { + // Construct request + const request = { + name, + exclusion, + updateMask, + }; + + // Run request + const response = await loggingClient.updateExclusion(request); + console.log(response); + } + + callUpdateExclusion(); + // [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_settings.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_settings.js new file mode 100644 index 000000000000..4ccf72e92fca --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_settings.js @@ -0,0 +1,83 @@ +// Copyright 2026 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] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * 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-api').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/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_sink.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_sink.js new file mode 100644 index 000000000000..1c04f1da9f34 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_sink.js @@ -0,0 +1,101 @@ +// Copyright 2026 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(sinkName, sink) { + // [START logging_v2_generated_ConfigServiceV2_UpdateSink_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * For example: + * `"projects/my-project/sinks/my-sink"` + */ + // const sinkName = 'abc123' + /** + * Required. The updated sink, whose name is the same identifier that appears + * as part of `sink_name`. + */ + // const sink = {} + /** + * Optional. See sinks.create google.logging.v2.ConfigServiceV2.CreateSink + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + */ + // const uniqueWriterIdentity = true + /** + * 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 + * for backwards compatibility purposes: + * `destination,filter,includeChildren` + * At some point in the future, behavior will be removed and specifying an + * 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 + * For example: `updateMask=filter` + */ + // const updateMask = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateSink() { + // Construct request + const request = { + sinkName, + sink, + }; + + // Run request + const response = await loggingClient.updateSink(request); + console.log(response); + } + + callUpdateSink(); + // [END logging_v2_generated_ConfigServiceV2_UpdateSink_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_view.js b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_view.js new file mode 100644 index 000000000000..c218ef0eee59 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/config_service_v2.update_view.js @@ -0,0 +1,78 @@ +// Copyright 2026 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, view) { + // [START logging_v2_generated_ConfigServiceV2_UpdateView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full resource name of the view to update + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + * For example: + * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + */ + // const name = 'abc123' + /** + * Required. The updated view. + */ + // const view = {} + /** + * Optional. Field mask that specifies the fields in `view` that need + * an update. A 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 + * For example: `updateMask=filter` + */ + // const updateMask = {} + + // Imports the Logging library + const {ConfigServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new ConfigServiceV2Client(); + + async function callUpdateView() { + // Construct request + const request = { + name, + view, + }; + + // Run request + const response = await loggingClient.updateView(request); + console.log(response); + } + + callUpdateView(); + // [END logging_v2_generated_ConfigServiceV2_UpdateView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.delete_log.js b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.delete_log.js new file mode 100644 index 000000000000..4ba541b60a5b --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.delete_log.js @@ -0,0 +1,70 @@ +// Copyright 2026 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(logName) { + // [START logging_v2_generated_LoggingServiceV2_DeleteLog_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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]` + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * For more information about log names, see + * LogEntry google.logging.v2.LogEntry. + */ + // const logName = 'abc123' + + // Imports the Logging library + const {LoggingServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new LoggingServiceV2Client(); + + async function callDeleteLog() { + // Construct request + const request = { + logName, + }; + + // Run request + const response = await loggingClient.deleteLog(request); + console.log(response); + } + + callDeleteLog(); + // [END logging_v2_generated_LoggingServiceV2_DeleteLog_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_log_entries.js b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_log_entries.js new file mode 100644 index 000000000000..53b514148c28 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_log_entries.js @@ -0,0 +1,106 @@ +// Copyright 2026 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(resourceNames) { + // [START logging_v2_generated_LoggingServiceV2_ListLogEntries_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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]` + * * `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. + * A maximum of 100 resources may be specified in a single request. + */ + // const resourceNames = ['abc','def'] + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + */ + // const filter = 'abc123' + /** + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + */ + // 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. + */ + // const pageSize = 1234 + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + */ + // const pageToken = 'abc123' + + // Imports the Logging library + const {LoggingServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new LoggingServiceV2Client(); + + async function callListLogEntries() { + // Construct request + const request = { + resourceNames, + }; + + // Run request + const iterable = loggingClient.listLogEntriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLogEntries(); + // [END logging_v2_generated_LoggingServiceV2_ListLogEntries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_logs.js b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_logs.js new file mode 100644 index 000000000000..b6ead6c3fe91 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_logs.js @@ -0,0 +1,94 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_LoggingServiceV2_ListLogs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name to list logs for: + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + */ + // const parent = 'abc123' + /** + * Optional. List of resource names to list logs for: + * * `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]` + * The resource name in the `parent` field is added to this list. + */ + // const resourceNames = ['abc','def'] + /** + * 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 + /** + * 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' + + // Imports the Logging library + const {LoggingServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new LoggingServiceV2Client(); + + async function callListLogs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listLogsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLogs(); + // [END logging_v2_generated_LoggingServiceV2_ListLogs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js new file mode 100644 index 000000000000..6c61cc66ac0c --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js @@ -0,0 +1,71 @@ +// Copyright 2026 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() { + // [START logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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 + /** + * 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' + + // Imports the Logging library + const {LoggingServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new LoggingServiceV2Client(); + + async function callListMonitoredResourceDescriptors() { + // Construct request + const request = { + }; + + // Run request + const iterable = loggingClient.listMonitoredResourceDescriptorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMonitoredResourceDescriptors(); + // [END logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.tail_log_entries.js b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.tail_log_entries.js new file mode 100644 index 000000000000..0d96284b9465 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.tail_log_entries.js @@ -0,0 +1,89 @@ +// Copyright 2026 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(resourceNames) { + // [START logging_v2_generated_LoggingServiceV2_TailLogEntries_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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]` + * 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]` + */ + // const resourceNames = ['abc','def'] + /** + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + */ + // const filter = 'abc123' + /** + * Optional. The amount of time to buffer log entries at the server before + * being returned to prevent out of order results due to late arriving log + * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + * milliseconds. + */ + // const bufferWindow = {} + + // Imports the Logging library + const {LoggingServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new LoggingServiceV2Client(); + + async function callTailLogEntries() { + // Construct request + const request = { + resourceNames, + }; + + // Run request + const stream = await loggingClient.tailLogEntries(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callTailLogEntries(); + // [END logging_v2_generated_LoggingServiceV2_TailLogEntries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.write_log_entries.js b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.write_log_entries.js new file mode 100644 index 000000000000..2b5e5bcc8493 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/logging_service_v2.write_log_entries.js @@ -0,0 +1,129 @@ +// Copyright 2026 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(entries) { + // [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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]` + * `[LOG_ID]` must be URL-encoded. For example: + * "projects/my-project-id/logs/syslog" + * "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 + * individual log entry. + */ + // const logName = 'abc123' + /** + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * See LogEntry google.logging.v2.LogEntry. + */ + // const resource = {} + /** + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See LogEntry google.logging.v2.LogEntry. + */ + // const labels = [1,2,3,4] + /** + * Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * LogEntry google.logging.v2.LogEntry type. + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * 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/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/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. + */ + // const entries = [1,2,3,4] + /** + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + */ + // const partialSuccess = true + /** + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + */ + // const dryRun = true + + // Imports the Logging library + const {LoggingServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new LoggingServiceV2Client(); + + async function callWriteLogEntries() { + // Construct request + const request = { + entries, + }; + + // Run request + const response = await loggingClient.writeLogEntries(request); + console.log(response); + } + + callWriteLogEntries(); + // [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.create_log_metric.js b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.create_log_metric.js new file mode 100644 index 000000000000..d92836b5806f --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.create_log_metric.js @@ -0,0 +1,69 @@ +// Copyright 2026 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(parent, metric) { + // [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project in which to create the metric: + * "projects/[PROJECT_ID]" + * The new metric must be provided in the request. + */ + // const parent = 'abc123' + /** + * Required. The new logs-based metric, which must not have an identifier that + * already exists. + */ + // const metric = {} + + // Imports the Logging library + const {MetricsServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new MetricsServiceV2Client(); + + async function callCreateLogMetric() { + // Construct request + const request = { + parent, + metric, + }; + + // Run request + const response = await loggingClient.createLogMetric(request); + console.log(response); + } + + callCreateLogMetric(); + // [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.delete_log_metric.js b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.delete_log_metric.js new file mode 100644 index 000000000000..f2d0bf5ab1b7 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.delete_log_metric.js @@ -0,0 +1,62 @@ +// Copyright 2026 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(metricName) { + // [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the metric to delete: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + */ + // const metricName = 'abc123' + + // Imports the Logging library + const {MetricsServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new MetricsServiceV2Client(); + + async function callDeleteLogMetric() { + // Construct request + const request = { + metricName, + }; + + // Run request + const response = await loggingClient.deleteLogMetric(request); + console.log(response); + } + + callDeleteLogMetric(); + // [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.get_log_metric.js b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.get_log_metric.js new file mode 100644 index 000000000000..0f3bfa552c6f --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.get_log_metric.js @@ -0,0 +1,62 @@ +// Copyright 2026 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(metricName) { + // [START logging_v2_generated_MetricsServiceV2_GetLogMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the desired metric: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + */ + // const metricName = 'abc123' + + // Imports the Logging library + const {MetricsServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new MetricsServiceV2Client(); + + async function callGetLogMetric() { + // Construct request + const request = { + metricName, + }; + + // Run request + const response = await loggingClient.getLogMetric(request); + console.log(response); + } + + callGetLogMetric(); + // [END logging_v2_generated_MetricsServiceV2_GetLogMetric_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.list_log_metrics.js b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.list_log_metrics.js new file mode 100644 index 000000000000..48ad5b9e4751 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.list_log_metrics.js @@ -0,0 +1,77 @@ +// Copyright 2026 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(parent) { + // [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project containing the metrics: + * "projects/[PROJECT_ID]" + */ + // 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. + */ + // 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. + */ + // const pageSize = 1234 + + // Imports the Logging library + const {MetricsServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new MetricsServiceV2Client(); + + async function callListLogMetrics() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = loggingClient.listLogMetricsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListLogMetrics(); + // [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.update_log_metric.js b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.update_log_metric.js new file mode 100644 index 000000000000..50369c91c071 --- /dev/null +++ b/packages/google-cloud-logging-api/samples/generated/v2/metrics_service_v2.update_log_metric.js @@ -0,0 +1,70 @@ +// Copyright 2026 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(metricName, metric) { + // [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the metric to update: + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + */ + // const metricName = 'abc123' + /** + * Required. The updated metric. + */ + // const metric = {} + + // Imports the Logging library + const {MetricsServiceV2Client} = require('@google-cloud/logging-api').v2; + + // Instantiates a client + const loggingClient = new MetricsServiceV2Client(); + + async function callUpdateLogMetric() { + // Construct request + const request = { + metricName, + metric, + }; + + // Run request + const response = await loggingClient.updateLogMetric(request); + console.log(response); + } + + callUpdateLogMetric(); + // [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-logging-api/src/index.ts b/packages/google-cloud-logging-api/src/index.ts new file mode 100644 index 000000000000..799453f208d6 --- /dev/null +++ b/packages/google-cloud-logging-api/src/index.ts @@ -0,0 +1,31 @@ +// Copyright 2026 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 synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v2 from './v2'; + +const ConfigServiceV2Client = v2.ConfigServiceV2Client; +type ConfigServiceV2Client = v2.ConfigServiceV2Client; +const LoggingServiceV2Client = v2.LoggingServiceV2Client; +type LoggingServiceV2Client = v2.LoggingServiceV2Client; +const MetricsServiceV2Client = v2.MetricsServiceV2Client; +type MetricsServiceV2Client = v2.MetricsServiceV2Client; + +export {v2, ConfigServiceV2Client, LoggingServiceV2Client, MetricsServiceV2Client}; +export default {v2, ConfigServiceV2Client, LoggingServiceV2Client, MetricsServiceV2Client}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-logging-api/src/v2/config_service_v2_client.ts b/packages/google-cloud-logging-api/src/v2/config_service_v2_client.ts new file mode 100644 index 000000000000..ae0db22f3be0 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/config_service_v2_client.ts @@ -0,0 +1,7855 @@ +// Copyright 2026 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/config_service_v2_client_config.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'; +const version = require('../../../package.json').version; + +/** + * Service for configuring sinks used to route log entries. + * @class + * @memberof v2 + */ +export class ConfigServiceV2Client { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('logging-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + 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 }>; + + /** + * Construct an instance of ConfigServiceV2Client. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ConfigServiceV2Client({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConfigServiceV2Client; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'logging.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/cmekSettings', + ), + billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/exclusions/{exclusion}', + ), + billingAccountLocationBucketPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}', + ), + billingAccountLocationBucketLinkPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}', + ), + billingAccountLocationBucketViewPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/cmekSettings', + ), + folderExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/exclusions/{exclusion}', + ), + folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}', + ), + folderLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}', + ), + folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}', + ), + logMetricPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metrics/{metric}', + ), + organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cmekSettings', + ), + organizationExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/exclusions/{exclusion}', + ), + organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}', + ), + organizationLocationBucketLinkPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}', + ), + organizationLocationBucketViewPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cmekSettings', + ), + projectExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/exclusions/{exclusion}', + ), + projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}', + ), + projectLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}/links/{link}', + ), + projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listBuckets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'buckets', + ), + listViews: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'views', + ), + listSinks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sinks', + ), + listLinks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'links', + ), + listExclusions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'exclusions', + ), + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v2/{name=*/*/locations/*/operations/*}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v2/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + post: '/v2/{name=organizations/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + post: '/v2/{name=folders/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + post: '/v2/{name=billingAccounts/*/locations/*/operations/*}:cancel', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v2/{name=*/*/locations/*/operations/*}', + additional_bindings: [ + { get: '/v2/{name=projects/*/locations/*/operations/*}' }, + { get: '/v2/{name=organizations/*/locations/*/operations/*}' }, + { get: '/v2/{name=folders/*/locations/*/operations/*}' }, + { get: '/v2/{name=billingAccounts/*/locations/*/operations/*}' }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v2/{name=*/*/locations/*}/operations', + additional_bindings: [ + { get: '/v2/{name=projects/*/locations/*}/operations' }, + { get: '/v2/{name=organizations/*/locations/*}/operations' }, + { get: '/v2/{name=folders/*/locations/*}/operations' }, + { get: '/v2/{name=billingAccounts/*/locations/*}/operations' }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createBucketAsyncResponse = protoFilesRoot.lookup( + '.google.logging.v2.LogBucket', + ) as gax.protobuf.Type; + const createBucketAsyncMetadata = protoFilesRoot.lookup( + '.google.logging.v2.BucketMetadata', + ) as gax.protobuf.Type; + const updateBucketAsyncResponse = protoFilesRoot.lookup( + '.google.logging.v2.LogBucket', + ) as gax.protobuf.Type; + const updateBucketAsyncMetadata = protoFilesRoot.lookup( + '.google.logging.v2.BucketMetadata', + ) as gax.protobuf.Type; + const createLinkResponse = protoFilesRoot.lookup( + '.google.logging.v2.Link', + ) as gax.protobuf.Type; + const createLinkMetadata = protoFilesRoot.lookup( + '.google.logging.v2.LinkMetadata', + ) as gax.protobuf.Type; + const deleteLinkResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty', + ) as gax.protobuf.Type; + const deleteLinkMetadata = protoFilesRoot.lookup( + '.google.logging.v2.LinkMetadata', + ) as gax.protobuf.Type; + 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 = { + createBucketAsync: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBucketAsyncResponse.decode.bind(createBucketAsyncResponse), + createBucketAsyncMetadata.decode.bind(createBucketAsyncMetadata), + ), + updateBucketAsync: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBucketAsyncResponse.decode.bind(updateBucketAsyncResponse), + updateBucketAsyncMetadata.decode.bind(updateBucketAsyncMetadata), + ), + createLink: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createLinkResponse.decode.bind(createLinkResponse), + createLinkMetadata.decode.bind(createLinkMetadata), + ), + deleteLink: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteLinkResponse.decode.bind(deleteLinkResponse), + deleteLinkMetadata.decode.bind(deleteLinkMetadata), + ), + 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', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.configServiceV2Stub) { + return this.configServiceV2Stub; + } + + // Put together the "service stub" for + // google.logging.v2.ConfigServiceV2. + this.configServiceV2Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.logging.v2.ConfigServiceV2', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.logging.v2.ConfigServiceV2, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const configServiceV2StubMethods = [ + 'listBuckets', + 'getBucket', + 'createBucketAsync', + 'updateBucketAsync', + 'createBucket', + 'updateBucket', + 'deleteBucket', + 'undeleteBucket', + 'listViews', + 'getView', + 'createView', + 'updateView', + 'deleteView', + 'listSinks', + 'getSink', + 'createSink', + 'updateSink', + 'deleteSink', + 'createLink', + 'deleteLink', + 'listLinks', + 'getLink', + 'listExclusions', + 'getExclusion', + 'createExclusion', + 'updateExclusion', + 'deleteExclusion', + 'getCmekSettings', + 'updateCmekSettings', + 'getSettings', + 'updateSettings', + 'copyLogEntries', + ]; + for (const methodName of configServiceV2StubMethods) { + const callPromise = this.configServiceV2Stub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.configServiceV2Stub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'logging.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'logging.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/logging.admin', + 'https://www.googleapis.com/auth/logging.read', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets a log bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * + * 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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogBucket|LogBucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_bucket.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetBucket_async + */ + getBucket( + request?: protos.google.logging.v2.IGetBucketRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | undefined, + {} | undefined, + ] + >; + getBucket( + request: protos.google.logging.v2.IGetBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + getBucket( + request: protos.google.logging.v2.IGetBucketRequest, + callback: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + getBucket( + request?: protos.google.logging.v2.IGetBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getBucket request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBucket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IGetBucketRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBucket response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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 log bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * + * 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. + * @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 ignored. + * @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 {@link protos.google.logging.v2.LogBucket|LogBucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_bucket.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateBucket_async + */ + createBucket( + request?: protos.google.logging.v2.ICreateBucketRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | undefined, + {} | undefined, + ] + >; + createBucket( + request: protos.google.logging.v2.ICreateBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + createBucket( + request: protos.google.logging.v2.ICreateBucketRequest, + callback: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + createBucket( + request?: protos.google.logging.v2.ICreateBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createBucket request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createBucket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.ICreateBucketRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createBucket response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Updates a log bucket. + * + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full resource name of the bucket to update. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * + * 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. + * + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * 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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogBucket|LogBucket}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_bucket.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateBucket_async + */ + updateBucket( + request?: protos.google.logging.v2.IUpdateBucketRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | undefined, + {} | undefined, + ] + >; + updateBucket( + request: protos.google.logging.v2.IUpdateBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateBucket( + request: protos.google.logging.v2.IUpdateBucketRequest, + callback: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateBucket( + request?: protos.google.logging.v2.IUpdateBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateBucket request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBucket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IUpdateBucketRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateBucket response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * @param {string} request.name + * Required. The full resource name of the bucket to delete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * + * 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. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.delete_bucket.js + * region_tag:logging_v2_generated_ConfigServiceV2_DeleteBucket_async + */ + deleteBucket( + request?: protos.google.logging.v2.IDeleteBucketRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | undefined, + {} | undefined, + ] + >; + deleteBucket( + request: protos.google.logging.v2.IDeleteBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteBucket( + request: protos.google.logging.v2.IDeleteBucketRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteBucket( + request?: protos.google.logging.v2.IDeleteBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteBucket request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteBucket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteBucketRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBucket response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * @param {string} request.name + * Required. The full resource name of the bucket to undelete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * + * 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. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.undelete_bucket.js + * region_tag:logging_v2_generated_ConfigServiceV2_UndeleteBucket_async + */ + undeleteBucket( + request?: protos.google.logging.v2.IUndeleteBucketRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | undefined, + {} | undefined, + ] + >; + undeleteBucket( + request: protos.google.logging.v2.IUndeleteBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + undeleteBucket( + request: protos.google.logging.v2.IUndeleteBucketRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | null | undefined, + {} | null | undefined + >, + ): void; + undeleteBucket( + request?: protos.google.logging.v2.IUndeleteBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('undeleteBucket request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('undeleteBucket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .undeleteBucket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IUndeleteBucketRequest | undefined, + {} | undefined, + ]) => { + this._log.info('undeleteBucket response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a view on a log bucket.. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the policy: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogView|LogView}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_view.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetView_async + */ + getView( + request?: protos.google.logging.v2.IGetViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | undefined, + {} | undefined, + ] + >; + getView( + request: protos.google.logging.v2.IGetViewRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + getView( + request: protos.google.logging.v2.IGetViewRequest, + callback: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + getView( + request?: protos.google.logging.v2.IGetViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getView request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IGetViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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]"` + * + * For example: + * + * `"projects/my-project/locations/global/buckets/my-bucket"` + * @param {string} request.viewId + * Required. A client-assigned identifier such as `"my-view"`. Identifiers are + * limited to 100 characters and can include only letters, digits, + * underscores, hyphens, and periods. + * @param {google.logging.v2.LogView} request.view + * Required. The new 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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogView|LogView}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_view.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateView_async + */ + createView( + request?: protos.google.logging.v2.ICreateViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | undefined, + {} | undefined, + ] + >; + createView( + request: protos.google.logging.v2.ICreateViewRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + createView( + request: protos.google.logging.v2.ICreateViewRequest, + callback: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + createView( + request?: protos.google.logging.v2.ICreateViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createView request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.ICreateViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * @param {string} request.name + * Required. The full resource name of the view to update + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[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] + * Optional. Field mask that specifies the fields in `view` that need + * an update. A 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 + * + * 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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogView|LogView}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_view.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateView_async + */ + updateView( + request?: protos.google.logging.v2.IUpdateViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | undefined, + {} | undefined, + ] + >; + updateView( + request: protos.google.logging.v2.IUpdateViewRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateView( + request: protos.google.logging.v2.IUpdateViewRequest, + callback: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateView( + request?: protos.google.logging.v2.IUpdateViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateView request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogView, + protos.google.logging.v2.IUpdateViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * @param {string} request.name + * Required. The full resource name of the view to delete: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[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. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.delete_view.js + * region_tag:logging_v2_generated_ConfigServiceV2_DeleteView_async + */ + deleteView( + request?: protos.google.logging.v2.IDeleteViewRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | undefined, + {} | undefined, + ] + >; + deleteView( + request: protos.google.logging.v2.IDeleteViewRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteView( + request: protos.google.logging.v2.IDeleteViewRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteView( + request?: protos.google.logging.v2.IDeleteViewRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteView request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteView response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteView(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteViewRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteView response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a sink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.sinkName + * Required. The resource name of the sink: + * + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogSink|LogSink}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_sink.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetSink_async + */ + getSink( + request?: protos.google.logging.v2.IGetSinkRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | undefined, + {} | undefined, + ] + >; + getSink( + request: protos.google.logging.v2.IGetSinkRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSink( + request: protos.google.logging.v2.IGetSinkRequest, + callback: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + getSink( + request?: protos.google.logging.v2.IGetSinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + sink_name: request.sinkName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getSink request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IGetSinkRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSink response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource in which to create the sink: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * + * 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. + * @param {boolean} [request.uniqueWriterIdentity] + * 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 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 + * more information, see `writer_identity` in + * {@link protos.google.logging.v2.LogSink|LogSink}. + * @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 {@link protos.google.logging.v2.LogSink|LogSink}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_sink.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateSink_async + */ + createSink( + request?: protos.google.logging.v2.ICreateSinkRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | undefined, + {} | undefined, + ] + >; + createSink( + request: protos.google.logging.v2.ICreateSinkRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + createSink( + request: protos.google.logging.v2.ICreateSinkRequest, + callback: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + createSink( + request?: protos.google.logging.v2.ICreateSinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createSink request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.ICreateSinkRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSink response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.sinkName + * Required. The full resource name of the sink to update, including the + * parent resource and the sink identifier: + * + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[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`. + * @param {boolean} [request.uniqueWriterIdentity] + * Optional. See {@link protos.google.logging.v2.ConfigServiceV2.CreateSink|sinks.create} + * for a description of this field. When updating a sink, the effect of this + * field on the value of `writer_identity` in the updated sink depends on both + * the old and new values of this field: + * + * + If the old and new values of this field are both false or both true, + * then there is no change to the sink's `writer_identity`. + * + If the old value is false and the new value is true, then + * `writer_identity` is changed to a unique service account. + * + It is an error if the old value is true and the new value is + * set to false or defaulted to false. + * @param {google.protobuf.FieldMask} [request.updateMask] + * 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 + * for backwards compatibility purposes: + * + * `destination,filter,includeChildren` + * + * At some point in the future, behavior will be removed and specifying an + * 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 + * + * 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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogSink|LogSink}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_sink.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateSink_async + */ + updateSink( + request?: protos.google.logging.v2.IUpdateSinkRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | undefined, + {} | undefined, + ] + >; + updateSink( + request: protos.google.logging.v2.IUpdateSinkRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateSink( + request: protos.google.logging.v2.IUpdateSinkRequest, + callback: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateSink( + request?: protos.google.logging.v2.IUpdateSinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + sink_name: request.sinkName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSink request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogSink, + protos.google.logging.v2.IUpdateSinkRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSink response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that + * service account is also deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.sinkName + * Required. The full resource name of the sink to delete, including the + * parent resource and the sink identifier: + * + * "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[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. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.delete_sink.js + * region_tag:logging_v2_generated_ConfigServiceV2_DeleteSink_async + */ + deleteSink( + request?: protos.google.logging.v2.IDeleteSinkRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | undefined, + {} | undefined, + ] + >; + deleteSink( + request: protos.google.logging.v2.IDeleteSinkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSink( + request: protos.google.logging.v2.IDeleteSinkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteSink( + request?: protos.google.logging.v2.IDeleteSinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + sink_name: request.sinkName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteSink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteSinkRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSink response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets a link. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the link: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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. + * The first element of the array is an object representing {@link protos.google.logging.v2.Link|Link}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_link.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetLink_async + */ + getLink( + request?: protos.google.logging.v2.IGetLinkRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | undefined, + {} | undefined, + ] + >; + getLink( + request: protos.google.logging.v2.IGetLinkRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + getLink( + request: protos.google.logging.v2.IGetLinkRequest, + callback: Callback< + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | null | undefined, + {} | null | undefined + >, + ): void; + getLink( + request?: protos.google.logging.v2.IGetLinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILink, + protos.google.logging.v2.IGetLinkRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getLink response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Gets the description of an exclusion in the _Default sink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of an existing exclusion: + * + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogExclusion|LogExclusion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_exclusion.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetExclusion_async + */ + getExclusion( + request?: protos.google.logging.v2.IGetExclusionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | undefined, + {} | undefined, + ] + >; + getExclusion( + request: protos.google.logging.v2.IGetExclusionRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + getExclusion( + request: protos.google.logging.v2.IGetExclusionRequest, + callback: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + getExclusion( + request?: protos.google.logging.v2.IGetExclusionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getExclusion request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExclusion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExclusion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IGetExclusionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getExclusion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * @param {string} request.parent + * Required. The parent resource in which to create the exclusion: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" + * + * 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. + * @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 {@link protos.google.logging.v2.LogExclusion|LogExclusion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_exclusion.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateExclusion_async + */ + createExclusion( + request?: protos.google.logging.v2.ICreateExclusionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | undefined, + {} | undefined, + ] + >; + createExclusion( + request: protos.google.logging.v2.ICreateExclusionRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + createExclusion( + request: protos.google.logging.v2.ICreateExclusionRequest, + callback: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + createExclusion( + request?: protos.google.logging.v2.ICreateExclusionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createExclusion request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExclusion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExclusion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.ICreateExclusionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createExclusion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Changes one or more properties of an existing exclusion in the _Default + * sink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the exclusion to update: + * + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[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. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A non-empty list of fields to change in the existing exclusion. + * New values for the fields are taken from the corresponding fields in the + * {@link protos.google.logging.v2.LogExclusion|LogExclusion} included in this request. + * Fields not mentioned in `update_mask` are not changed and are ignored in + * the request. + * + * For example, to change the filter and description of an exclusion, + * specify an `update_mask` of `"filter,description"`. + * @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 {@link protos.google.logging.v2.LogExclusion|LogExclusion}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_exclusion.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateExclusion_async + */ + updateExclusion( + request?: protos.google.logging.v2.IUpdateExclusionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | undefined, + {} | undefined, + ] + >; + updateExclusion( + request: protos.google.logging.v2.IUpdateExclusionRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateExclusion( + request: protos.google.logging.v2.IUpdateExclusionRequest, + callback: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateExclusion( + request?: protos.google.logging.v2.IUpdateExclusionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateExclusion request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExclusion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExclusion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogExclusion, + protos.google.logging.v2.IUpdateExclusionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateExclusion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes an exclusion in the _Default sink. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of an existing exclusion to delete: + * + * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[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. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.delete_exclusion.js + * region_tag:logging_v2_generated_ConfigServiceV2_DeleteExclusion_async + */ + deleteExclusion( + request?: protos.google.logging.v2.IDeleteExclusionRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | undefined, + {} | undefined, + ] + >; + deleteExclusion( + request: protos.google.logging.v2.IDeleteExclusionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteExclusion( + request: protos.google.logging.v2.IDeleteExclusionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteExclusion( + request?: protos.google.logging.v2.IDeleteExclusionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteExclusion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExclusion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExclusion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteExclusionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteExclusion response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource for which to retrieve CMEK settings. + * + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * + * 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. + * @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 {@link protos.google.logging.v2.CmekSettings|CmekSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.get_cmek_settings.js + * region_tag:logging_v2_generated_ConfigServiceV2_GetCmekSettings_async + */ + getCmekSettings( + request?: protos.google.logging.v2.IGetCmekSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | undefined, + {} | undefined, + ] + >; + getCmekSettings( + request: protos.google.logging.v2.IGetCmekSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + ): void; + getCmekSettings( + request: protos.google.logging.v2.IGetCmekSettingsRequest, + callback: Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + ): void; + getCmekSettings( + request?: protos.google.logging.v2.IGetCmekSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getCmekSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCmekSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCmekSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IGetCmekSettingsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCmekSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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. + * + * {@link protos.google.logging.v2.ConfigServiceV2.UpdateCmekSettings|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for the CMEK settings to update. + * + * "projects/[PROJECT_ID]/cmekSettings" + * "organizations/[ORGANIZATION_ID]/cmekSettings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" + * "folders/[FOLDER_ID]/cmekSettings" + * + * 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. + * @param {google.logging.v2.CmekSettings} request.cmekSettings + * Required. The CMEK 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 `cmek_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 protos.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 {@link protos.google.logging.v2.CmekSettings|CmekSettings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_cmek_settings.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_async + */ + updateCmekSettings( + request?: protos.google.logging.v2.IUpdateCmekSettingsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IUpdateCmekSettingsRequest | undefined, + {} | undefined, + ] + >; + updateCmekSettings( + request: protos.google.logging.v2.IUpdateCmekSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IUpdateCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateCmekSettings( + request: protos.google.logging.v2.IUpdateCmekSettingsRequest, + callback: Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IUpdateCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateCmekSettings( + request?: protos.google.logging.v2.IUpdateCmekSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ICmekSettings, + | protos.google.logging.v2.IUpdateCmekSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IUpdateCmekSettingsRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IUpdateCmekSettingsRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateCmekSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ICmekSettings, + | protos.google.logging.v2.IUpdateCmekSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCmekSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCmekSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ICmekSettings, + protos.google.logging.v2.IUpdateCmekSettingsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateCmekSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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 {@link protos.google.logging.v2.Settings|Settings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IGetSettingsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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 protos.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 protos.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 {@link protos.google.logging.v2.Settings|Settings}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ISettings, + protos.google.logging.v2.IUpdateSettingsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSettings response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Creates a log bucket asynchronously 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 log bucket: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * + * 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. + * @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 ignored. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_bucket_async.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async + */ + createBucketAsync( + request?: protos.google.logging.v2.ICreateBucketRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBucketAsync( + request: protos.google.logging.v2.ICreateBucketRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createBucketAsync( + request: protos.google.logging.v2.ICreateBucketRequest, + callback: Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createBucketAsync( + request?: protos.google.logging.v2.ICreateBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + 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 || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBucketAsync response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBucketAsync request %j', request); + return this.innerApiCalls + .createBucketAsync(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBucketAsync response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createBucketAsync()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_bucket_async.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async + */ + async checkCreateBucketAsyncProgress( + name: string, + ): Promise< + LROperation< + protos.google.logging.v2.LogBucket, + protos.google.logging.v2.BucketMetadata + > + > { + this._log.info('createBucketAsync long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBucketAsync, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.logging.v2.LogBucket, + protos.google.logging.v2.BucketMetadata + >; + } + /** + * Updates a log bucket asynchronously. + * + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full resource name of the bucket to update. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * + * 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. + * + * For a detailed `FieldMask` definition, see: + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + * + * 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. + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_bucket_async.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_async + */ + updateBucketAsync( + request?: protos.google.logging.v2.IUpdateBucketRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateBucketAsync( + request: protos.google.logging.v2.IUpdateBucketRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateBucketAsync( + request: protos.google.logging.v2.IUpdateBucketRequest, + callback: Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + updateBucketAsync( + request?: protos.google.logging.v2.IUpdateBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + 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 || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBucketAsync response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBucketAsync request %j', request); + return this.innerApiCalls + .updateBucketAsync(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateBucketAsync response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `updateBucketAsync()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.update_bucket_async.js + * region_tag:logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_async + */ + async checkUpdateBucketAsyncProgress( + name: string, + ): Promise< + LROperation< + protos.google.logging.v2.LogBucket, + protos.google.logging.v2.BucketMetadata + > + > { + this._log.info('updateBucketAsync long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateBucketAsync, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.logging.v2.LogBucket, + protos.google.logging.v2.BucketMetadata + >; + } + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible + * to use BigQuery to read the logs stored in the log bucket. A log bucket may + * currently only contain one link. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The full resource name of the bucket to create a link for. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "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]" + * @param {google.logging.v2.Link} request.link + * Required. The new link. + * @param {string} request.linkId + * Required. The ID to use for the link. The link_id can have up to 100 + * characters. A valid link_id must only have alphanumeric characters and + * underscores within it. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_link.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateLink_async + */ + createLink( + request?: protos.google.logging.v2.ICreateLinkRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createLink( + request: protos.google.logging.v2.ICreateLinkRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createLink( + request: protos.google.logging.v2.ICreateLinkRequest, + callback: Callback< + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + createLink( + request?: protos.google.logging.v2.ICreateLinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + 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 || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createLink response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createLink request %j', request); + return this.innerApiCalls + .createLink(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createLink response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `createLink()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.create_link.js + * region_tag:logging_v2_generated_ConfigServiceV2_CreateLink_async + */ + async checkCreateLinkProgress( + name: string, + ): Promise< + LROperation< + protos.google.logging.v2.Link, + protos.google.logging.v2.LinkMetadata + > + > { + this._log.info('createLink long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createLink, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.logging.v2.Link, + protos.google.logging.v2.LinkMetadata + >; + } + /** + * Deletes a link. This will also delete the corresponding BigQuery linked + * dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The full resource name of the link to delete. + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_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. + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.delete_link.js + * region_tag:logging_v2_generated_ConfigServiceV2_DeleteLink_async + */ + deleteLink( + request?: protos.google.logging.v2.IDeleteLinkRequest, + options?: CallOptions, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteLink( + request: protos.google.logging.v2.IDeleteLinkRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteLink( + request: protos.google.logging.v2.IDeleteLinkRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): void; + deleteLink( + request?: protos.google.logging.v2.IDeleteLinkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + 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 || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteLink response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteLink request %j', request); + return this.innerApiCalls + .deleteLink(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteLink response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * Check the status of the long running operation returned by `deleteLink()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.delete_link.js + * region_tag:logging_v2_generated_ConfigServiceV2_DeleteLink_async + */ + async checkDeleteLinkProgress( + name: string, + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.logging.v2.LinkMetadata + > + > { + this._log.info('deleteLink long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteLink, + this._gaxModule.createDefaultBackoffSettings(), + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.logging.v2.LinkMetadata + >; + } + /** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | Callback< + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('copyLogEntries response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('copyLogEntries request %j', request); + return this.innerApiCalls + .copyLogEntries(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('copyLogEntries response %j', rawResponse); + return [response, rawResponse, _]; + }, + ); + } + /** + * 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * 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 + > + > { + this._log.info('copyLogEntries long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + { name }, + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.copyLogEntries, + this._gaxModule.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. + * @param {string} request.parent + * Required. The parent resource whose buckets are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * + * Note: The locations portion of the resource must be specified, but + * 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. + * @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] + * 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 Array of {@link protos.google.logging.v2.LogBucket|LogBucket}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBucketsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBuckets( + request?: protos.google.logging.v2.IListBucketsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogBucket[], + protos.google.logging.v2.IListBucketsRequest | null, + protos.google.logging.v2.IListBucketsResponse, + ] + >; + listBuckets( + request: protos.google.logging.v2.IListBucketsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListBucketsRequest, + protos.google.logging.v2.IListBucketsResponse | null | undefined, + protos.google.logging.v2.ILogBucket + >, + ): void; + listBuckets( + request: protos.google.logging.v2.IListBucketsRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListBucketsRequest, + protos.google.logging.v2.IListBucketsResponse | null | undefined, + protos.google.logging.v2.ILogBucket + >, + ): void; + listBuckets( + request?: protos.google.logging.v2.IListBucketsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListBucketsRequest, + protos.google.logging.v2.IListBucketsResponse | null | undefined, + protos.google.logging.v2.ILogBucket + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListBucketsRequest, + protos.google.logging.v2.IListBucketsResponse | null | undefined, + protos.google.logging.v2.ILogBucket + >, + ): Promise< + [ + protos.google.logging.v2.ILogBucket[], + protos.google.logging.v2.IListBucketsRequest | null, + protos.google.logging.v2.IListBucketsResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListBucketsRequest, + protos.google.logging.v2.IListBucketsResponse | null | undefined, + protos.google.logging.v2.ILogBucket + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBuckets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBuckets request %j', request); + return this.innerApiCalls + .listBuckets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILogBucket[], + protos.google.logging.v2.IListBucketsRequest | null, + protos.google.logging.v2.IListBucketsResponse, + ]) => { + this._log.info('listBuckets values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listBuckets`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose buckets are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * + * Note: The locations portion of the resource must be specified, but + * 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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.LogBucket|LogBucket} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBucketsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBucketsStream( + request?: protos.google.logging.v2.IListBucketsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBuckets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listBuckets stream %j', request); + return this.descriptors.page.listBuckets.createStream( + this.innerApiCalls.listBuckets as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listBuckets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose buckets are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + * + * Note: The locations portion of the resource must be specified, but + * 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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.LogBucket|LogBucket}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.list_buckets.js + * region_tag:logging_v2_generated_ConfigServiceV2_ListBuckets_async + */ + listBucketsAsync( + request?: protos.google.logging.v2.IListBucketsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBuckets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listBuckets iterate %j', request); + return this.descriptors.page.listBuckets.asyncIterate( + this.innerApiCalls['listBuckets'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists views on a log bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The bucket whose views are to be listed: + * + * "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. + * @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] + * 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 Array of {@link protos.google.logging.v2.LogView|LogView}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listViews( + request?: protos.google.logging.v2.IListViewsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogView[], + protos.google.logging.v2.IListViewsRequest | null, + protos.google.logging.v2.IListViewsResponse, + ] + >; + listViews( + request: protos.google.logging.v2.IListViewsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListViewsRequest, + protos.google.logging.v2.IListViewsResponse | null | undefined, + protos.google.logging.v2.ILogView + >, + ): void; + listViews( + request: protos.google.logging.v2.IListViewsRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListViewsRequest, + protos.google.logging.v2.IListViewsResponse | null | undefined, + protos.google.logging.v2.ILogView + >, + ): void; + listViews( + request?: protos.google.logging.v2.IListViewsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListViewsRequest, + protos.google.logging.v2.IListViewsResponse | null | undefined, + protos.google.logging.v2.ILogView + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListViewsRequest, + protos.google.logging.v2.IListViewsResponse | null | undefined, + protos.google.logging.v2.ILogView + >, + ): Promise< + [ + protos.google.logging.v2.ILogView[], + protos.google.logging.v2.IListViewsRequest | null, + protos.google.logging.v2.IListViewsResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListViewsRequest, + protos.google.logging.v2.IListViewsResponse | null | undefined, + protos.google.logging.v2.ILogView + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listViews values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listViews request %j', request); + return this.innerApiCalls + .listViews(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILogView[], + protos.google.logging.v2.IListViewsRequest | null, + protos.google.logging.v2.IListViewsResponse, + ]) => { + this._log.info('listViews values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listViews`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The bucket whose views are to be listed: + * + * "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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.LogView|LogView} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listViewsStream( + request?: protos.google.logging.v2.IListViewsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listViews stream %j', request); + return this.descriptors.page.listViews.createStream( + this.innerApiCalls.listViews as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listViews`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The bucket whose views are to be listed: + * + * "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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.LogView|LogView}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.list_views.js + * region_tag:logging_v2_generated_ConfigServiceV2_ListViews_async + */ + listViewsAsync( + request?: protos.google.logging.v2.IListViewsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listViews iterate %j', request); + return this.descriptors.page.listViews.asyncIterate( + this.innerApiCalls['listViews'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists sinks. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose sinks are to be listed: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. + * @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] + * 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 Array of {@link protos.google.logging.v2.LogSink|LogSink}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSinks( + request?: protos.google.logging.v2.IListSinksRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogSink[], + protos.google.logging.v2.IListSinksRequest | null, + protos.google.logging.v2.IListSinksResponse, + ] + >; + listSinks( + request: protos.google.logging.v2.IListSinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListSinksRequest, + protos.google.logging.v2.IListSinksResponse | null | undefined, + protos.google.logging.v2.ILogSink + >, + ): void; + listSinks( + request: protos.google.logging.v2.IListSinksRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListSinksRequest, + protos.google.logging.v2.IListSinksResponse | null | undefined, + protos.google.logging.v2.ILogSink + >, + ): void; + listSinks( + request?: protos.google.logging.v2.IListSinksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListSinksRequest, + protos.google.logging.v2.IListSinksResponse | null | undefined, + protos.google.logging.v2.ILogSink + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListSinksRequest, + protos.google.logging.v2.IListSinksResponse | null | undefined, + protos.google.logging.v2.ILogSink + >, + ): Promise< + [ + protos.google.logging.v2.ILogSink[], + protos.google.logging.v2.IListSinksRequest | null, + protos.google.logging.v2.IListSinksResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListSinksRequest, + protos.google.logging.v2.IListSinksResponse | null | undefined, + protos.google.logging.v2.ILogSink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSinks request %j', request); + return this.innerApiCalls + .listSinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILogSink[], + protos.google.logging.v2.IListSinksRequest | null, + protos.google.logging.v2.IListSinksResponse, + ]) => { + this._log.info('listSinks values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listSinks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose sinks are to be listed: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.LogSink|LogSink} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSinksStream( + request?: protos.google.logging.v2.IListSinksRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSinks stream %j', request); + return this.descriptors.page.listSinks.createStream( + this.innerApiCalls.listSinks as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listSinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose sinks are to be listed: + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.LogSink|LogSink}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.list_sinks.js + * region_tag:logging_v2_generated_ConfigServiceV2_ListSinks_async + */ + listSinksAsync( + request?: protos.google.logging.v2.IListSinksRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listSinks iterate %j', request); + return this.descriptors.page.listSinks.asyncIterate( + this.innerApiCalls['listSinks'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists links. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose links are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "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]/ + * @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. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * @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 Array of {@link protos.google.logging.v2.Link|Link}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLinks( + request?: protos.google.logging.v2.IListLinksRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILink[], + protos.google.logging.v2.IListLinksRequest | null, + protos.google.logging.v2.IListLinksResponse, + ] + >; + listLinks( + request: protos.google.logging.v2.IListLinksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListLinksRequest, + protos.google.logging.v2.IListLinksResponse | null | undefined, + protos.google.logging.v2.ILink + >, + ): void; + listLinks( + request: protos.google.logging.v2.IListLinksRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListLinksRequest, + protos.google.logging.v2.IListLinksResponse | null | undefined, + protos.google.logging.v2.ILink + >, + ): void; + listLinks( + request?: protos.google.logging.v2.IListLinksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListLinksRequest, + protos.google.logging.v2.IListLinksResponse | null | undefined, + protos.google.logging.v2.ILink + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListLinksRequest, + protos.google.logging.v2.IListLinksResponse | null | undefined, + protos.google.logging.v2.ILink + >, + ): Promise< + [ + protos.google.logging.v2.ILink[], + protos.google.logging.v2.IListLinksRequest | null, + protos.google.logging.v2.IListLinksResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListLinksRequest, + protos.google.logging.v2.IListLinksResponse | null | undefined, + protos.google.logging.v2.ILink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLinks request %j', request); + return this.innerApiCalls + .listLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILink[], + protos.google.logging.v2.IListLinksRequest | null, + protos.google.logging.v2.IListLinksResponse, + ]) => { + this._log.info('listLinks values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listLinks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose links are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "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]/ + * @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. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.Link|Link} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listLinksAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLinksStream( + request?: protos.google.logging.v2.IListLinksRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLinks stream %j', request); + return this.descriptors.page.listLinks.createStream( + this.innerApiCalls.listLinks as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listLinks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose links are to be listed: + * + * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "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]/ + * @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. + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return from this request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.Link|Link}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.list_links.js + * region_tag:logging_v2_generated_ConfigServiceV2_ListLinks_async + */ + listLinksAsync( + request?: protos.google.logging.v2.IListLinksRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLinks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLinks iterate %j', request); + return this.descriptors.page.listLinks.asyncIterate( + this.innerApiCalls['listLinks'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose exclusions are to be listed. + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. + * @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] + * 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 Array of {@link protos.google.logging.v2.LogExclusion|LogExclusion}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listExclusionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExclusions( + request?: protos.google.logging.v2.IListExclusionsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion[], + protos.google.logging.v2.IListExclusionsRequest | null, + protos.google.logging.v2.IListExclusionsResponse, + ] + >; + listExclusions( + request: protos.google.logging.v2.IListExclusionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListExclusionsRequest, + protos.google.logging.v2.IListExclusionsResponse | null | undefined, + protos.google.logging.v2.ILogExclusion + >, + ): void; + listExclusions( + request: protos.google.logging.v2.IListExclusionsRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListExclusionsRequest, + protos.google.logging.v2.IListExclusionsResponse | null | undefined, + protos.google.logging.v2.ILogExclusion + >, + ): void; + listExclusions( + request?: protos.google.logging.v2.IListExclusionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListExclusionsRequest, + protos.google.logging.v2.IListExclusionsResponse | null | undefined, + protos.google.logging.v2.ILogExclusion + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListExclusionsRequest, + protos.google.logging.v2.IListExclusionsResponse | null | undefined, + protos.google.logging.v2.ILogExclusion + >, + ): Promise< + [ + protos.google.logging.v2.ILogExclusion[], + protos.google.logging.v2.IListExclusionsRequest | null, + protos.google.logging.v2.IListExclusionsResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListExclusionsRequest, + protos.google.logging.v2.IListExclusionsResponse | null | undefined, + protos.google.logging.v2.ILogExclusion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExclusions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExclusions request %j', request); + return this.innerApiCalls + .listExclusions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILogExclusion[], + protos.google.logging.v2.IListExclusionsRequest | null, + protos.google.logging.v2.IListExclusionsResponse, + ]) => { + this._log.info('listExclusions values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listExclusions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose exclusions are to be listed. + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.LogExclusion|LogExclusion} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listExclusionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listExclusionsStream( + request?: protos.google.logging.v2.IListExclusionsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listExclusions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExclusions stream %j', request); + return this.descriptors.page.listExclusions.createStream( + this.innerApiCalls.listExclusions as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listExclusions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource whose exclusions are to be listed. + * + * "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.LogExclusion|LogExclusion}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/config_service_v2.list_exclusions.js + * region_tag:logging_v2_generated_ConfigServiceV2_ListExclusions_async + */ + listExclusionsAsync( + request?: protos.google.logging.v2.IListExclusionsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listExclusions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listExclusions iterate %j', request); + return this.descriptors.page.listExclusions.asyncIterate( + this.innerApiCalls['listExclusions'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions, + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified billingAccountCmekSettings resource name string. + * + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountCmekSettingsPath(billingAccount: string) { + return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({ + billing_account: billingAccount, + }); + } + + /** + * Parse the billing_account from BillingAccountCmekSettings resource. + * + * @param {string} billingAccountCmekSettingsName + * A fully-qualified path representing billing_account_cmekSettings resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountCmekSettingsName( + billingAccountCmekSettingsName: string, + ) { + return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match( + billingAccountCmekSettingsName, + ).billing_account; + } + + /** + * Return a fully-qualified billingAccountExclusion resource name string. + * + * @param {string} billing_account + * @param {string} exclusion + * @returns {string} Resource name string. + */ + billingAccountExclusionPath(billingAccount: string, exclusion: string) { + return this.pathTemplates.billingAccountExclusionPathTemplate.render({ + billing_account: billingAccount, + exclusion: exclusion, + }); + } + + /** + * Parse the billing_account from BillingAccountExclusion resource. + * + * @param {string} billingAccountExclusionName + * A fully-qualified path representing billing_account_exclusion resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountExclusionName( + billingAccountExclusionName: string, + ) { + return this.pathTemplates.billingAccountExclusionPathTemplate.match( + billingAccountExclusionName, + ).billing_account; + } + + /** + * Parse the exclusion from BillingAccountExclusion resource. + * + * @param {string} billingAccountExclusionName + * A fully-qualified path representing billing_account_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromBillingAccountExclusionName( + billingAccountExclusionName: string, + ) { + return this.pathTemplates.billingAccountExclusionPathTemplate.match( + billingAccountExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified billingAccountLocationBucket resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + billingAccountLocationBucketPath( + billingAccount: string, + location: string, + bucket: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({ + billing_account: billingAccount, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the billing_account from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified billingAccountLocationBucketLink resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + billingAccountLocationBucketLinkPath( + billingAccount: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render( + { + billing_account: billingAccount, + location: location, + bucket: bucket, + link: link, + }, + ); + } + + /** + * Parse the billing_account from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified billingAccountLocationBucketView resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + billingAccountLocationBucketViewPath( + billingAccount: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render( + { + billing_account: billingAccount, + location: location, + bucket: bucket, + view: view, + }, + ); + } + + /** + * Parse the billing_account from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified billingAccountLog resource name string. + * + * @param {string} billing_account + * @param {string} log + * @returns {string} Resource name string. + */ + billingAccountLogPath(billingAccount: string, log: string) { + return this.pathTemplates.billingAccountLogPathTemplate.render({ + billing_account: billingAccount, + log: log, + }); + } + + /** + * Parse the billing_account from BillingAccountLog resource. + * + * @param {string} billingAccountLogName + * A fully-qualified path representing billing_account_log resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLogName(billingAccountLogName: string) { + return this.pathTemplates.billingAccountLogPathTemplate.match( + billingAccountLogName, + ).billing_account; + } + + /** + * Parse the log from BillingAccountLog resource. + * + * @param {string} billingAccountLogName + * A fully-qualified path representing billing_account_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromBillingAccountLogName(billingAccountLogName: string) { + return this.pathTemplates.billingAccountLogPathTemplate.match( + billingAccountLogName, + ).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. + * + * @param {string} billing_account + * @param {string} sink + * @returns {string} Resource name string. + */ + billingAccountSinkPath(billingAccount: string, sink: string) { + return this.pathTemplates.billingAccountSinkPathTemplate.render({ + billing_account: billingAccount, + sink: sink, + }); + } + + /** + * Parse the billing_account from BillingAccountSink resource. + * + * @param {string} billingAccountSinkName + * A fully-qualified path representing billing_account_sink resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountSinkName( + billingAccountSinkName: string, + ) { + return this.pathTemplates.billingAccountSinkPathTemplate.match( + billingAccountSinkName, + ).billing_account; + } + + /** + * Parse the sink from BillingAccountSink resource. + * + * @param {string} billingAccountSinkName + * A fully-qualified path representing billing_account_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromBillingAccountSinkName(billingAccountSinkName: string) { + return this.pathTemplates.billingAccountSinkPathTemplate.match( + billingAccountSinkName, + ).sink; + } + + /** + * Return a fully-qualified folderCmekSettings resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderCmekSettingsPath(folder: string) { + return this.pathTemplates.folderCmekSettingsPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from FolderCmekSettings resource. + * + * @param {string} folderCmekSettingsName + * A fully-qualified path representing folder_cmekSettings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderCmekSettingsName(folderCmekSettingsName: string) { + return this.pathTemplates.folderCmekSettingsPathTemplate.match( + folderCmekSettingsName, + ).folder; + } + + /** + * Return a fully-qualified folderExclusion resource name string. + * + * @param {string} folder + * @param {string} exclusion + * @returns {string} Resource name string. + */ + folderExclusionPath(folder: string, exclusion: string) { + return this.pathTemplates.folderExclusionPathTemplate.render({ + folder: folder, + exclusion: exclusion, + }); + } + + /** + * Parse the folder from FolderExclusion resource. + * + * @param {string} folderExclusionName + * A fully-qualified path representing folder_exclusion resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderExclusionName(folderExclusionName: string) { + return this.pathTemplates.folderExclusionPathTemplate.match( + folderExclusionName, + ).folder; + } + + /** + * Parse the exclusion from FolderExclusion resource. + * + * @param {string} folderExclusionName + * A fully-qualified path representing folder_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromFolderExclusionName(folderExclusionName: string) { + return this.pathTemplates.folderExclusionPathTemplate.match( + folderExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified folderLocationBucket resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + folderLocationBucketPath(folder: string, location: string, bucket: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the folder from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified folderLocationBucketLink resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + folderLocationBucketLinkPath( + folder: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + link: link, + }); + } + + /** + * Parse the folder from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified folderLocationBucketView resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + folderLocationBucketViewPath( + folder: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + view: view, + }); + } + + /** + * Parse the folder from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified folderLog resource name string. + * + * @param {string} folder + * @param {string} log + * @returns {string} Resource name string. + */ + folderLogPath(folder: string, log: string) { + return this.pathTemplates.folderLogPathTemplate.render({ + folder: folder, + log: log, + }); + } + + /** + * Parse the folder from FolderLog resource. + * + * @param {string} folderLogName + * A fully-qualified path representing folder_log resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLogName(folderLogName: string) { + return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder; + } + + /** + * Parse the log from FolderLog resource. + * + * @param {string} folderLogName + * A fully-qualified path representing folder_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromFolderLogName(folderLogName: string) { + 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. + * + * @param {string} folder + * @param {string} sink + * @returns {string} Resource name string. + */ + folderSinkPath(folder: string, sink: string) { + return this.pathTemplates.folderSinkPathTemplate.render({ + folder: folder, + sink: sink, + }); + } + + /** + * Parse the folder from FolderSink resource. + * + * @param {string} folderSinkName + * A fully-qualified path representing folder_sink resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSinkName(folderSinkName: string) { + return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName) + .folder; + } + + /** + * Parse the sink from FolderSink resource. + * + * @param {string} folderSinkName + * A fully-qualified path representing folder_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromFolderSinkName(folderSinkName: string) { + return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified logMetric resource name string. + * + * @param {string} project + * @param {string} metric + * @returns {string} Resource name string. + */ + logMetricPath(project: string, metric: string) { + return this.pathTemplates.logMetricPathTemplate.render({ + project: project, + metric: metric, + }); + } + + /** + * Parse the project from LogMetric resource. + * + * @param {string} logMetricName + * A fully-qualified path representing LogMetric resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLogMetricName(logMetricName: string) { + return this.pathTemplates.logMetricPathTemplate.match(logMetricName) + .project; + } + + /** + * Parse the metric from LogMetric resource. + * + * @param {string} logMetricName + * A fully-qualified path representing LogMetric resource. + * @returns {string} A string representing the metric. + */ + matchMetricFromLogMetricName(logMetricName: string) { + return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric; + } + + /** + * Return a fully-qualified organizationCmekSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationCmekSettingsPath(organization: string) { + return this.pathTemplates.organizationCmekSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationCmekSettings resource. + * + * @param {string} organizationCmekSettingsName + * A fully-qualified path representing organization_cmekSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCmekSettingsName( + organizationCmekSettingsName: string, + ) { + return this.pathTemplates.organizationCmekSettingsPathTemplate.match( + organizationCmekSettingsName, + ).organization; + } + + /** + * Return a fully-qualified organizationExclusion resource name string. + * + * @param {string} organization + * @param {string} exclusion + * @returns {string} Resource name string. + */ + organizationExclusionPath(organization: string, exclusion: string) { + return this.pathTemplates.organizationExclusionPathTemplate.render({ + organization: organization, + exclusion: exclusion, + }); + } + + /** + * Parse the organization from OrganizationExclusion resource. + * + * @param {string} organizationExclusionName + * A fully-qualified path representing organization_exclusion resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationExclusionName( + organizationExclusionName: string, + ) { + return this.pathTemplates.organizationExclusionPathTemplate.match( + organizationExclusionName, + ).organization; + } + + /** + * Parse the exclusion from OrganizationExclusion resource. + * + * @param {string} organizationExclusionName + * A fully-qualified path representing organization_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromOrganizationExclusionName( + organizationExclusionName: string, + ) { + return this.pathTemplates.organizationExclusionPathTemplate.match( + organizationExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified organizationLocationBucket resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + organizationLocationBucketPath( + organization: string, + location: string, + bucket: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.render({ + organization: organization, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the organization from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified organizationLocationBucketLink resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + organizationLocationBucketLinkPath( + organization: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.render( + { + organization: organization, + location: location, + bucket: bucket, + link: link, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified organizationLocationBucketView resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + organizationLocationBucketViewPath( + organization: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.render( + { + organization: organization, + location: location, + bucket: bucket, + view: view, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified organizationLog resource name string. + * + * @param {string} organization + * @param {string} log + * @returns {string} Resource name string. + */ + organizationLogPath(organization: string, log: string) { + return this.pathTemplates.organizationLogPathTemplate.render({ + organization: organization, + log: log, + }); + } + + /** + * Parse the organization from OrganizationLog resource. + * + * @param {string} organizationLogName + * A fully-qualified path representing organization_log resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLogName(organizationLogName: string) { + return this.pathTemplates.organizationLogPathTemplate.match( + organizationLogName, + ).organization; + } + + /** + * Parse the log from OrganizationLog resource. + * + * @param {string} organizationLogName + * A fully-qualified path representing organization_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromOrganizationLogName(organizationLogName: string) { + return this.pathTemplates.organizationLogPathTemplate.match( + organizationLogName, + ).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. + * + * @param {string} organization + * @param {string} sink + * @returns {string} Resource name string. + */ + organizationSinkPath(organization: string, sink: string) { + return this.pathTemplates.organizationSinkPathTemplate.render({ + organization: organization, + sink: sink, + }); + } + + /** + * Parse the organization from OrganizationSink resource. + * + * @param {string} organizationSinkName + * A fully-qualified path representing organization_sink resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSinkName(organizationSinkName: string) { + return this.pathTemplates.organizationSinkPathTemplate.match( + organizationSinkName, + ).organization; + } + + /** + * Parse the sink from OrganizationSink resource. + * + * @param {string} organizationSinkName + * A fully-qualified path representing organization_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromOrganizationSinkName(organizationSinkName: string) { + return this.pathTemplates.organizationSinkPathTemplate.match( + organizationSinkName, + ).sink; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCmekSettings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectCmekSettingsPath(project: string) { + return this.pathTemplates.projectCmekSettingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectCmekSettings resource. + * + * @param {string} projectCmekSettingsName + * A fully-qualified path representing project_cmekSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCmekSettingsName(projectCmekSettingsName: string) { + return this.pathTemplates.projectCmekSettingsPathTemplate.match( + projectCmekSettingsName, + ).project; + } + + /** + * Return a fully-qualified projectExclusion resource name string. + * + * @param {string} project + * @param {string} exclusion + * @returns {string} Resource name string. + */ + projectExclusionPath(project: string, exclusion: string) { + return this.pathTemplates.projectExclusionPathTemplate.render({ + project: project, + exclusion: exclusion, + }); + } + + /** + * Parse the project from ProjectExclusion resource. + * + * @param {string} projectExclusionName + * A fully-qualified path representing project_exclusion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectExclusionName(projectExclusionName: string) { + return this.pathTemplates.projectExclusionPathTemplate.match( + projectExclusionName, + ).project; + } + + /** + * Parse the exclusion from ProjectExclusion resource. + * + * @param {string} projectExclusionName + * A fully-qualified path representing project_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromProjectExclusionName(projectExclusionName: string) { + return this.pathTemplates.projectExclusionPathTemplate.match( + projectExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified projectLocationBucket resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + projectLocationBucketPath(project: string, location: string, bucket: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the project from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketName(projectLocationBucketName: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketName( + projectLocationBucketName: string, + ) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketName(projectLocationBucketName: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified projectLocationBucketLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + projectLocationBucketLinkPath( + project: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + link: link, + }); + } + + /** + * Parse the project from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified projectLocationBucketView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + projectLocationBucketViewPath( + project: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + view: view, + }); + } + + /** + * Parse the project from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified projectLog resource name string. + * + * @param {string} project + * @param {string} log + * @returns {string} Resource name string. + */ + projectLogPath(project: string, log: string) { + return this.pathTemplates.projectLogPathTemplate.render({ + project: project, + log: log, + }); + } + + /** + * Parse the project from ProjectLog resource. + * + * @param {string} projectLogName + * A fully-qualified path representing project_log resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLogName(projectLogName: string) { + return this.pathTemplates.projectLogPathTemplate.match(projectLogName) + .project; + } + + /** + * Parse the log from ProjectLog resource. + * + * @param {string} projectLogName + * A fully-qualified path representing project_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromProjectLogName(projectLogName: string) { + 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. + * + * @param {string} project + * @param {string} sink + * @returns {string} Resource name string. + */ + projectSinkPath(project: string, sink: string) { + return this.pathTemplates.projectSinkPathTemplate.render({ + project: project, + sink: sink, + }); + } + + /** + * Parse the project from ProjectSink resource. + * + * @param {string} projectSinkName + * A fully-qualified path representing project_sink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSinkName(projectSinkName: string) { + return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) + .project; + } + + /** + * Parse the sink from ProjectSink resource. + * + * @param {string} projectSinkName + * A fully-qualified path representing project_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromProjectSinkName(projectSinkName: string) { + return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) + .sink; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.configServiceV2Stub && !this._terminated) { + return this.configServiceV2Stub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-logging-api/src/v2/config_service_v2_client_config.json b/packages/google-cloud-logging-api/src/v2/config_service_v2_client_config.json new file mode 100644 index 000000000000..0e890aa4f2df --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/config_service_v2_client_config.json @@ -0,0 +1,169 @@ +{ + "interfaces": { + "google.logging.v2.ConfigServiceV2": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListBuckets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBucket": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBucketAsync": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBucketAsync": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBucket": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBucket": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBucket": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeleteBucket": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListViews": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteView": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSinks": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "GetSink": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "CreateSink": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSink": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "DeleteSink": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "CreateLink": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteLink": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListLinks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetLink": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListExclusions": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "GetExclusion": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "CreateExclusion": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateExclusion": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteExclusion": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "GetCmekSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "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/packages/google-cloud-logging-api/src/v2/config_service_v2_proto_list.json b/packages/google-cloud-logging-api/src/v2/config_service_v2_proto_list.json new file mode 100644 index 000000000000..fd41d3bfa051 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/config_service_v2_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/logging/type/http_request.proto", + "../../protos/google/logging/type/log_severity.proto", + "../../protos/google/logging/v2/log_entry.proto", + "../../protos/google/logging/v2/logging.proto", + "../../protos/google/logging/v2/logging_config.proto", + "../../protos/google/logging/v2/logging_metrics.proto" +] diff --git a/packages/google-cloud-logging-api/src/v2/gapic_metadata.json b/packages/google-cloud-logging-api/src/v2/gapic_metadata.json new file mode 100644 index 000000000000..049070017553 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/gapic_metadata.json @@ -0,0 +1,512 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.logging.v2", + "libraryPackage": "@google-cloud/logging-api", + "services": { + "ConfigServiceV2": { + "clients": { + "grpc": { + "libraryClient": "ConfigServiceV2Client", + "rpcs": { + "GetBucket": { + "methods": [ + "getBucket" + ] + }, + "CreateBucket": { + "methods": [ + "createBucket" + ] + }, + "UpdateBucket": { + "methods": [ + "updateBucket" + ] + }, + "DeleteBucket": { + "methods": [ + "deleteBucket" + ] + }, + "UndeleteBucket": { + "methods": [ + "undeleteBucket" + ] + }, + "GetView": { + "methods": [ + "getView" + ] + }, + "CreateView": { + "methods": [ + "createView" + ] + }, + "UpdateView": { + "methods": [ + "updateView" + ] + }, + "DeleteView": { + "methods": [ + "deleteView" + ] + }, + "GetSink": { + "methods": [ + "getSink" + ] + }, + "CreateSink": { + "methods": [ + "createSink" + ] + }, + "UpdateSink": { + "methods": [ + "updateSink" + ] + }, + "DeleteSink": { + "methods": [ + "deleteSink" + ] + }, + "GetLink": { + "methods": [ + "getLink" + ] + }, + "GetExclusion": { + "methods": [ + "getExclusion" + ] + }, + "CreateExclusion": { + "methods": [ + "createExclusion" + ] + }, + "UpdateExclusion": { + "methods": [ + "updateExclusion" + ] + }, + "DeleteExclusion": { + "methods": [ + "deleteExclusion" + ] + }, + "GetCmekSettings": { + "methods": [ + "getCmekSettings" + ] + }, + "UpdateCmekSettings": { + "methods": [ + "updateCmekSettings" + ] + }, + "GetSettings": { + "methods": [ + "getSettings" + ] + }, + "UpdateSettings": { + "methods": [ + "updateSettings" + ] + }, + "CreateBucketAsync": { + "methods": [ + "createBucketAsync" + ] + }, + "UpdateBucketAsync": { + "methods": [ + "updateBucketAsync" + ] + }, + "CreateLink": { + "methods": [ + "createLink" + ] + }, + "DeleteLink": { + "methods": [ + "deleteLink" + ] + }, + "CopyLogEntries": { + "methods": [ + "copyLogEntries" + ] + }, + "ListBuckets": { + "methods": [ + "listBuckets", + "listBucketsStream", + "listBucketsAsync" + ] + }, + "ListViews": { + "methods": [ + "listViews", + "listViewsStream", + "listViewsAsync" + ] + }, + "ListSinks": { + "methods": [ + "listSinks", + "listSinksStream", + "listSinksAsync" + ] + }, + "ListLinks": { + "methods": [ + "listLinks", + "listLinksStream", + "listLinksAsync" + ] + }, + "ListExclusions": { + "methods": [ + "listExclusions", + "listExclusionsStream", + "listExclusionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConfigServiceV2Client", + "rpcs": { + "GetBucket": { + "methods": [ + "getBucket" + ] + }, + "CreateBucket": { + "methods": [ + "createBucket" + ] + }, + "UpdateBucket": { + "methods": [ + "updateBucket" + ] + }, + "DeleteBucket": { + "methods": [ + "deleteBucket" + ] + }, + "UndeleteBucket": { + "methods": [ + "undeleteBucket" + ] + }, + "GetView": { + "methods": [ + "getView" + ] + }, + "CreateView": { + "methods": [ + "createView" + ] + }, + "UpdateView": { + "methods": [ + "updateView" + ] + }, + "DeleteView": { + "methods": [ + "deleteView" + ] + }, + "GetSink": { + "methods": [ + "getSink" + ] + }, + "CreateSink": { + "methods": [ + "createSink" + ] + }, + "UpdateSink": { + "methods": [ + "updateSink" + ] + }, + "DeleteSink": { + "methods": [ + "deleteSink" + ] + }, + "GetLink": { + "methods": [ + "getLink" + ] + }, + "GetExclusion": { + "methods": [ + "getExclusion" + ] + }, + "CreateExclusion": { + "methods": [ + "createExclusion" + ] + }, + "UpdateExclusion": { + "methods": [ + "updateExclusion" + ] + }, + "DeleteExclusion": { + "methods": [ + "deleteExclusion" + ] + }, + "GetCmekSettings": { + "methods": [ + "getCmekSettings" + ] + }, + "UpdateCmekSettings": { + "methods": [ + "updateCmekSettings" + ] + }, + "GetSettings": { + "methods": [ + "getSettings" + ] + }, + "UpdateSettings": { + "methods": [ + "updateSettings" + ] + }, + "CreateBucketAsync": { + "methods": [ + "createBucketAsync" + ] + }, + "UpdateBucketAsync": { + "methods": [ + "updateBucketAsync" + ] + }, + "CreateLink": { + "methods": [ + "createLink" + ] + }, + "DeleteLink": { + "methods": [ + "deleteLink" + ] + }, + "CopyLogEntries": { + "methods": [ + "copyLogEntries" + ] + }, + "ListBuckets": { + "methods": [ + "listBuckets", + "listBucketsStream", + "listBucketsAsync" + ] + }, + "ListViews": { + "methods": [ + "listViews", + "listViewsStream", + "listViewsAsync" + ] + }, + "ListSinks": { + "methods": [ + "listSinks", + "listSinksStream", + "listSinksAsync" + ] + }, + "ListLinks": { + "methods": [ + "listLinks", + "listLinksStream", + "listLinksAsync" + ] + }, + "ListExclusions": { + "methods": [ + "listExclusions", + "listExclusionsStream", + "listExclusionsAsync" + ] + } + } + } + } + }, + "LoggingServiceV2": { + "clients": { + "grpc": { + "libraryClient": "LoggingServiceV2Client", + "rpcs": { + "DeleteLog": { + "methods": [ + "deleteLog" + ] + }, + "WriteLogEntries": { + "methods": [ + "writeLogEntries" + ] + }, + "TailLogEntries": { + "methods": [ + "tailLogEntries" + ] + }, + "ListLogEntries": { + "methods": [ + "listLogEntries", + "listLogEntriesStream", + "listLogEntriesAsync" + ] + }, + "ListMonitoredResourceDescriptors": { + "methods": [ + "listMonitoredResourceDescriptors", + "listMonitoredResourceDescriptorsStream", + "listMonitoredResourceDescriptorsAsync" + ] + }, + "ListLogs": { + "methods": [ + "listLogs", + "listLogsStream", + "listLogsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LoggingServiceV2Client", + "rpcs": { + "DeleteLog": { + "methods": [ + "deleteLog" + ] + }, + "WriteLogEntries": { + "methods": [ + "writeLogEntries" + ] + }, + "ListLogEntries": { + "methods": [ + "listLogEntries", + "listLogEntriesStream", + "listLogEntriesAsync" + ] + }, + "ListMonitoredResourceDescriptors": { + "methods": [ + "listMonitoredResourceDescriptors", + "listMonitoredResourceDescriptorsStream", + "listMonitoredResourceDescriptorsAsync" + ] + }, + "ListLogs": { + "methods": [ + "listLogs", + "listLogsStream", + "listLogsAsync" + ] + } + } + } + } + }, + "MetricsServiceV2": { + "clients": { + "grpc": { + "libraryClient": "MetricsServiceV2Client", + "rpcs": { + "GetLogMetric": { + "methods": [ + "getLogMetric" + ] + }, + "CreateLogMetric": { + "methods": [ + "createLogMetric" + ] + }, + "UpdateLogMetric": { + "methods": [ + "updateLogMetric" + ] + }, + "DeleteLogMetric": { + "methods": [ + "deleteLogMetric" + ] + }, + "ListLogMetrics": { + "methods": [ + "listLogMetrics", + "listLogMetricsStream", + "listLogMetricsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MetricsServiceV2Client", + "rpcs": { + "GetLogMetric": { + "methods": [ + "getLogMetric" + ] + }, + "CreateLogMetric": { + "methods": [ + "createLogMetric" + ] + }, + "UpdateLogMetric": { + "methods": [ + "updateLogMetric" + ] + }, + "DeleteLogMetric": { + "methods": [ + "deleteLogMetric" + ] + }, + "ListLogMetrics": { + "methods": [ + "listLogMetrics", + "listLogMetricsStream", + "listLogMetricsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-logging-api/src/v2/index.ts b/packages/google-cloud-logging-api/src/v2/index.ts new file mode 100644 index 000000000000..2aca5a517ff1 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/index.ts @@ -0,0 +1,21 @@ +// Copyright 2026 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. ** + +export { ConfigServiceV2Client } from './config_service_v2_client'; +export { LoggingServiceV2Client } from './logging_service_v2_client'; +export { MetricsServiceV2Client } from './metrics_service_v2_client'; diff --git a/packages/google-cloud-logging-api/src/v2/logging_service_v2_client.ts b/packages/google-cloud-logging-api/src/v2/logging_service_v2_client.ts new file mode 100644 index 000000000000..037a40299ec5 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/logging_service_v2_client.ts @@ -0,0 +1,3389 @@ +// Copyright 2026 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform, PassThrough } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/logging_service_v2_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './logging_service_v2_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for ingesting and querying logs. + * @class + * @memberof v2 + */ +export class LoggingServiceV2Client { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('logging-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + pathTemplates: { [name: string]: gax.PathTemplate }; + loggingServiceV2Stub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of LoggingServiceV2Client. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new LoggingServiceV2Client({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof LoggingServiceV2Client; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'logging.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/cmekSettings', + ), + billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/exclusions/{exclusion}', + ), + billingAccountLocationBucketPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}', + ), + billingAccountLocationBucketLinkPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}', + ), + billingAccountLocationBucketViewPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/cmekSettings', + ), + folderExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/exclusions/{exclusion}', + ), + folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}', + ), + folderLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}', + ), + folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + logMetricPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metrics/{metric}', + ), + organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cmekSettings', + ), + organizationExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/exclusions/{exclusion}', + ), + organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}', + ), + organizationLocationBucketLinkPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}', + ), + organizationLocationBucketViewPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cmekSettings', + ), + projectExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/exclusions/{exclusion}', + ), + projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}', + ), + projectLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}/links/{link}', + ), + projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listLogEntries: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'entries', + ), + listMonitoredResourceDescriptors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'resourceDescriptors', + ), + listLogs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'logNames', + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + tailLogEntries: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries, + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.logging.v2.LoggingServiceV2', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.loggingServiceV2Stub) { + return this.loggingServiceV2Stub; + } + + // Put together the "service stub" for + // google.logging.v2.LoggingServiceV2. + this.loggingServiceV2Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.logging.v2.LoggingServiceV2', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.logging.v2.LoggingServiceV2, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const loggingServiceV2StubMethods = [ + 'deleteLog', + 'writeLogEntries', + 'listLogEntries', + 'listMonitoredResourceDescriptors', + 'listLogs', + 'tailLogEntries', + ]; + for (const methodName of loggingServiceV2StubMethods) { + const callPromise = this.loggingServiceV2Stub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({ objectMode: true }); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.', + ), + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.loggingServiceV2Stub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'logging.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'logging.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/logging.admin', + 'https://www.googleapis.com/auth/logging.read', + 'https://www.googleapis.com/auth/logging.write', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * 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]` + * + * `[LOG_ID]` must be URL-encoded. For example, + * `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + * + * For more information about log names, see + * {@link protos.google.logging.v2.LogEntry|LogEntry}. + * @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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/logging_service_v2.delete_log.js + * region_tag:logging_v2_generated_LoggingServiceV2_DeleteLog_async + */ + deleteLog( + request?: protos.google.logging.v2.IDeleteLogRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | undefined, + {} | undefined, + ] + >; + deleteLog( + request: protos.google.logging.v2.IDeleteLogRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteLog( + request: protos.google.logging.v2.IDeleteLogRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteLog( + request?: protos.google.logging.v2.IDeleteLogRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + log_name: request.logName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteLog request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteLog response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteLog(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteLog response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * 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) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.logName] + * 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]` + * + * `[LOG_ID]` must be URL-encoded. For example: + * + * "projects/my-project-id/logs/syslog" + * "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 + * individual log entry. + * @param {google.api.MonitoredResource} [request.resource] + * Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + * + * { "type": "gce_instance", + * "labels": { + * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + * + * See {@link protos.google.logging.v2.LogEntry|LogEntry}. + * @param {number[]} [request.labels] + * Optional. Default labels that are added to the `labels` field of all log + * entries in `entries`. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not changed. + * See {@link protos.google.logging.v2.LogEntry|LogEntry}. + * @param {number[]} request.entries + * Required. The log entries to send to Logging. The order of log + * entries in this list does not matter. Values supplied in this method's + * `log_name`, `resource`, and `labels` fields are copied into those log + * entries in this list that do not include values for their corresponding + * fields. For more information, see the + * {@link protos.google.logging.v2.LogEntry|LogEntry} type. + * + * If the `timestamp` or `insert_id` fields are missing in log entries, then + * this method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did not + * 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/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/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] + * Optional. Whether a batch's valid entries should be written even if some + * other entry failed due to a permanent error such as INVALID_ARGUMENT or + * PERMISSION_DENIED. If any entry failed, then the response status is the + * response status of one of the failed entries. The response will include + * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + * the entries' zero-based index in the `entries`. Failed requests for which + * no entries are written will not include per-entry errors. + * @param {boolean} [request.dryRun] + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether the + * logging API endpoints are working properly before sending valuable data. + * @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 {@link protos.google.logging.v2.WriteLogEntriesResponse|WriteLogEntriesResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/logging_service_v2.write_log_entries.js + * region_tag:logging_v2_generated_LoggingServiceV2_WriteLogEntries_async + */ + writeLogEntries( + request?: protos.google.logging.v2.IWriteLogEntriesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | undefined, + {} | undefined, + ] + >; + writeLogEntries( + request: protos.google.logging.v2.IWriteLogEntriesRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | null | undefined, + {} | null | undefined + >, + ): void; + writeLogEntries( + request: protos.google.logging.v2.IWriteLogEntriesRequest, + callback: Callback< + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | null | undefined, + {} | null | undefined + >, + ): void; + writeLogEntries( + request?: protos.google.logging.v2.IWriteLogEntriesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | 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().catch((err) => { + throw err; + }); + this._log.info('writeLogEntries request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('writeLogEntries response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .writeLogEntries(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.IWriteLogEntriesResponse, + protos.google.logging.v2.IWriteLogEntriesRequest | undefined, + {} | undefined, + ]) => { + this._log.info('writeLogEntries response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Streaming read of log entries as they are ingested. Until the stream is + * terminated, it will continue reading logs. + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.logging.v2.TailLogEntriesRequest|TailLogEntriesRequest} for write() method, and + * will emit objects representing {@link protos.google.logging.v2.TailLogEntriesResponse|TailLogEntriesResponse} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v2/logging_service_v2.tail_log_entries.js + * region_tag:logging_v2_generated_LoggingServiceV2_TailLogEntries_async + */ + tailLogEntries(options?: CallOptions): gax.CancellableStream { + this.initialize().catch((err) => { + throw err; + }); + this._log.info('tailLogEntries stream %j', options); + return this.innerApiCalls.tailLogEntries(null, options); + } + + /** + * 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). + * + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.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]` + * * `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. + * A maximum of 100 resources may be specified in a single request. + * @param {string} [request.filter] + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * @param {string} [request.orderBy] + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * 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. + * @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 + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @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 Array of {@link protos.google.logging.v2.LogEntry|LogEntry}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listLogEntriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogEntries( + request?: protos.google.logging.v2.IListLogEntriesRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogEntry[], + protos.google.logging.v2.IListLogEntriesRequest | null, + protos.google.logging.v2.IListLogEntriesResponse, + ] + >; + listLogEntries( + request: protos.google.logging.v2.IListLogEntriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListLogEntriesRequest, + protos.google.logging.v2.IListLogEntriesResponse | null | undefined, + protos.google.logging.v2.ILogEntry + >, + ): void; + listLogEntries( + request: protos.google.logging.v2.IListLogEntriesRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListLogEntriesRequest, + protos.google.logging.v2.IListLogEntriesResponse | null | undefined, + protos.google.logging.v2.ILogEntry + >, + ): void; + listLogEntries( + request?: protos.google.logging.v2.IListLogEntriesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListLogEntriesRequest, + protos.google.logging.v2.IListLogEntriesResponse | null | undefined, + protos.google.logging.v2.ILogEntry + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListLogEntriesRequest, + protos.google.logging.v2.IListLogEntriesResponse | null | undefined, + protos.google.logging.v2.ILogEntry + >, + ): Promise< + [ + protos.google.logging.v2.ILogEntry[], + protos.google.logging.v2.IListLogEntriesRequest | null, + protos.google.logging.v2.IListLogEntriesResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListLogEntriesRequest, + protos.google.logging.v2.IListLogEntriesResponse | null | undefined, + protos.google.logging.v2.ILogEntry + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLogEntries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLogEntries request %j', request); + return this.innerApiCalls + .listLogEntries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILogEntry[], + protos.google.logging.v2.IListLogEntriesRequest | null, + protos.google.logging.v2.IListLogEntriesResponse, + ]) => { + this._log.info('listLogEntries values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listLogEntries`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.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]` + * * `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. + * A maximum of 100 resources may be specified in a single request. + * @param {string} [request.filter] + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * @param {string} [request.orderBy] + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * 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. + * @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 + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.LogEntry|LogEntry} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listLogEntriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogEntriesStream( + request?: protos.google.logging.v2.IListLogEntriesRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listLogEntries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLogEntries stream %j', request); + return this.descriptors.page.listLogEntries.createStream( + this.innerApiCalls.listLogEntries as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listLogEntries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string[]} request.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]` + * * `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. + * A maximum of 100 resources may be specified in a single request. + * @param {string} [request.filter] + * Optional. Only log entries that match the filter are returned. An empty + * filter matches all log entries in the resources listed in `resource_names`. + * Referencing a parent resource that is not listed in `resource_names` will + * cause the filter to return no results. The maximum length of a filter is + * 20,000 characters. + * @param {string} [request.orderBy] + * Optional. How the results should be sorted. Presently, the only permitted + * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + * option returns entries in order of increasing values of + * `LogEntry.timestamp` (oldest first), and the second option returns entries + * 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. + * @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 + * `next_page_token` from the previous response. The values of other method + * parameters should be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.LogEntry|LogEntry}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/logging_service_v2.list_log_entries.js + * region_tag:logging_v2_generated_LoggingServiceV2_ListLogEntries_async + */ + listLogEntriesAsync( + request?: protos.google.logging.v2.IListLogEntriesRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listLogEntries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLogEntries iterate %j', request); + return this.descriptors.page.listLogEntries.asyncIterate( + this.innerApiCalls['listLogEntries'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists the descriptors for monitored resource types used by Logging. + * + * @param {Object} request + * The request object that will be sent. + * @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 {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. + * @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 Array of {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMonitoredResourceDescriptorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMonitoredResourceDescriptors( + request?: protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.api.IMonitoredResourceDescriptor[], + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest | null, + protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse, + ] + >; + listMonitoredResourceDescriptors( + request: protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + | protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse + | null + | undefined, + protos.google.api.IMonitoredResourceDescriptor + >, + ): void; + listMonitoredResourceDescriptors( + request: protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + | protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse + | null + | undefined, + protos.google.api.IMonitoredResourceDescriptor + >, + ): void; + listMonitoredResourceDescriptors( + request?: protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + | protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse + | null + | undefined, + protos.google.api.IMonitoredResourceDescriptor + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + | protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse + | null + | undefined, + protos.google.api.IMonitoredResourceDescriptor + >, + ): Promise< + [ + protos.google.api.IMonitoredResourceDescriptor[], + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest | null, + protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse, + ] + > | 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().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + | protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse + | null + | undefined, + protos.google.api.IMonitoredResourceDescriptor + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMonitoredResourceDescriptors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMonitoredResourceDescriptors request %j', request); + return this.innerApiCalls + .listMonitoredResourceDescriptors(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.IMonitoredResourceDescriptor[], + protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest | null, + protos.google.logging.v2.IListMonitoredResourceDescriptorsResponse, + ]) => { + this._log.info( + 'listMonitoredResourceDescriptors values %j', + response, + ); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listMonitoredResourceDescriptors`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMonitoredResourceDescriptorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMonitoredResourceDescriptorsStream( + request?: protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = + this._defaults['listMonitoredResourceDescriptors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listMonitoredResourceDescriptors stream %j', request); + return this.descriptors.page.listMonitoredResourceDescriptors.createStream( + this.innerApiCalls.listMonitoredResourceDescriptors as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listMonitoredResourceDescriptors`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.api.MonitoredResourceDescriptor|MonitoredResourceDescriptor}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/logging_service_v2.list_monitored_resource_descriptors.js + * region_tag:logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async + */ + listMonitoredResourceDescriptorsAsync( + request?: protos.google.logging.v2.IListMonitoredResourceDescriptorsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = + this._defaults['listMonitoredResourceDescriptors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listMonitoredResourceDescriptors iterate %j', request); + return this.descriptors.page.listMonitoredResourceDescriptors.asyncIterate( + this.innerApiCalls['listMonitoredResourceDescriptors'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + /** + * Lists the logs in projects, organizations, folders, or billing accounts. + * Only logs that have entries are listed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name to list logs for: + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * @param {string[]} [request.resourceNames] + * Optional. List of resource names to list logs for: + * + * * `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]` + * + * The resource name in the `parent` field is added to this list. + * @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 {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. + * @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 Array of string. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listLogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogs( + request?: protos.google.logging.v2.IListLogsRequest, + options?: CallOptions, + ): Promise< + [ + string[], + protos.google.logging.v2.IListLogsRequest | null, + protos.google.logging.v2.IListLogsResponse, + ] + >; + listLogs( + request: protos.google.logging.v2.IListLogsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListLogsRequest, + protos.google.logging.v2.IListLogsResponse | null | undefined, + string + >, + ): void; + listLogs( + request: protos.google.logging.v2.IListLogsRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListLogsRequest, + protos.google.logging.v2.IListLogsResponse | null | undefined, + string + >, + ): void; + listLogs( + request?: protos.google.logging.v2.IListLogsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListLogsRequest, + protos.google.logging.v2.IListLogsResponse | null | undefined, + string + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListLogsRequest, + protos.google.logging.v2.IListLogsResponse | null | undefined, + string + >, + ): Promise< + [ + string[], + protos.google.logging.v2.IListLogsRequest | null, + protos.google.logging.v2.IListLogsResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListLogsRequest, + protos.google.logging.v2.IListLogsResponse | null | undefined, + string + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLogs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLogs request %j', request); + return this.innerApiCalls + .listLogs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + string[], + protos.google.logging.v2.IListLogsRequest | null, + protos.google.logging.v2.IListLogsResponse, + ]) => { + this._log.info('listLogs values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listLogs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name to list logs for: + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * @param {string[]} [request.resourceNames] + * Optional. List of resource names to list logs for: + * + * * `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]` + * + * The resource name in the `parent` field is added to this list. + * @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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing string on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listLogsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogsStream( + request?: protos.google.logging.v2.IListLogsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLogs stream %j', request); + return this.descriptors.page.listLogs.createStream( + this.innerApiCalls.listLogs as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listLogs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name to list logs for: + * + * * `projects/[PROJECT_ID]` + * * `organizations/[ORGANIZATION_ID]` + * * `billingAccounts/[BILLING_ACCOUNT_ID]` + * * `folders/[FOLDER_ID]` + * @param {string[]} [request.resourceNames] + * Optional. List of resource names to list logs for: + * + * * `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]` + * + * The resource name in the `parent` field is added to this list. + * @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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * string. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/logging_service_v2.list_logs.js + * region_tag:logging_v2_generated_LoggingServiceV2_ListLogs_async + */ + listLogsAsync( + request?: protos.google.logging.v2.IListLogsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLogs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLogs iterate %j', request); + return this.descriptors.page.listLogs.asyncIterate( + this.innerApiCalls['listLogs'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified billingAccountCmekSettings resource name string. + * + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountCmekSettingsPath(billingAccount: string) { + return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({ + billing_account: billingAccount, + }); + } + + /** + * Parse the billing_account from BillingAccountCmekSettings resource. + * + * @param {string} billingAccountCmekSettingsName + * A fully-qualified path representing billing_account_cmekSettings resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountCmekSettingsName( + billingAccountCmekSettingsName: string, + ) { + return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match( + billingAccountCmekSettingsName, + ).billing_account; + } + + /** + * Return a fully-qualified billingAccountExclusion resource name string. + * + * @param {string} billing_account + * @param {string} exclusion + * @returns {string} Resource name string. + */ + billingAccountExclusionPath(billingAccount: string, exclusion: string) { + return this.pathTemplates.billingAccountExclusionPathTemplate.render({ + billing_account: billingAccount, + exclusion: exclusion, + }); + } + + /** + * Parse the billing_account from BillingAccountExclusion resource. + * + * @param {string} billingAccountExclusionName + * A fully-qualified path representing billing_account_exclusion resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountExclusionName( + billingAccountExclusionName: string, + ) { + return this.pathTemplates.billingAccountExclusionPathTemplate.match( + billingAccountExclusionName, + ).billing_account; + } + + /** + * Parse the exclusion from BillingAccountExclusion resource. + * + * @param {string} billingAccountExclusionName + * A fully-qualified path representing billing_account_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromBillingAccountExclusionName( + billingAccountExclusionName: string, + ) { + return this.pathTemplates.billingAccountExclusionPathTemplate.match( + billingAccountExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified billingAccountLocationBucket resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + billingAccountLocationBucketPath( + billingAccount: string, + location: string, + bucket: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({ + billing_account: billingAccount, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the billing_account from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified billingAccountLocationBucketLink resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + billingAccountLocationBucketLinkPath( + billingAccount: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render( + { + billing_account: billingAccount, + location: location, + bucket: bucket, + link: link, + }, + ); + } + + /** + * Parse the billing_account from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified billingAccountLocationBucketView resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + billingAccountLocationBucketViewPath( + billingAccount: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render( + { + billing_account: billingAccount, + location: location, + bucket: bucket, + view: view, + }, + ); + } + + /** + * Parse the billing_account from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified billingAccountLog resource name string. + * + * @param {string} billing_account + * @param {string} log + * @returns {string} Resource name string. + */ + billingAccountLogPath(billingAccount: string, log: string) { + return this.pathTemplates.billingAccountLogPathTemplate.render({ + billing_account: billingAccount, + log: log, + }); + } + + /** + * Parse the billing_account from BillingAccountLog resource. + * + * @param {string} billingAccountLogName + * A fully-qualified path representing billing_account_log resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLogName(billingAccountLogName: string) { + return this.pathTemplates.billingAccountLogPathTemplate.match( + billingAccountLogName, + ).billing_account; + } + + /** + * Parse the log from BillingAccountLog resource. + * + * @param {string} billingAccountLogName + * A fully-qualified path representing billing_account_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromBillingAccountLogName(billingAccountLogName: string) { + return this.pathTemplates.billingAccountLogPathTemplate.match( + billingAccountLogName, + ).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. + * + * @param {string} billing_account + * @param {string} sink + * @returns {string} Resource name string. + */ + billingAccountSinkPath(billingAccount: string, sink: string) { + return this.pathTemplates.billingAccountSinkPathTemplate.render({ + billing_account: billingAccount, + sink: sink, + }); + } + + /** + * Parse the billing_account from BillingAccountSink resource. + * + * @param {string} billingAccountSinkName + * A fully-qualified path representing billing_account_sink resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountSinkName( + billingAccountSinkName: string, + ) { + return this.pathTemplates.billingAccountSinkPathTemplate.match( + billingAccountSinkName, + ).billing_account; + } + + /** + * Parse the sink from BillingAccountSink resource. + * + * @param {string} billingAccountSinkName + * A fully-qualified path representing billing_account_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromBillingAccountSinkName(billingAccountSinkName: string) { + return this.pathTemplates.billingAccountSinkPathTemplate.match( + billingAccountSinkName, + ).sink; + } + + /** + * Return a fully-qualified folderCmekSettings resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderCmekSettingsPath(folder: string) { + return this.pathTemplates.folderCmekSettingsPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from FolderCmekSettings resource. + * + * @param {string} folderCmekSettingsName + * A fully-qualified path representing folder_cmekSettings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderCmekSettingsName(folderCmekSettingsName: string) { + return this.pathTemplates.folderCmekSettingsPathTemplate.match( + folderCmekSettingsName, + ).folder; + } + + /** + * Return a fully-qualified folderExclusion resource name string. + * + * @param {string} folder + * @param {string} exclusion + * @returns {string} Resource name string. + */ + folderExclusionPath(folder: string, exclusion: string) { + return this.pathTemplates.folderExclusionPathTemplate.render({ + folder: folder, + exclusion: exclusion, + }); + } + + /** + * Parse the folder from FolderExclusion resource. + * + * @param {string} folderExclusionName + * A fully-qualified path representing folder_exclusion resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderExclusionName(folderExclusionName: string) { + return this.pathTemplates.folderExclusionPathTemplate.match( + folderExclusionName, + ).folder; + } + + /** + * Parse the exclusion from FolderExclusion resource. + * + * @param {string} folderExclusionName + * A fully-qualified path representing folder_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromFolderExclusionName(folderExclusionName: string) { + return this.pathTemplates.folderExclusionPathTemplate.match( + folderExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified folderLocationBucket resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + folderLocationBucketPath(folder: string, location: string, bucket: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the folder from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified folderLocationBucketLink resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + folderLocationBucketLinkPath( + folder: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + link: link, + }); + } + + /** + * Parse the folder from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified folderLocationBucketView resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + folderLocationBucketViewPath( + folder: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + view: view, + }); + } + + /** + * Parse the folder from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified folderLog resource name string. + * + * @param {string} folder + * @param {string} log + * @returns {string} Resource name string. + */ + folderLogPath(folder: string, log: string) { + return this.pathTemplates.folderLogPathTemplate.render({ + folder: folder, + log: log, + }); + } + + /** + * Parse the folder from FolderLog resource. + * + * @param {string} folderLogName + * A fully-qualified path representing folder_log resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLogName(folderLogName: string) { + return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder; + } + + /** + * Parse the log from FolderLog resource. + * + * @param {string} folderLogName + * A fully-qualified path representing folder_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromFolderLogName(folderLogName: string) { + 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. + * + * @param {string} folder + * @param {string} sink + * @returns {string} Resource name string. + */ + folderSinkPath(folder: string, sink: string) { + return this.pathTemplates.folderSinkPathTemplate.render({ + folder: folder, + sink: sink, + }); + } + + /** + * Parse the folder from FolderSink resource. + * + * @param {string} folderSinkName + * A fully-qualified path representing folder_sink resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSinkName(folderSinkName: string) { + return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName) + .folder; + } + + /** + * Parse the sink from FolderSink resource. + * + * @param {string} folderSinkName + * A fully-qualified path representing folder_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromFolderSinkName(folderSinkName: string) { + return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; + } + + /** + * Return a fully-qualified logMetric resource name string. + * + * @param {string} project + * @param {string} metric + * @returns {string} Resource name string. + */ + logMetricPath(project: string, metric: string) { + return this.pathTemplates.logMetricPathTemplate.render({ + project: project, + metric: metric, + }); + } + + /** + * Parse the project from LogMetric resource. + * + * @param {string} logMetricName + * A fully-qualified path representing LogMetric resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLogMetricName(logMetricName: string) { + return this.pathTemplates.logMetricPathTemplate.match(logMetricName) + .project; + } + + /** + * Parse the metric from LogMetric resource. + * + * @param {string} logMetricName + * A fully-qualified path representing LogMetric resource. + * @returns {string} A string representing the metric. + */ + matchMetricFromLogMetricName(logMetricName: string) { + return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric; + } + + /** + * Return a fully-qualified organizationCmekSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationCmekSettingsPath(organization: string) { + return this.pathTemplates.organizationCmekSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationCmekSettings resource. + * + * @param {string} organizationCmekSettingsName + * A fully-qualified path representing organization_cmekSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCmekSettingsName( + organizationCmekSettingsName: string, + ) { + return this.pathTemplates.organizationCmekSettingsPathTemplate.match( + organizationCmekSettingsName, + ).organization; + } + + /** + * Return a fully-qualified organizationExclusion resource name string. + * + * @param {string} organization + * @param {string} exclusion + * @returns {string} Resource name string. + */ + organizationExclusionPath(organization: string, exclusion: string) { + return this.pathTemplates.organizationExclusionPathTemplate.render({ + organization: organization, + exclusion: exclusion, + }); + } + + /** + * Parse the organization from OrganizationExclusion resource. + * + * @param {string} organizationExclusionName + * A fully-qualified path representing organization_exclusion resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationExclusionName( + organizationExclusionName: string, + ) { + return this.pathTemplates.organizationExclusionPathTemplate.match( + organizationExclusionName, + ).organization; + } + + /** + * Parse the exclusion from OrganizationExclusion resource. + * + * @param {string} organizationExclusionName + * A fully-qualified path representing organization_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromOrganizationExclusionName( + organizationExclusionName: string, + ) { + return this.pathTemplates.organizationExclusionPathTemplate.match( + organizationExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified organizationLocationBucket resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + organizationLocationBucketPath( + organization: string, + location: string, + bucket: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.render({ + organization: organization, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the organization from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified organizationLocationBucketLink resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + organizationLocationBucketLinkPath( + organization: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.render( + { + organization: organization, + location: location, + bucket: bucket, + link: link, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified organizationLocationBucketView resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + organizationLocationBucketViewPath( + organization: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.render( + { + organization: organization, + location: location, + bucket: bucket, + view: view, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified organizationLog resource name string. + * + * @param {string} organization + * @param {string} log + * @returns {string} Resource name string. + */ + organizationLogPath(organization: string, log: string) { + return this.pathTemplates.organizationLogPathTemplate.render({ + organization: organization, + log: log, + }); + } + + /** + * Parse the organization from OrganizationLog resource. + * + * @param {string} organizationLogName + * A fully-qualified path representing organization_log resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLogName(organizationLogName: string) { + return this.pathTemplates.organizationLogPathTemplate.match( + organizationLogName, + ).organization; + } + + /** + * Parse the log from OrganizationLog resource. + * + * @param {string} organizationLogName + * A fully-qualified path representing organization_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromOrganizationLogName(organizationLogName: string) { + return this.pathTemplates.organizationLogPathTemplate.match( + organizationLogName, + ).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. + * + * @param {string} organization + * @param {string} sink + * @returns {string} Resource name string. + */ + organizationSinkPath(organization: string, sink: string) { + return this.pathTemplates.organizationSinkPathTemplate.render({ + organization: organization, + sink: sink, + }); + } + + /** + * Parse the organization from OrganizationSink resource. + * + * @param {string} organizationSinkName + * A fully-qualified path representing organization_sink resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSinkName(organizationSinkName: string) { + return this.pathTemplates.organizationSinkPathTemplate.match( + organizationSinkName, + ).organization; + } + + /** + * Parse the sink from OrganizationSink resource. + * + * @param {string} organizationSinkName + * A fully-qualified path representing organization_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromOrganizationSinkName(organizationSinkName: string) { + return this.pathTemplates.organizationSinkPathTemplate.match( + organizationSinkName, + ).sink; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCmekSettings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectCmekSettingsPath(project: string) { + return this.pathTemplates.projectCmekSettingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectCmekSettings resource. + * + * @param {string} projectCmekSettingsName + * A fully-qualified path representing project_cmekSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCmekSettingsName(projectCmekSettingsName: string) { + return this.pathTemplates.projectCmekSettingsPathTemplate.match( + projectCmekSettingsName, + ).project; + } + + /** + * Return a fully-qualified projectExclusion resource name string. + * + * @param {string} project + * @param {string} exclusion + * @returns {string} Resource name string. + */ + projectExclusionPath(project: string, exclusion: string) { + return this.pathTemplates.projectExclusionPathTemplate.render({ + project: project, + exclusion: exclusion, + }); + } + + /** + * Parse the project from ProjectExclusion resource. + * + * @param {string} projectExclusionName + * A fully-qualified path representing project_exclusion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectExclusionName(projectExclusionName: string) { + return this.pathTemplates.projectExclusionPathTemplate.match( + projectExclusionName, + ).project; + } + + /** + * Parse the exclusion from ProjectExclusion resource. + * + * @param {string} projectExclusionName + * A fully-qualified path representing project_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromProjectExclusionName(projectExclusionName: string) { + return this.pathTemplates.projectExclusionPathTemplate.match( + projectExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified projectLocationBucket resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + projectLocationBucketPath(project: string, location: string, bucket: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the project from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketName(projectLocationBucketName: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketName( + projectLocationBucketName: string, + ) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketName(projectLocationBucketName: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified projectLocationBucketLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + projectLocationBucketLinkPath( + project: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + link: link, + }); + } + + /** + * Parse the project from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified projectLocationBucketView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + projectLocationBucketViewPath( + project: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + view: view, + }); + } + + /** + * Parse the project from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified projectLog resource name string. + * + * @param {string} project + * @param {string} log + * @returns {string} Resource name string. + */ + projectLogPath(project: string, log: string) { + return this.pathTemplates.projectLogPathTemplate.render({ + project: project, + log: log, + }); + } + + /** + * Parse the project from ProjectLog resource. + * + * @param {string} projectLogName + * A fully-qualified path representing project_log resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLogName(projectLogName: string) { + return this.pathTemplates.projectLogPathTemplate.match(projectLogName) + .project; + } + + /** + * Parse the log from ProjectLog resource. + * + * @param {string} projectLogName + * A fully-qualified path representing project_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromProjectLogName(projectLogName: string) { + 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. + * + * @param {string} project + * @param {string} sink + * @returns {string} Resource name string. + */ + projectSinkPath(project: string, sink: string) { + return this.pathTemplates.projectSinkPathTemplate.render({ + project: project, + sink: sink, + }); + } + + /** + * Parse the project from ProjectSink resource. + * + * @param {string} projectSinkName + * A fully-qualified path representing project_sink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSinkName(projectSinkName: string) { + return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) + .project; + } + + /** + * Parse the sink from ProjectSink resource. + * + * @param {string} projectSinkName + * A fully-qualified path representing project_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromProjectSinkName(projectSinkName: string) { + return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) + .sink; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.loggingServiceV2Stub && !this._terminated) { + return this.loggingServiceV2Stub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-logging-api/src/v2/logging_service_v2_client_config.json b/packages/google-cloud-logging-api/src/v2/logging_service_v2_client_config.json new file mode 100644 index 000000000000..92a5f8ceb51f --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/logging_service_v2_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.logging.v2.LoggingServiceV2": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "DeleteLog": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "WriteLogEntries": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "ListLogEntries": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "ListMonitoredResourceDescriptors": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "ListLogs": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "TailLogEntries": { + "timeout_millis": 3600000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-logging-api/src/v2/logging_service_v2_proto_list.json b/packages/google-cloud-logging-api/src/v2/logging_service_v2_proto_list.json new file mode 100644 index 000000000000..fd41d3bfa051 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/logging_service_v2_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/logging/type/http_request.proto", + "../../protos/google/logging/type/log_severity.proto", + "../../protos/google/logging/v2/log_entry.proto", + "../../protos/google/logging/v2/logging.proto", + "../../protos/google/logging/v2/logging_config.proto", + "../../protos/google/logging/v2/logging_metrics.proto" +] diff --git a/packages/google-cloud-logging-api/src/v2/metrics_service_v2_client.ts b/packages/google-cloud-logging-api/src/v2/metrics_service_v2_client.ts new file mode 100644 index 000000000000..a39e1766651a --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/metrics_service_v2_client.ts @@ -0,0 +1,2927 @@ +// Copyright 2026 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import { Transform } from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v2/metrics_service_v2_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './metrics_service_v2_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for configuring logs-based metrics. + * @class + * @memberof v2 + */ +export class MetricsServiceV2Client { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: { [method: string]: gax.CallSettings }; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('logging-api'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: { [name: string]: Function }; + pathTemplates: { [name: string]: gax.PathTemplate }; + metricsServiceV2Stub?: Promise<{ [name: string]: Function }>; + + /** + * Construct an instance of MetricsServiceV2Client. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MetricsServiceV2Client({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback, + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MetricsServiceV2Client; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.', + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'logging.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/cmekSettings', + ), + billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/exclusions/{exclusion}', + ), + billingAccountLocationBucketPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}', + ), + billingAccountLocationBucketLinkPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}', + ), + billingAccountLocationBucketViewPathTemplate: + new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/cmekSettings', + ), + folderExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/exclusions/{exclusion}', + ), + folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}', + ), + folderLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}', + ), + folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + logMetricPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/metrics/{metric}', + ), + organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/cmekSettings', + ), + organizationExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/exclusions/{exclusion}', + ), + organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}', + ), + organizationLocationBucketLinkPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}', + ), + organizationLocationBucketViewPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}', + ), + projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/cmekSettings', + ), + projectExclusionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/exclusions/{exclusion}', + ), + projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}', + ), + projectLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}/links/{link}', + ), + projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/buckets/{bucket}/views/{view}', + ), + 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}', + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listLogMetrics: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'metrics', + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.logging.v2.MetricsServiceV2', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + { 'x-goog-api-client': clientHeader.join(' ') }, + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.metricsServiceV2Stub) { + return this.metricsServiceV2Stub; + } + + // Put together the "service stub" for + // google.logging.v2.MetricsServiceV2. + this.metricsServiceV2Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.logging.v2.MetricsServiceV2', + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.logging.v2.MetricsServiceV2, + this._opts, + this._providedCustomServicePath, + ) as Promise<{ [method: string]: Function }>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const metricsServiceV2StubMethods = [ + 'listLogMetrics', + 'getLogMetric', + 'createLogMetric', + 'updateLogMetric', + 'deleteLogMetric', + ]; + for (const methodName of metricsServiceV2StubMethods) { + const callPromise = this.metricsServiceV2Stub.then( + (stub) => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + }, + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback, + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.metricsServiceV2Stub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'logging.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning', + ); + } + return 'logging.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/cloud-platform.read-only', + 'https://www.googleapis.com/auth/logging.admin', + 'https://www.googleapis.com/auth/logging.read', + 'https://www.googleapis.com/auth/logging.write', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback, + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets a logs-based metric. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.metricName + * Required. The resource name of the desired metric: + * + * "projects/[PROJECT_ID]/metrics/[METRIC_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. + * The first element of the array is an object representing {@link protos.google.logging.v2.LogMetric|LogMetric}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/metrics_service_v2.get_log_metric.js + * region_tag:logging_v2_generated_MetricsServiceV2_GetLogMetric_async + */ + getLogMetric( + request?: protos.google.logging.v2.IGetLogMetricRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | undefined, + {} | undefined, + ] + >; + getLogMetric( + request: protos.google.logging.v2.IGetLogMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + getLogMetric( + request: protos.google.logging.v2.IGetLogMetricRequest, + callback: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + getLogMetric( + request?: protos.google.logging.v2.IGetLogMetricRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + metric_name: request.metricName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('getLogMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getLogMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getLogMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IGetLogMetricRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getLogMetric response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates a logs-based metric. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project in which to create the metric: + * + * "projects/[PROJECT_ID]" + * + * The new metric must be provided in the request. + * @param {google.logging.v2.LogMetric} request.metric + * Required. The new logs-based metric, which must not have an identifier that + * already exists. + * @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 {@link protos.google.logging.v2.LogMetric|LogMetric}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/metrics_service_v2.create_log_metric.js + * region_tag:logging_v2_generated_MetricsServiceV2_CreateLogMetric_async + */ + createLogMetric( + request?: protos.google.logging.v2.ICreateLogMetricRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | undefined, + {} | undefined, + ] + >; + createLogMetric( + request: protos.google.logging.v2.ICreateLogMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + createLogMetric( + request: protos.google.logging.v2.ICreateLogMetricRequest, + callback: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + createLogMetric( + request?: protos.google.logging.v2.ICreateLogMetricRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('createLogMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createLogMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createLogMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.ICreateLogMetricRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createLogMetric response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Creates or updates a logs-based metric. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.metricName + * Required. The resource name of the metric to update: + * + * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * + * The updated metric must be provided in the request and it's + * `name` field must be the same as `[METRIC_ID]` If the metric + * does not exist in `[PROJECT_ID]`, then a new metric is created. + * @param {google.logging.v2.LogMetric} request.metric + * Required. The updated metric. + * @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 {@link protos.google.logging.v2.LogMetric|LogMetric}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/metrics_service_v2.update_log_metric.js + * region_tag:logging_v2_generated_MetricsServiceV2_UpdateLogMetric_async + */ + updateLogMetric( + request?: protos.google.logging.v2.IUpdateLogMetricRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | undefined, + {} | undefined, + ] + >; + updateLogMetric( + request: protos.google.logging.v2.IUpdateLogMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateLogMetric( + request: protos.google.logging.v2.IUpdateLogMetricRequest, + callback: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + updateLogMetric( + request?: protos.google.logging.v2.IUpdateLogMetricRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + metric_name: request.metricName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('updateLogMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateLogMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateLogMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.logging.v2.ILogMetric, + protos.google.logging.v2.IUpdateLogMetricRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateLogMetric response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + /** + * Deletes a logs-based metric. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.metricName + * Required. The resource name of the metric to delete: + * + * "projects/[PROJECT_ID]/metrics/[METRIC_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. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v2/metrics_service_v2.delete_log_metric.js + * region_tag:logging_v2_generated_MetricsServiceV2_DeleteLogMetric_async + */ + deleteLogMetric( + request?: protos.google.logging.v2.IDeleteLogMetricRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | undefined, + {} | undefined, + ] + >; + deleteLogMetric( + request: protos.google.logging.v2.IDeleteLogMetricRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteLogMetric( + request: protos.google.logging.v2.IDeleteLogMetricRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): void; + deleteLogMetric( + request?: protos.google.logging.v2.IDeleteLogMetricRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | null | undefined, + {} | null | undefined + >, + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | 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'] = + this._gaxModule.routingHeader.fromParams({ + metric_name: request.metricName ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('deleteLogMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteLogMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteLogMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.logging.v2.IDeleteLogMetricRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteLogMetric response %j', response); + return [response, options, rawResponse]; + }, + ) + .catch((error: any) => { + if ( + error && + 'statusDetails' in error && + error.statusDetails instanceof Array + ) { + const protos = this._gaxModule.protobuf.Root.fromJSON( + jsonProtos, + ) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray( + error.statusDetails, + protos, + ); + } + throw error; + }); + } + + /** + * Lists logs-based metrics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project containing the metrics: + * + * "projects/[PROJECT_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. + * @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] + * 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 Array of {@link protos.google.logging.v2.LogMetric|LogMetric}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listLogMetricsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogMetrics( + request?: protos.google.logging.v2.IListLogMetricsRequest, + options?: CallOptions, + ): Promise< + [ + protos.google.logging.v2.ILogMetric[], + protos.google.logging.v2.IListLogMetricsRequest | null, + protos.google.logging.v2.IListLogMetricsResponse, + ] + >; + listLogMetrics( + request: protos.google.logging.v2.IListLogMetricsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.logging.v2.IListLogMetricsRequest, + protos.google.logging.v2.IListLogMetricsResponse | null | undefined, + protos.google.logging.v2.ILogMetric + >, + ): void; + listLogMetrics( + request: protos.google.logging.v2.IListLogMetricsRequest, + callback: PaginationCallback< + protos.google.logging.v2.IListLogMetricsRequest, + protos.google.logging.v2.IListLogMetricsResponse | null | undefined, + protos.google.logging.v2.ILogMetric + >, + ): void; + listLogMetrics( + request?: protos.google.logging.v2.IListLogMetricsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.logging.v2.IListLogMetricsRequest, + protos.google.logging.v2.IListLogMetricsResponse | null | undefined, + protos.google.logging.v2.ILogMetric + >, + callback?: PaginationCallback< + protos.google.logging.v2.IListLogMetricsRequest, + protos.google.logging.v2.IListLogMetricsResponse | null | undefined, + protos.google.logging.v2.ILogMetric + >, + ): Promise< + [ + protos.google.logging.v2.ILogMetric[], + protos.google.logging.v2.IListLogMetricsRequest | null, + protos.google.logging.v2.IListLogMetricsResponse, + ] + > | 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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize().catch((err) => { + throw err; + }); + const wrappedCallback: + | PaginationCallback< + protos.google.logging.v2.IListLogMetricsRequest, + protos.google.logging.v2.IListLogMetricsResponse | null | undefined, + protos.google.logging.v2.ILogMetric + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLogMetrics values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLogMetrics request %j', request); + return this.innerApiCalls + .listLogMetrics(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.logging.v2.ILogMetric[], + protos.google.logging.v2.IListLogMetricsRequest | null, + protos.google.logging.v2.IListLogMetricsResponse, + ]) => { + this._log.info('listLogMetrics values %j', response); + return [response, input, output]; + }, + ); + } + + /** + * Equivalent to `listLogMetrics`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project containing the metrics: + * + * "projects/[PROJECT_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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.logging.v2.LogMetric|LogMetric} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listLogMetricsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listLogMetricsStream( + request?: protos.google.logging.v2.IListLogMetricsRequest, + options?: CallOptions, + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLogMetrics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLogMetrics stream %j', request); + return this.descriptors.page.listLogMetrics.createStream( + this.innerApiCalls.listLogMetrics as GaxCall, + request, + callSettings, + ); + } + + /** + * Equivalent to `listLogMetrics`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project containing the metrics: + * + * "projects/[PROJECT_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. + * @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] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.logging.v2.LogMetric|LogMetric}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v2/metrics_service_v2.list_log_metrics.js + * region_tag:logging_v2_generated_MetricsServiceV2_ListLogMetrics_async + */ + listLogMetricsAsync( + request?: protos.google.logging.v2.IListLogMetricsRequest, + options?: CallOptions, + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listLogMetrics']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch((err) => { + throw err; + }); + this._log.info('listLogMetrics iterate %j', request); + return this.descriptors.page.listLogMetrics.asyncIterate( + this.innerApiCalls['listLogMetrics'] as GaxCall, + request as {}, + callSettings, + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified billingAccountCmekSettings resource name string. + * + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountCmekSettingsPath(billingAccount: string) { + return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({ + billing_account: billingAccount, + }); + } + + /** + * Parse the billing_account from BillingAccountCmekSettings resource. + * + * @param {string} billingAccountCmekSettingsName + * A fully-qualified path representing billing_account_cmekSettings resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountCmekSettingsName( + billingAccountCmekSettingsName: string, + ) { + return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match( + billingAccountCmekSettingsName, + ).billing_account; + } + + /** + * Return a fully-qualified billingAccountExclusion resource name string. + * + * @param {string} billing_account + * @param {string} exclusion + * @returns {string} Resource name string. + */ + billingAccountExclusionPath(billingAccount: string, exclusion: string) { + return this.pathTemplates.billingAccountExclusionPathTemplate.render({ + billing_account: billingAccount, + exclusion: exclusion, + }); + } + + /** + * Parse the billing_account from BillingAccountExclusion resource. + * + * @param {string} billingAccountExclusionName + * A fully-qualified path representing billing_account_exclusion resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountExclusionName( + billingAccountExclusionName: string, + ) { + return this.pathTemplates.billingAccountExclusionPathTemplate.match( + billingAccountExclusionName, + ).billing_account; + } + + /** + * Parse the exclusion from BillingAccountExclusion resource. + * + * @param {string} billingAccountExclusionName + * A fully-qualified path representing billing_account_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromBillingAccountExclusionName( + billingAccountExclusionName: string, + ) { + return this.pathTemplates.billingAccountExclusionPathTemplate.match( + billingAccountExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified billingAccountLocationBucket resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + billingAccountLocationBucketPath( + billingAccount: string, + location: string, + bucket: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({ + billing_account: billingAccount, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the billing_account from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucket resource. + * + * @param {string} billingAccountLocationBucketName + * A fully-qualified path representing billing_account_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketName( + billingAccountLocationBucketName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketPathTemplate.match( + billingAccountLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified billingAccountLocationBucketLink resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + billingAccountLocationBucketLinkPath( + billingAccount: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render( + { + billing_account: billingAccount, + location: location, + bucket: bucket, + link: link, + }, + ); + } + + /** + * Parse the billing_account from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from BillingAccountLocationBucketLink resource. + * + * @param {string} billingAccountLocationBucketLinkName + * A fully-qualified path representing billing_account_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromBillingAccountLocationBucketLinkName( + billingAccountLocationBucketLinkName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match( + billingAccountLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified billingAccountLocationBucketView resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + billingAccountLocationBucketViewPath( + billingAccount: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render( + { + billing_account: billingAccount, + location: location, + bucket: bucket, + view: view, + }, + ); + } + + /** + * Parse the billing_account from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from BillingAccountLocationBucketView resource. + * + * @param {string} billingAccountLocationBucketViewName + * A fully-qualified path representing billing_account_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromBillingAccountLocationBucketViewName( + billingAccountLocationBucketViewName: string, + ) { + return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match( + billingAccountLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified billingAccountLog resource name string. + * + * @param {string} billing_account + * @param {string} log + * @returns {string} Resource name string. + */ + billingAccountLogPath(billingAccount: string, log: string) { + return this.pathTemplates.billingAccountLogPathTemplate.render({ + billing_account: billingAccount, + log: log, + }); + } + + /** + * Parse the billing_account from BillingAccountLog resource. + * + * @param {string} billingAccountLogName + * A fully-qualified path representing billing_account_log resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLogName(billingAccountLogName: string) { + return this.pathTemplates.billingAccountLogPathTemplate.match( + billingAccountLogName, + ).billing_account; + } + + /** + * Parse the log from BillingAccountLog resource. + * + * @param {string} billingAccountLogName + * A fully-qualified path representing billing_account_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromBillingAccountLogName(billingAccountLogName: string) { + return this.pathTemplates.billingAccountLogPathTemplate.match( + billingAccountLogName, + ).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. + * + * @param {string} billing_account + * @param {string} sink + * @returns {string} Resource name string. + */ + billingAccountSinkPath(billingAccount: string, sink: string) { + return this.pathTemplates.billingAccountSinkPathTemplate.render({ + billing_account: billingAccount, + sink: sink, + }); + } + + /** + * Parse the billing_account from BillingAccountSink resource. + * + * @param {string} billingAccountSinkName + * A fully-qualified path representing billing_account_sink resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountSinkName( + billingAccountSinkName: string, + ) { + return this.pathTemplates.billingAccountSinkPathTemplate.match( + billingAccountSinkName, + ).billing_account; + } + + /** + * Parse the sink from BillingAccountSink resource. + * + * @param {string} billingAccountSinkName + * A fully-qualified path representing billing_account_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromBillingAccountSinkName(billingAccountSinkName: string) { + return this.pathTemplates.billingAccountSinkPathTemplate.match( + billingAccountSinkName, + ).sink; + } + + /** + * Return a fully-qualified folderCmekSettings resource name string. + * + * @param {string} folder + * @returns {string} Resource name string. + */ + folderCmekSettingsPath(folder: string) { + return this.pathTemplates.folderCmekSettingsPathTemplate.render({ + folder: folder, + }); + } + + /** + * Parse the folder from FolderCmekSettings resource. + * + * @param {string} folderCmekSettingsName + * A fully-qualified path representing folder_cmekSettings resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderCmekSettingsName(folderCmekSettingsName: string) { + return this.pathTemplates.folderCmekSettingsPathTemplate.match( + folderCmekSettingsName, + ).folder; + } + + /** + * Return a fully-qualified folderExclusion resource name string. + * + * @param {string} folder + * @param {string} exclusion + * @returns {string} Resource name string. + */ + folderExclusionPath(folder: string, exclusion: string) { + return this.pathTemplates.folderExclusionPathTemplate.render({ + folder: folder, + exclusion: exclusion, + }); + } + + /** + * Parse the folder from FolderExclusion resource. + * + * @param {string} folderExclusionName + * A fully-qualified path representing folder_exclusion resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderExclusionName(folderExclusionName: string) { + return this.pathTemplates.folderExclusionPathTemplate.match( + folderExclusionName, + ).folder; + } + + /** + * Parse the exclusion from FolderExclusion resource. + * + * @param {string} folderExclusionName + * A fully-qualified path representing folder_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromFolderExclusionName(folderExclusionName: string) { + return this.pathTemplates.folderExclusionPathTemplate.match( + folderExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified folderLocationBucket resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + folderLocationBucketPath(folder: string, location: string, bucket: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the folder from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucket resource. + * + * @param {string} folderLocationBucketName + * A fully-qualified path representing folder_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketName(folderLocationBucketName: string) { + return this.pathTemplates.folderLocationBucketPathTemplate.match( + folderLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified folderLocationBucketLink resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + folderLocationBucketLinkPath( + folder: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + link: link, + }); + } + + /** + * Parse the folder from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from FolderLocationBucketLink resource. + * + * @param {string} folderLocationBucketLinkName + * A fully-qualified path representing folder_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromFolderLocationBucketLinkName( + folderLocationBucketLinkName: string, + ) { + return this.pathTemplates.folderLocationBucketLinkPathTemplate.match( + folderLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified folderLocationBucketView resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + folderLocationBucketViewPath( + folder: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.render({ + folder: folder, + location: location, + bucket: bucket, + view: view, + }); + } + + /** + * Parse the folder from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).folder; + } + + /** + * Parse the location from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from FolderLocationBucketView resource. + * + * @param {string} folderLocationBucketViewName + * A fully-qualified path representing folder_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromFolderLocationBucketViewName( + folderLocationBucketViewName: string, + ) { + return this.pathTemplates.folderLocationBucketViewPathTemplate.match( + folderLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified folderLog resource name string. + * + * @param {string} folder + * @param {string} log + * @returns {string} Resource name string. + */ + folderLogPath(folder: string, log: string) { + return this.pathTemplates.folderLogPathTemplate.render({ + folder: folder, + log: log, + }); + } + + /** + * Parse the folder from FolderLog resource. + * + * @param {string} folderLogName + * A fully-qualified path representing folder_log resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLogName(folderLogName: string) { + return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder; + } + + /** + * Parse the log from FolderLog resource. + * + * @param {string} folderLogName + * A fully-qualified path representing folder_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromFolderLogName(folderLogName: string) { + 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. + * + * @param {string} folder + * @param {string} sink + * @returns {string} Resource name string. + */ + folderSinkPath(folder: string, sink: string) { + return this.pathTemplates.folderSinkPathTemplate.render({ + folder: folder, + sink: sink, + }); + } + + /** + * Parse the folder from FolderSink resource. + * + * @param {string} folderSinkName + * A fully-qualified path representing folder_sink resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSinkName(folderSinkName: string) { + return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName) + .folder; + } + + /** + * Parse the sink from FolderSink resource. + * + * @param {string} folderSinkName + * A fully-qualified path representing folder_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromFolderSinkName(folderSinkName: string) { + return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink; + } + + /** + * Return a fully-qualified logMetric resource name string. + * + * @param {string} project + * @param {string} metric + * @returns {string} Resource name string. + */ + logMetricPath(project: string, metric: string) { + return this.pathTemplates.logMetricPathTemplate.render({ + project: project, + metric: metric, + }); + } + + /** + * Parse the project from LogMetric resource. + * + * @param {string} logMetricName + * A fully-qualified path representing LogMetric resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLogMetricName(logMetricName: string) { + return this.pathTemplates.logMetricPathTemplate.match(logMetricName) + .project; + } + + /** + * Parse the metric from LogMetric resource. + * + * @param {string} logMetricName + * A fully-qualified path representing LogMetric resource. + * @returns {string} A string representing the metric. + */ + matchMetricFromLogMetricName(logMetricName: string) { + return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric; + } + + /** + * Return a fully-qualified organizationCmekSettings resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationCmekSettingsPath(organization: string) { + return this.pathTemplates.organizationCmekSettingsPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from OrganizationCmekSettings resource. + * + * @param {string} organizationCmekSettingsName + * A fully-qualified path representing organization_cmekSettings resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationCmekSettingsName( + organizationCmekSettingsName: string, + ) { + return this.pathTemplates.organizationCmekSettingsPathTemplate.match( + organizationCmekSettingsName, + ).organization; + } + + /** + * Return a fully-qualified organizationExclusion resource name string. + * + * @param {string} organization + * @param {string} exclusion + * @returns {string} Resource name string. + */ + organizationExclusionPath(organization: string, exclusion: string) { + return this.pathTemplates.organizationExclusionPathTemplate.render({ + organization: organization, + exclusion: exclusion, + }); + } + + /** + * Parse the organization from OrganizationExclusion resource. + * + * @param {string} organizationExclusionName + * A fully-qualified path representing organization_exclusion resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationExclusionName( + organizationExclusionName: string, + ) { + return this.pathTemplates.organizationExclusionPathTemplate.match( + organizationExclusionName, + ).organization; + } + + /** + * Parse the exclusion from OrganizationExclusion resource. + * + * @param {string} organizationExclusionName + * A fully-qualified path representing organization_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromOrganizationExclusionName( + organizationExclusionName: string, + ) { + return this.pathTemplates.organizationExclusionPathTemplate.match( + organizationExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified organizationLocationBucket resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + organizationLocationBucketPath( + organization: string, + location: string, + bucket: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.render({ + organization: organization, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the organization from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucket resource. + * + * @param {string} organizationLocationBucketName + * A fully-qualified path representing organization_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketName( + organizationLocationBucketName: string, + ) { + return this.pathTemplates.organizationLocationBucketPathTemplate.match( + organizationLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified organizationLocationBucketLink resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + organizationLocationBucketLinkPath( + organization: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.render( + { + organization: organization, + location: location, + bucket: bucket, + link: link, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from OrganizationLocationBucketLink resource. + * + * @param {string} organizationLocationBucketLinkName + * A fully-qualified path representing organization_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromOrganizationLocationBucketLinkName( + organizationLocationBucketLinkName: string, + ) { + return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match( + organizationLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified organizationLocationBucketView resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + organizationLocationBucketViewPath( + organization: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.render( + { + organization: organization, + location: location, + bucket: bucket, + view: view, + }, + ); + } + + /** + * Parse the organization from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).organization; + } + + /** + * Parse the location from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from OrganizationLocationBucketView resource. + * + * @param {string} organizationLocationBucketViewName + * A fully-qualified path representing organization_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromOrganizationLocationBucketViewName( + organizationLocationBucketViewName: string, + ) { + return this.pathTemplates.organizationLocationBucketViewPathTemplate.match( + organizationLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified organizationLog resource name string. + * + * @param {string} organization + * @param {string} log + * @returns {string} Resource name string. + */ + organizationLogPath(organization: string, log: string) { + return this.pathTemplates.organizationLogPathTemplate.render({ + organization: organization, + log: log, + }); + } + + /** + * Parse the organization from OrganizationLog resource. + * + * @param {string} organizationLogName + * A fully-qualified path representing organization_log resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLogName(organizationLogName: string) { + return this.pathTemplates.organizationLogPathTemplate.match( + organizationLogName, + ).organization; + } + + /** + * Parse the log from OrganizationLog resource. + * + * @param {string} organizationLogName + * A fully-qualified path representing organization_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromOrganizationLogName(organizationLogName: string) { + return this.pathTemplates.organizationLogPathTemplate.match( + organizationLogName, + ).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. + * + * @param {string} organization + * @param {string} sink + * @returns {string} Resource name string. + */ + organizationSinkPath(organization: string, sink: string) { + return this.pathTemplates.organizationSinkPathTemplate.render({ + organization: organization, + sink: sink, + }); + } + + /** + * Parse the organization from OrganizationSink resource. + * + * @param {string} organizationSinkName + * A fully-qualified path representing organization_sink resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSinkName(organizationSinkName: string) { + return this.pathTemplates.organizationSinkPathTemplate.match( + organizationSinkName, + ).organization; + } + + /** + * Parse the sink from OrganizationSink resource. + * + * @param {string} organizationSinkName + * A fully-qualified path representing organization_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromOrganizationSinkName(organizationSinkName: string) { + return this.pathTemplates.organizationSinkPathTemplate.match( + organizationSinkName, + ).sink; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectCmekSettings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectCmekSettingsPath(project: string) { + return this.pathTemplates.projectCmekSettingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectCmekSettings resource. + * + * @param {string} projectCmekSettingsName + * A fully-qualified path representing project_cmekSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectCmekSettingsName(projectCmekSettingsName: string) { + return this.pathTemplates.projectCmekSettingsPathTemplate.match( + projectCmekSettingsName, + ).project; + } + + /** + * Return a fully-qualified projectExclusion resource name string. + * + * @param {string} project + * @param {string} exclusion + * @returns {string} Resource name string. + */ + projectExclusionPath(project: string, exclusion: string) { + return this.pathTemplates.projectExclusionPathTemplate.render({ + project: project, + exclusion: exclusion, + }); + } + + /** + * Parse the project from ProjectExclusion resource. + * + * @param {string} projectExclusionName + * A fully-qualified path representing project_exclusion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectExclusionName(projectExclusionName: string) { + return this.pathTemplates.projectExclusionPathTemplate.match( + projectExclusionName, + ).project; + } + + /** + * Parse the exclusion from ProjectExclusion resource. + * + * @param {string} projectExclusionName + * A fully-qualified path representing project_exclusion resource. + * @returns {string} A string representing the exclusion. + */ + matchExclusionFromProjectExclusionName(projectExclusionName: string) { + return this.pathTemplates.projectExclusionPathTemplate.match( + projectExclusionName, + ).exclusion; + } + + /** + * Return a fully-qualified projectLocationBucket resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @returns {string} Resource name string. + */ + projectLocationBucketPath(project: string, location: string, bucket: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + }); + } + + /** + * Parse the project from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketName(projectLocationBucketName: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketName( + projectLocationBucketName: string, + ) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucket resource. + * + * @param {string} projectLocationBucketName + * A fully-qualified path representing project_location_bucket resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketName(projectLocationBucketName: string) { + return this.pathTemplates.projectLocationBucketPathTemplate.match( + projectLocationBucketName, + ).bucket; + } + + /** + * Return a fully-qualified projectLocationBucketLink resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @param {string} link + * @returns {string} Resource name string. + */ + projectLocationBucketLinkPath( + project: string, + location: string, + bucket: string, + link: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + link: link, + }); + } + + /** + * Parse the project from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).bucket; + } + + /** + * Parse the link from ProjectLocationBucketLink resource. + * + * @param {string} projectLocationBucketLinkName + * A fully-qualified path representing project_location_bucket_link resource. + * @returns {string} A string representing the link. + */ + matchLinkFromProjectLocationBucketLinkName( + projectLocationBucketLinkName: string, + ) { + return this.pathTemplates.projectLocationBucketLinkPathTemplate.match( + projectLocationBucketLinkName, + ).link; + } + + /** + * Return a fully-qualified projectLocationBucketView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} bucket + * @param {string} view + * @returns {string} Resource name string. + */ + projectLocationBucketViewPath( + project: string, + location: string, + bucket: string, + view: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.render({ + project: project, + location: location, + bucket: bucket, + view: view, + }); + } + + /** + * Parse the project from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).project; + } + + /** + * Parse the location from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).location; + } + + /** + * Parse the bucket from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the bucket. + */ + matchBucketFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).bucket; + } + + /** + * Parse the view from ProjectLocationBucketView resource. + * + * @param {string} projectLocationBucketViewName + * A fully-qualified path representing project_location_bucket_view resource. + * @returns {string} A string representing the view. + */ + matchViewFromProjectLocationBucketViewName( + projectLocationBucketViewName: string, + ) { + return this.pathTemplates.projectLocationBucketViewPathTemplate.match( + projectLocationBucketViewName, + ).view; + } + + /** + * Return a fully-qualified projectLog resource name string. + * + * @param {string} project + * @param {string} log + * @returns {string} Resource name string. + */ + projectLogPath(project: string, log: string) { + return this.pathTemplates.projectLogPathTemplate.render({ + project: project, + log: log, + }); + } + + /** + * Parse the project from ProjectLog resource. + * + * @param {string} projectLogName + * A fully-qualified path representing project_log resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLogName(projectLogName: string) { + return this.pathTemplates.projectLogPathTemplate.match(projectLogName) + .project; + } + + /** + * Parse the log from ProjectLog resource. + * + * @param {string} projectLogName + * A fully-qualified path representing project_log resource. + * @returns {string} A string representing the log. + */ + matchLogFromProjectLogName(projectLogName: string) { + 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. + * + * @param {string} project + * @param {string} sink + * @returns {string} Resource name string. + */ + projectSinkPath(project: string, sink: string) { + return this.pathTemplates.projectSinkPathTemplate.render({ + project: project, + sink: sink, + }); + } + + /** + * Parse the project from ProjectSink resource. + * + * @param {string} projectSinkName + * A fully-qualified path representing project_sink resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSinkName(projectSinkName: string) { + return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) + .project; + } + + /** + * Parse the sink from ProjectSink resource. + * + * @param {string} projectSinkName + * A fully-qualified path representing project_sink resource. + * @returns {string} A string representing the sink. + */ + matchSinkFromProjectSinkName(projectSinkName: string) { + return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName) + .sink; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.metricsServiceV2Stub && !this._terminated) { + return this.metricsServiceV2Stub.then((stub) => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-logging-api/src/v2/metrics_service_v2_client_config.json b/packages/google-cloud-logging-api/src/v2/metrics_service_v2_client_config.json new file mode 100644 index 000000000000..014688ab775a --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/metrics_service_v2_client_config.json @@ -0,0 +1,56 @@ +{ + "interfaces": { + "google.logging.v2.MetricsServiceV2": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListLogMetrics": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "GetLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "CreateLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "DeleteLogMetric": { + "timeout_millis": 60000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-logging-api/src/v2/metrics_service_v2_proto_list.json b/packages/google-cloud-logging-api/src/v2/metrics_service_v2_proto_list.json new file mode 100644 index 000000000000..fd41d3bfa051 --- /dev/null +++ b/packages/google-cloud-logging-api/src/v2/metrics_service_v2_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/logging/type/http_request.proto", + "../../protos/google/logging/type/log_severity.proto", + "../../protos/google/logging/v2/log_entry.proto", + "../../protos/google/logging/v2/logging.proto", + "../../protos/google/logging/v2/logging_config.proto", + "../../protos/google/logging/v2/logging_metrics.proto" +] diff --git a/packages/google-cloud-logging-api/system-test/fixtures/sample/src/index.js b/packages/google-cloud-logging-api/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..63ba0363fd39 --- /dev/null +++ b/packages/google-cloud-logging-api/system-test/fixtures/sample/src/index.js @@ -0,0 +1,29 @@ +// Copyright 2026 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. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const logging = require('@google-cloud/logging-api'); + +function main() { + const configServiceV2Client = new logging.ConfigServiceV2Client(); + const loggingServiceV2Client = new logging.LoggingServiceV2Client(); + const metricsServiceV2Client = new logging.MetricsServiceV2Client(); +} + +main(); diff --git a/packages/google-cloud-logging-api/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-logging-api/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..2079027ef92c --- /dev/null +++ b/packages/google-cloud-logging-api/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,48 @@ +// Copyright 2026 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. ** + +import { + ConfigServiceV2Client, + LoggingServiceV2Client, + MetricsServiceV2Client, +} from '@google-cloud/logging-api'; + +// check that the client class type name can be used +function doStuffWithConfigServiceV2Client(client: ConfigServiceV2Client) { + client.close(); +} +function doStuffWithLoggingServiceV2Client(client: LoggingServiceV2Client) { + client.close(); +} +function doStuffWithMetricsServiceV2Client(client: MetricsServiceV2Client) { + client.close(); +} + +function main() { + // check that the client instance can be created + const configServiceV2Client = new ConfigServiceV2Client(); + doStuffWithConfigServiceV2Client(configServiceV2Client); + // check that the client instance can be created + const loggingServiceV2Client = new LoggingServiceV2Client(); + doStuffWithLoggingServiceV2Client(loggingServiceV2Client); + // check that the client instance can be created + const metricsServiceV2Client = new MetricsServiceV2Client(); + doStuffWithMetricsServiceV2Client(metricsServiceV2Client); +} + +main(); diff --git a/packages/google-cloud-logging-api/system-test/install.ts b/packages/google-cloud-logging-api/system-test/install.ts new file mode 100644 index 000000000000..ccf167042d2e --- /dev/null +++ b/packages/google-cloud-logging-api/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2026 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. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts', + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + cjs: readFileSync( + './system-test/fixtures/sample/src/index.js', + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-logging-api/test/gapic_config_service_v2_v2.ts b/packages/google-cloud-logging-api/test/gapic_config_service_v2_v2.ts new file mode 100644 index 000000000000..74d54c9ce69d --- /dev/null +++ b/packages/google-cloud-logging-api/test/gapic_config_service_v2_v2.ts @@ -0,0 +1,8167 @@ +// Copyright 2026 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as configservicev2Module from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf, LROperation, operationsProtos } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : 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, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.ConfigServiceV2Client', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'logging.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + configservicev2Module.v2.ConfigServiceV2Client.servicePath; + assert.strictEqual(servicePath, 'logging.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + configservicev2Module.v2.ConfigServiceV2Client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'logging.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new configservicev2Module.v2.ConfigServiceV2Client(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new configservicev2Module.v2.ConfigServiceV2Client({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = configservicev2Module.v2.ConfigServiceV2Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.configServiceV2Stub, undefined); + await client.initialize(); + assert(client.configServiceV2Stub); + }); + + 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().catch((err) => { + throw err; + }); + assert(client.configServiceV2Stub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + 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', + }); + assert.strictEqual(client.configServiceV2Stub, undefined); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getBucket', () => { + it('invokes getBucket without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogBucket(), + ); + client.innerApiCalls.getBucket = stubSimpleCall(expectedResponse); + const [response] = await client.getBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBucket without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogBucket(), + ); + client.innerApiCalls.getBucket = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBucket( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogBucket | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBucket with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBucket = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBucket(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getBucket(request), expectedError); + }); + }); + + describe('createBucket', () => { + it('invokes createBucket without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogBucket(), + ); + client.innerApiCalls.createBucket = stubSimpleCall(expectedResponse); + const [response] = await client.createBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucket without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogBucket(), + ); + client.innerApiCalls.createBucket = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBucket( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogBucket | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucket with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBucket = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createBucket(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createBucket(request), expectedError); + }); + }); + + describe('updateBucket', () => { + it('invokes updateBucket without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogBucket(), + ); + client.innerApiCalls.updateBucket = stubSimpleCall(expectedResponse); + const [response] = await client.updateBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucket without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogBucket(), + ); + client.innerApiCalls.updateBucket = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBucket( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogBucket | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucket with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBucket = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateBucket(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateBucket(request), expectedError); + }); + }); + + describe('deleteBucket', () => { + it('invokes deleteBucket without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteBucket = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBucket without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteBucket = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBucket( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBucket with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBucket = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteBucket(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteBucket(request), expectedError); + }); + }); + + describe('undeleteBucket', () => { + it('invokes undeleteBucket without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UndeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UndeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.undeleteBucket = stubSimpleCall(expectedResponse); + const [response] = await client.undeleteBucket(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteBucket without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UndeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UndeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.undeleteBucket = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeleteBucket( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeleteBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteBucket with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UndeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UndeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeleteBucket = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.undeleteBucket(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeleteBucket as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeleteBucket as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeleteBucket with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UndeleteBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UndeleteBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.undeleteBucket(request), expectedError); + }); + }); + + describe('getView', () => { + it('invokes getView without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogView(), + ); + client.innerApiCalls.getView = stubSimpleCall(expectedResponse); + const [response] = await client.getView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getView as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getView without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogView(), + ); + client.innerApiCalls.getView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getView( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogView | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getView as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getView with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getView = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getView(request), expectedError); + const actualRequest = (client.innerApiCalls.getView as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getView(request), expectedError); + }); + }); + + describe('createView', () => { + it('invokes createView without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogView(), + ); + client.innerApiCalls.createView = stubSimpleCall(expectedResponse); + const [response] = await client.createView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createView without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogView(), + ); + client.innerApiCalls.createView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createView( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogView | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createView with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateViewRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createView(request), expectedError); + }); + }); + + describe('updateView', () => { + it('invokes updateView without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogView(), + ); + client.innerApiCalls.updateView = stubSimpleCall(expectedResponse); + const [response] = await client.updateView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateView without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogView(), + ); + client.innerApiCalls.updateView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateView( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogView | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateView with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateView(request), expectedError); + }); + }); + + describe('deleteView', () => { + it('invokes deleteView without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteView = stubSimpleCall(expectedResponse); + const [response] = await client.deleteView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteView without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteView = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteView( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteView with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteView = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteView(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteView as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteView as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteView with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteViewRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteViewRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteView(request), expectedError); + }); + }); + + describe('getSink', () => { + it('invokes getSink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogSink(), + ); + client.innerApiCalls.getSink = stubSimpleCall(expectedResponse); + const [response] = await client.getSink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSink as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogSink(), + ); + client.innerApiCalls.getSink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSink( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogSink | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSink as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSink with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSink(request), expectedError); + const actualRequest = (client.innerApiCalls.getSink as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSink(request), expectedError); + }); + }); + + describe('createSink', () => { + it('invokes createSink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateSinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogSink(), + ); + client.innerApiCalls.createSink = stubSimpleCall(expectedResponse); + const [response] = await client.createSink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateSinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogSink(), + ); + client.innerApiCalls.createSink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSink( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogSink | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSink with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateSinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSink = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createSink(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateSinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createSink(request), expectedError); + }); + }); + + describe('updateSink', () => { + it('invokes updateSink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogSink(), + ); + client.innerApiCalls.updateSink = stubSimpleCall(expectedResponse); + const [response] = await client.updateSink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogSink(), + ); + client.innerApiCalls.updateSink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSink( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogSink | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSink with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSink = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSink(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateSink(request), expectedError); + }); + }); + + describe('deleteSink', () => { + it('invokes deleteSink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSink = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteSink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSink( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSink with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedHeaderRequestParams = `sink_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSink = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteSink(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteSinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteSinkRequest', + ['sinkName'], + ); + request.sinkName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteSink(request), expectedError); + }); + }); + + describe('getLink', () => { + it('invokes getLink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Link(), + ); + client.innerApiCalls.getLink = stubSimpleCall(expectedResponse); + const [response] = await client.getLink(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getLink as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Link(), + ); + client.innerApiCalls.getLink = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLink( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILink | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getLink as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLink with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLink = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLink(request), expectedError); + const actualRequest = (client.innerApiCalls.getLink as SinonStub).getCall( + 0, + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLink with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getLink(request), expectedError); + }); + }); + + describe('getExclusion', () => { + it('invokes getExclusion without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogExclusion(), + ); + client.innerApiCalls.getExclusion = stubSimpleCall(expectedResponse); + const [response] = await client.getExclusion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExclusion without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogExclusion(), + ); + client.innerApiCalls.getExclusion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getExclusion( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogExclusion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExclusion with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExclusion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getExclusion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getExclusion(request), expectedError); + }); + }); + + describe('createExclusion', () => { + it('invokes createExclusion without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateExclusionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogExclusion(), + ); + client.innerApiCalls.createExclusion = stubSimpleCall(expectedResponse); + const [response] = await client.createExclusion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExclusion without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateExclusionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogExclusion(), + ); + client.innerApiCalls.createExclusion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createExclusion( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogExclusion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExclusion with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateExclusionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExclusion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createExclusion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateExclusionRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createExclusion(request), expectedError); + }); + }); + + describe('updateExclusion', () => { + it('invokes updateExclusion without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogExclusion(), + ); + client.innerApiCalls.updateExclusion = stubSimpleCall(expectedResponse); + const [response] = await client.updateExclusion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExclusion without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogExclusion(), + ); + client.innerApiCalls.updateExclusion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateExclusion( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogExclusion | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExclusion with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExclusion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateExclusion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateExclusion(request), expectedError); + }); + }); + + describe('deleteExclusion', () => { + it('invokes deleteExclusion without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExclusion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteExclusion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExclusion without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteExclusion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteExclusion( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExclusion with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExclusion = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteExclusion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteExclusion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExclusion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteExclusion with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteExclusionRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteExclusionRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.CmekSettings(), + ); + client.innerApiCalls.getCmekSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getCmekSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCmekSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCmekSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCmekSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + 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); + const actualRequest = ( + client.innerApiCalls.getCmekSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCmekSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCmekSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCmekSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getCmekSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCmekSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCmekSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCmekSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.CmekSettings(), + ); + client.innerApiCalls.updateCmekSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateCmekSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCmekSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCmekSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCmekSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + 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); + const actualRequest = ( + client.innerApiCalls.updateCmekSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCmekSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCmekSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCmekSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateCmekSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCmekSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCmekSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCmekSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateCmekSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateCmekSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + 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', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Settings(), + ); + client.innerApiCalls.getSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + 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); + const actualRequest = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getSettings(request), expectedError); + }); + }); + + describe('updateSettings', () => { + it('invokes updateSettings without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Settings(), + ); + client.innerApiCalls.updateSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.Settings(), + ); + client.innerApiCalls.updateSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSettings( + 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); + const actualRequest = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSettings = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings with closed client', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateSettingsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateSettingsRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateSettings(request), expectedError); + }); + }); + + describe('createBucketAsync', () => { + it('invokes createBucketAsync without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createBucketAsync = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBucketAsync(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucketAsync without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createBucketAsync = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBucketAsync( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucketAsync with call error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBucketAsync = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createBucketAsync(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBucketAsync with LRO error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateBucketRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBucketAsync = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createBucketAsync(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBucketAsyncProgress without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkCreateBucketAsyncProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBucketAsyncProgress with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkCreateBucketAsyncProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBucketAsync', () => { + it('invokes updateBucketAsync without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateBucketAsync = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBucketAsync(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucketAsync without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.updateBucketAsync = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBucketAsync( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.logging.v2.ILogBucket, + protos.google.logging.v2.IBucketMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucketAsync with call error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBucketAsync = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateBucketAsync(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBucketAsync with LRO error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateBucketRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateBucketRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBucketAsync = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.updateBucketAsync(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBucketAsync as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBucketAsyncProgress without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkUpdateBucketAsyncProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBucketAsyncProgress with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.checkUpdateBucketAsyncProgress(''), + expectedError, + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createLink', () => { + it('invokes createLink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createLink = stubLongRunningCall(expectedResponse); + const [operation] = await client.createLink(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.createLink = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createLink( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.logging.v2.ILink, + protos.google.logging.v2.ILinkMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLink with call error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLink = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.createLink(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLink with LRO error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLinkRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLink = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.createLink(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateLinkProgress without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkCreateLinkProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateLinkProgress with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkCreateLinkProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteLink', () => { + it('invokes deleteLink without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteLink = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteLink(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLink without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.deleteLink = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteLink( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.logging.v2.ILinkMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLink with call error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLink = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteLink(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLink with LRO error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLinkRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLinkRequest', + ['name'], + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLink = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.deleteLink(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLink as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteLinkProgress without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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.checkDeleteLinkProgress( + expectedResponse.name, + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteLinkProgress with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.checkDeleteLinkProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('copyLogEntries', () => { + it('invokes copyLogEntries without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CopyLogEntriesRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.copyLogEntries = + stubLongRunningCall(expectedResponse); + const [operation] = await client.copyLogEntries(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes copyLogEntries without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CopyLogEntriesRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation(), + ); + client.innerApiCalls.copyLogEntries = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.copyLogEntries( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.logging.v2.ICopyLogEntriesResponse, + protos.google.logging.v2.ICopyLogEntriesMetadata + > | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + 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); + }); + + it('invokes copyLogEntries with call error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CopyLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.copyLogEntries = stubLongRunningCall( + undefined, + expectedError, + ); + await assert.rejects(client.copyLogEntries(request), expectedError); + }); + + it('invokes copyLogEntries with LRO error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CopyLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.copyLogEntries = stubLongRunningCall( + undefined, + undefined, + expectedError, + ); + const [operation] = await client.copyLogEntries(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCopyLogEntriesProgress without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', + }); + await 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', () => { + it('invokes listBuckets without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + ]; + client.innerApiCalls.listBuckets = stubSimpleCall(expectedResponse); + const [response] = await client.listBuckets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBuckets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuckets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuckets without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + ]; + client.innerApiCalls.listBuckets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBuckets( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogBucket[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBuckets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuckets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuckets with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBuckets = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listBuckets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBuckets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuckets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBucketsStream without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + ]; + client.descriptors.page.listBuckets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBucketsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogBucket[] = []; + stream.on('data', (response: protos.google.logging.v2.LogBucket) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuckets, request), + ); + assert( + (client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listBucketsStream with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBuckets.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listBucketsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogBucket[] = []; + stream.on('data', (response: protos.google.logging.v2.LogBucket) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuckets, request), + ); + assert( + (client.descriptors.page.listBuckets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listBuckets without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + generateSampleMessage(new protos.google.logging.v2.LogBucket()), + ]; + client.descriptors.page.listBuckets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILogBucket[] = []; + const iterable = client.listBucketsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listBuckets with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListBucketsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListBucketsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBuckets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listBucketsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILogBucket[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub).getCall( + 0, + ).args[1], + request, + ); + assert( + (client.descriptors.page.listBuckets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listViews', () => { + it('invokes listViews without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + ]; + client.innerApiCalls.listViews = stubSimpleCall(expectedResponse); + const [response] = await client.listViews(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listViews without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + ]; + client.innerApiCalls.listViews = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listViews( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogView[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listViews with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listViews = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listViews(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listViews as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listViews as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listViewsStream without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + ]; + client.descriptors.page.listViews.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogView[] = []; + stream.on('data', (response: protos.google.logging.v2.LogView) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listViews, request), + ); + assert( + (client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listViewsStream with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listViews.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogView[] = []; + stream.on('data', (response: protos.google.logging.v2.LogView) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listViews, request), + ); + assert( + (client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listViews without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + generateSampleMessage(new protos.google.logging.v2.LogView()), + ]; + client.descriptors.page.listViews.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILogView[] = []; + const iterable = client.listViewsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listViews.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listViews.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listViews with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListViewsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListViewsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listViews.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listViewsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILogView[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listViews.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listViews.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listSinks', () => { + it('invokes listSinks without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + ]; + client.innerApiCalls.listSinks = stubSimpleCall(expectedResponse); + const [response] = await client.listSinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSinks without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + ]; + client.innerApiCalls.listSinks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSinks( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogSink[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSinks with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSinks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSinksStream without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + ]; + client.descriptors.page.listSinks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogSink[] = []; + stream.on('data', (response: protos.google.logging.v2.LogSink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSinks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSinks, request), + ); + assert( + (client.descriptors.page.listSinks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listSinksStream with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSinks.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listSinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogSink[] = []; + stream.on('data', (response: protos.google.logging.v2.LogSink) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSinks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSinks, request), + ); + assert( + (client.descriptors.page.listSinks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSinks without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + generateSampleMessage(new protos.google.logging.v2.LogSink()), + ]; + client.descriptors.page.listSinks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILogSink[] = []; + const iterable = client.listSinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSinks.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listSinks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listSinks with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListSinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListSinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSinks.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listSinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILogSink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSinks.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listSinks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listLinks', () => { + it('invokes listLinks without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + ]; + client.innerApiCalls.listLinks = stubSimpleCall(expectedResponse); + const [response] = await client.listLinks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinks without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + ]; + client.innerApiCalls.listLinks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLinks( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILink[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinks with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLinks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLinks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listLinks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLinks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLinksStream without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + ]; + client.descriptors.page.listLinks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.Link[] = []; + stream.on('data', (response: protos.google.logging.v2.Link) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listLinks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLinks, request), + ); + assert( + (client.descriptors.page.listLinks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listLinksStream with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLinks.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listLinksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.Link[] = []; + stream.on('data', (response: protos.google.logging.v2.Link) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLinks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLinks, request), + ); + assert( + (client.descriptors.page.listLinks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLinks without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + generateSampleMessage(new protos.google.logging.v2.Link()), + ]; + client.descriptors.page.listLinks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILink[] = []; + const iterable = client.listLinksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listLinks.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listLinks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLinks with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLinksRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLinksRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLinks.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listLinksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILink[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listLinks.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listLinks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('listExclusions', () => { + it('invokes listExclusions without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + ]; + client.innerApiCalls.listExclusions = stubSimpleCall(expectedResponse); + const [response] = await client.listExclusions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExclusions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExclusions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExclusions without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + ]; + client.innerApiCalls.listExclusions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listExclusions( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogExclusion[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listExclusions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExclusions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExclusions with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExclusions = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listExclusions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listExclusions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExclusions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listExclusionsStream without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + ]; + client.descriptors.page.listExclusions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listExclusionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogExclusion[] = []; + stream.on('data', (response: protos.google.logging.v2.LogExclusion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listExclusions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExclusions, request), + ); + assert( + (client.descriptors.page.listExclusions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listExclusionsStream with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExclusions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listExclusionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogExclusion[] = []; + stream.on('data', (response: protos.google.logging.v2.LogExclusion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listExclusions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listExclusions, request), + ); + assert( + (client.descriptors.page.listExclusions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExclusions without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + generateSampleMessage(new protos.google.logging.v2.LogExclusion()), + ]; + client.descriptors.page.listExclusions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILogExclusion[] = []; + const iterable = client.listExclusionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listExclusions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExclusions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listExclusions with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListExclusionsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListExclusionsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listExclusions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listExclusionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILogExclusion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listExclusions.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listExclusions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation(), + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient + .deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ) + .catch((err) => { + throw err; + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request), + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse(), + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest(), + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('Path templates', () => { + describe('billingAccountCmekSettings', async () => { + const fakePath = '/rendered/path/billingAccountCmekSettings'; + const expectedParameters = { + billing_account: 'billingAccountValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountCmekSettingsPath', () => { + const result = client.billingAccountCmekSettingsPath( + 'billingAccountValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountCmekSettingsName', () => { + const result = + client.matchBillingAccountFromBillingAccountCmekSettingsName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountExclusion', async () => { + const fakePath = '/rendered/path/billingAccountExclusion'; + const expectedParameters = { + billing_account: 'billingAccountValue', + exclusion: 'exclusionValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountExclusionPath', () => { + const result = client.billingAccountExclusionPath( + 'billingAccountValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountExclusionName', () => { + const result = + client.matchBillingAccountFromBillingAccountExclusionName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromBillingAccountExclusionName', () => { + const result = + client.matchExclusionFromBillingAccountExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucket', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucket'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketPath', () => { + const result = client.billingAccountLocationBucketPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucketLink', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucketLink'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketLinkPath', () => { + const result = client.billingAccountLocationBucketLinkPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchLinkFromBillingAccountLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucketView', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucketView'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketViewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketViewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketViewPath', () => { + const result = client.billingAccountLocationBucketViewPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchViewFromBillingAccountLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLog', async () => { + const fakePath = '/rendered/path/billingAccountLog'; + const expectedParameters = { + billing_account: 'billingAccountValue', + log: 'logValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountLogPath', () => { + const result = client.billingAccountLogPath( + 'billingAccountValue', + 'logValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLogName', () => { + const result = + client.matchBillingAccountFromBillingAccountLogName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromBillingAccountLogName', () => { + const result = client.matchLogFromBillingAccountLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountSettings', async () => { + 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', + }); + await 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', async () => { + const fakePath = '/rendered/path/billingAccountSink'; + const expectedParameters = { + billing_account: 'billingAccountValue', + sink: 'sinkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountSinkPath', () => { + const result = client.billingAccountSinkPath( + 'billingAccountValue', + 'sinkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountSinkName', () => { + const result = + client.matchBillingAccountFromBillingAccountSinkName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromBillingAccountSinkName', () => { + const result = client.matchSinkFromBillingAccountSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderCmekSettings', async () => { + const fakePath = '/rendered/path/folderCmekSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderCmekSettingsPath', () => { + const result = client.folderCmekSettingsPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderCmekSettingsName', () => { + const result = client.matchFolderFromFolderCmekSettingsName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderExclusion', async () => { + const fakePath = '/rendered/path/folderExclusion'; + const expectedParameters = { + folder: 'folderValue', + exclusion: 'exclusionValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderExclusionPath', () => { + const result = client.folderExclusionPath( + 'folderValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderExclusionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderExclusionName', () => { + const result = client.matchFolderFromFolderExclusionName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromFolderExclusionName', () => { + const result = client.matchExclusionFromFolderExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + (client.pathTemplates.folderExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucket', async () => { + const fakePath = '/rendered/path/folderLocationBucket'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketPath', () => { + const result = client.folderLocationBucketPath( + 'folderValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketName', () => { + const result = client.matchFolderFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketName', () => { + const result = + client.matchLocationFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketName', () => { + const result = client.matchBucketFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucketLink', async () => { + const fakePath = '/rendered/path/folderLocationBucketLink'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketLinkPath', () => { + const result = client.folderLocationBucketLinkPath( + 'folderValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketLinkName', () => { + const result = + client.matchFolderFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketLinkName', () => { + const result = + client.matchLocationFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketLinkName', () => { + const result = + client.matchBucketFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromFolderLocationBucketLinkName', () => { + const result = + client.matchLinkFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucketView', async () => { + const fakePath = '/rendered/path/folderLocationBucketView'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketViewPath', () => { + const result = client.folderLocationBucketViewPath( + 'folderValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketViewName', () => { + const result = + client.matchFolderFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketViewName', () => { + const result = + client.matchLocationFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketViewName', () => { + const result = + client.matchBucketFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromFolderLocationBucketViewName', () => { + const result = + client.matchViewFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLog', async () => { + const fakePath = '/rendered/path/folderLog'; + const expectedParameters = { + folder: 'folderValue', + log: 'logValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLogPath', () => { + const result = client.folderLogPath('folderValue', 'logValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLogName', () => { + const result = client.matchFolderFromFolderLogName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromFolderLogName', () => { + const result = client.matchLogFromFolderLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.folderLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderSettings', async () => { + const fakePath = '/rendered/path/folderSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/folderSink'; + const expectedParameters = { + folder: 'folderValue', + sink: 'sinkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSinkPath', () => { + const result = client.folderSinkPath('folderValue', 'sinkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSinkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderSinkName', () => { + const result = client.matchFolderFromFolderSinkName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromFolderSinkName', () => { + const result = client.matchSinkFromFolderSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.folderSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('location', async () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('logMetric', async () => { + const fakePath = '/rendered/path/logMetric'; + const expectedParameters = { + project: 'projectValue', + metric: 'metricValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.logMetricPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.logMetricPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('logMetricPath', () => { + const result = client.logMetricPath('projectValue', 'metricValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.logMetricPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLogMetricName', () => { + const result = client.matchProjectFromLogMetricName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.logMetricPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchMetricFromLogMetricName', () => { + const result = client.matchMetricFromLogMetricName(fakePath); + assert.strictEqual(result, 'metricValue'); + assert( + (client.pathTemplates.logMetricPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationCmekSettings', async () => { + const fakePath = '/rendered/path/organizationCmekSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCmekSettingsPath', () => { + const result = client.organizationCmekSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationCmekSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationCmekSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationExclusion', async () => { + const fakePath = '/rendered/path/organizationExclusion'; + const expectedParameters = { + organization: 'organizationValue', + exclusion: 'exclusionValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationExclusionPath', () => { + const result = client.organizationExclusionPath( + 'organizationValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationExclusionName', () => { + const result = + client.matchOrganizationFromOrganizationExclusionName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromOrganizationExclusionName', () => { + const result = + client.matchExclusionFromOrganizationExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucket', async () => { + const fakePath = '/rendered/path/organizationLocationBucket'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLocationBucketPath', () => { + const result = client.organizationLocationBucketPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucketLink', async () => { + const fakePath = '/rendered/path/organizationLocationBucketLink'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBucketLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBucketLinkPath', () => { + const result = client.organizationLocationBucketLinkPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchLinkFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucketView', async () => { + const fakePath = '/rendered/path/organizationLocationBucketView'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketViewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBucketViewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBucketViewPath', () => { + const result = client.organizationLocationBucketViewPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketViewName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketViewName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketViewName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromOrganizationLocationBucketViewName', () => { + const result = + client.matchViewFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLog', async () => { + const fakePath = '/rendered/path/organizationLog'; + const expectedParameters = { + organization: 'organizationValue', + log: 'logValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLogPath', () => { + const result = client.organizationLogPath( + 'organizationValue', + 'logValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLogName', () => { + const result = + client.matchOrganizationFromOrganizationLogName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromOrganizationLogName', () => { + const result = client.matchLogFromOrganizationLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.organizationLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationSettings', async () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/organizationSink'; + const expectedParameters = { + organization: 'organizationValue', + sink: 'sinkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSinkPath', () => { + const result = client.organizationSinkPath( + 'organizationValue', + 'sinkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationSinkName', () => { + const result = + client.matchOrganizationFromOrganizationSinkName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromOrganizationSinkName', () => { + const result = client.matchSinkFromOrganizationSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.organizationSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectCmekSettings', async () => { + const fakePath = '/rendered/path/projectCmekSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCmekSettingsPath', () => { + const result = client.projectCmekSettingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectCmekSettingsName', () => { + const result = client.matchProjectFromProjectCmekSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectExclusion', async () => { + const fakePath = '/rendered/path/projectExclusion'; + const expectedParameters = { + project: 'projectValue', + exclusion: 'exclusionValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectExclusionPath', () => { + const result = client.projectExclusionPath( + 'projectValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectExclusionName', () => { + const result = client.matchProjectFromProjectExclusionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromProjectExclusionName', () => { + const result = client.matchExclusionFromProjectExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + (client.pathTemplates.projectExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucket', async () => { + const fakePath = '/rendered/path/projectLocationBucket'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketPath', () => { + const result = client.projectLocationBucketPath( + 'projectValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketName', () => { + const result = + client.matchProjectFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketName', () => { + const result = + client.matchLocationFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketName', () => { + const result = + client.matchBucketFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucketLink', async () => { + const fakePath = '/rendered/path/projectLocationBucketLink'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketLinkPath', () => { + const result = client.projectLocationBucketLinkPath( + 'projectValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketLinkName', () => { + const result = + client.matchProjectFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketLinkName', () => { + const result = + client.matchLocationFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketLinkName', () => { + const result = + client.matchBucketFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromProjectLocationBucketLinkName', () => { + const result = + client.matchLinkFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucketView', async () => { + const fakePath = '/rendered/path/projectLocationBucketView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketViewPath', () => { + const result = client.projectLocationBucketViewPath( + 'projectValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketViewName', () => { + const result = + client.matchProjectFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketViewName', () => { + const result = + client.matchLocationFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketViewName', () => { + const result = + client.matchBucketFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromProjectLocationBucketViewName', () => { + const result = + client.matchViewFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLog', async () => { + const fakePath = '/rendered/path/projectLog'; + const expectedParameters = { + project: 'projectValue', + log: 'logValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLogPath', () => { + const result = client.projectLogPath('projectValue', 'logValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLogName', () => { + const result = client.matchProjectFromProjectLogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromProjectLogName', () => { + const result = client.matchLogFromProjectLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.projectLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectSettings', async () => { + const fakePath = '/rendered/path/projectSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/projectSink'; + const expectedParameters = { + project: 'projectValue', + sink: 'sinkValue', + }; + const client = new configservicev2Module.v2.ConfigServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSinkPath', () => { + const result = client.projectSinkPath('projectValue', 'sinkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSinkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectSinkName', () => { + const result = client.matchProjectFromProjectSinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromProjectSinkName', () => { + const result = client.matchSinkFromProjectSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.projectSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-logging-api/test/gapic_logging_service_v2_v2.ts b/packages/google-cloud-logging-api/test/gapic_logging_service_v2_v2.ts new file mode 100644 index 000000000000..9005cf668f41 --- /dev/null +++ b/packages/google-cloud-logging-api/test/gapic_logging_service_v2_v2.ts @@ -0,0 +1,3535 @@ +// Copyright 2026 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as loggingservicev2Module from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error, +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.LoggingServiceV2Client', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'logging.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + loggingservicev2Module.v2.LoggingServiceV2Client.servicePath; + assert.strictEqual(servicePath, 'logging.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + loggingservicev2Module.v2.LoggingServiceV2Client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'logging.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new loggingservicev2Module.v2.LoggingServiceV2Client({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = loggingservicev2Module.v2.LoggingServiceV2Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.loggingServiceV2Stub, undefined); + await client.initialize(); + assert(client.loggingServiceV2Stub); + }); + + 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.initialize().catch((err) => { + throw err; + }); + assert(client.loggingServiceV2Stub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + 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(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('deleteLog', () => { + it('invokes deleteLog without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogRequest', + ['logName'], + ); + request.logName = defaultValue1; + const expectedHeaderRequestParams = `log_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteLog = stubSimpleCall(expectedResponse); + const [response] = await client.deleteLog(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLog without error using callback', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogRequest', + ['logName'], + ); + request.logName = defaultValue1; + const expectedHeaderRequestParams = `log_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteLog = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteLog( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLog with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogRequest', + ['logName'], + ); + request.logName = defaultValue1; + const expectedHeaderRequestParams = `log_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLog = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteLog(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLog as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLog as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLog with closed client', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogRequest', + ['logName'], + ); + request.logName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteLog(request), expectedError); + }); + }); + + describe('writeLogEntries', () => { + it('invokes writeLogEntries without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesResponse(), + ); + client.innerApiCalls.writeLogEntries = stubSimpleCall(expectedResponse); + const [response] = await client.writeLogEntries(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes writeLogEntries without error using callback', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesRequest(), + ); + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesResponse(), + ); + client.innerApiCalls.writeLogEntries = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeLogEntries( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.IWriteLogEntriesResponse | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes writeLogEntries with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.writeLogEntries = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.writeLogEntries(request), expectedError); + }); + + it('invokes writeLogEntries with closed client', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.WriteLogEntriesRequest(), + ); + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.writeLogEntries(request), expectedError); + }); + }); + + describe('tailLogEntries', () => { + it('invokes tailLogEntries without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.TailLogEntriesRequest(), + ); + + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.TailLogEntriesResponse(), + ); + client.innerApiCalls.tailLogEntries = + stubBidiStreamingCall(expectedResponse); + const stream = client.tailLogEntries(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.logging.v2.TailLogEntriesResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.tailLogEntries as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + + it('invokes tailLogEntries with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.TailLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.tailLogEntries = stubBidiStreamingCall( + undefined, + expectedError, + ); + const stream = client.tailLogEntries(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + (response: protos.google.logging.v2.TailLogEntriesResponse) => { + resolve(response); + }, + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.tailLogEntries as SinonStub) + .getCall(0) + .calledWith(null), + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request, + ); + }); + }); + + describe('listLogEntries', () => { + it('invokes listLogEntries without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + ]; + client.innerApiCalls.listLogEntries = stubSimpleCall(expectedResponse); + const [response] = await client.listLogEntries(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listLogEntries without error using callback', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + ]; + client.innerApiCalls.listLogEntries = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLogEntries( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogEntry[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listLogEntries with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listLogEntries = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listLogEntries(request), expectedError); + }); + + it('invokes listLogEntriesStream without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + ]; + client.descriptors.page.listLogEntries.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLogEntriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogEntry[] = []; + stream.on('data', (response: protos.google.logging.v2.LogEntry) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listLogEntries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogEntries, request), + ); + }); + + it('invokes listLogEntriesStream with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.descriptors.page.listLogEntries.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listLogEntriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogEntry[] = []; + stream.on('data', (response: protos.google.logging.v2.LogEntry) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLogEntries.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogEntries, request), + ); + }); + + it('uses async iteration with listLogEntries without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + generateSampleMessage(new protos.google.logging.v2.LogEntry()), + ]; + client.descriptors.page.listLogEntries.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILogEntry[] = []; + const iterable = client.listLogEntriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listLogEntries.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + + it('uses async iteration with listLogEntries with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogEntriesRequest(), + ); + const expectedError = new Error('expected'); + client.descriptors.page.listLogEntries.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLogEntriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILogEntry[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listLogEntries.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('listMonitoredResourceDescriptors', () => { + it('invokes listMonitoredResourceDescriptors without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + ]; + client.innerApiCalls.listMonitoredResourceDescriptors = + stubSimpleCall(expectedResponse); + const [response] = await client.listMonitoredResourceDescriptors(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listMonitoredResourceDescriptors without error using callback', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + ]; + client.innerApiCalls.listMonitoredResourceDescriptors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMonitoredResourceDescriptors( + request, + ( + err?: Error | null, + result?: protos.google.api.IMonitoredResourceDescriptor[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listMonitoredResourceDescriptors with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listMonitoredResourceDescriptors = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects( + client.listMonitoredResourceDescriptors(request), + expectedError, + ); + }); + + it('invokes listMonitoredResourceDescriptorsStream without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + ]; + client.descriptors.page.listMonitoredResourceDescriptors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMonitoredResourceDescriptorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.MonitoredResourceDescriptor[] = []; + stream.on( + 'data', + (response: protos.google.api.MonitoredResourceDescriptor) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listMonitoredResourceDescriptors + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listMonitoredResourceDescriptors, + request, + ), + ); + }); + + it('invokes listMonitoredResourceDescriptorsStream with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedError = new Error('expected'); + client.descriptors.page.listMonitoredResourceDescriptors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMonitoredResourceDescriptorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.MonitoredResourceDescriptor[] = []; + stream.on( + 'data', + (response: protos.google.api.MonitoredResourceDescriptor) => { + responses.push(response); + }, + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listMonitoredResourceDescriptors + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listMonitoredResourceDescriptors, + request, + ), + ); + }); + + it('uses async iteration with listMonitoredResourceDescriptors without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + generateSampleMessage( + new protos.google.api.MonitoredResourceDescriptor(), + ), + ]; + client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.api.IMonitoredResourceDescriptor[] = []; + const iterable = client.listMonitoredResourceDescriptorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMonitoredResourceDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + + it('uses async iteration with listMonitoredResourceDescriptors with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListMonitoredResourceDescriptorsRequest(), + ); + const expectedError = new Error('expected'); + client.descriptors.page.listMonitoredResourceDescriptors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMonitoredResourceDescriptorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.api.IMonitoredResourceDescriptor[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMonitoredResourceDescriptors + .asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + }); + }); + + describe('listLogs', () => { + it('invokes listLogs without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listLogs = stubSimpleCall(expectedResponse); + const [response] = await client.listLogs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogs without error using callback', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.listLogs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLogs( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogs with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLogs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listLogs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listLogs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogsStream without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listLogs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listLogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogs, request), + ); + assert( + (client.descriptors.page.listLogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listLogsStream with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLogs.createStream = stubPageStreamingCall( + undefined, + expectedError, + ); + const stream = client.listLogsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLogs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogs, request), + ); + assert( + (client.descriptors.page.listLogs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLogs without error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.listLogs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.listLogsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listLogs.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listLogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLogs with error', async () => { + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLogs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError, + ); + const iterable = client.listLogsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listLogs.asyncIterate as SinonStub).getCall(0) + .args[1], + request, + ); + assert( + (client.descriptors.page.listLogs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('billingAccountCmekSettings', async () => { + const fakePath = '/rendered/path/billingAccountCmekSettings'; + const expectedParameters = { + billing_account: 'billingAccountValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountCmekSettingsPath', () => { + const result = client.billingAccountCmekSettingsPath( + 'billingAccountValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountCmekSettingsName', () => { + const result = + client.matchBillingAccountFromBillingAccountCmekSettingsName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountExclusion', async () => { + const fakePath = '/rendered/path/billingAccountExclusion'; + const expectedParameters = { + billing_account: 'billingAccountValue', + exclusion: 'exclusionValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountExclusionPath', () => { + const result = client.billingAccountExclusionPath( + 'billingAccountValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountExclusionName', () => { + const result = + client.matchBillingAccountFromBillingAccountExclusionName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromBillingAccountExclusionName', () => { + const result = + client.matchExclusionFromBillingAccountExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucket', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucket'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketPath', () => { + const result = client.billingAccountLocationBucketPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucketLink', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucketLink'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketLinkPath', () => { + const result = client.billingAccountLocationBucketLinkPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchLinkFromBillingAccountLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucketView', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucketView'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketViewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketViewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketViewPath', () => { + const result = client.billingAccountLocationBucketViewPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchViewFromBillingAccountLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLog', async () => { + const fakePath = '/rendered/path/billingAccountLog'; + const expectedParameters = { + billing_account: 'billingAccountValue', + log: 'logValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountLogPath', () => { + const result = client.billingAccountLogPath( + 'billingAccountValue', + 'logValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLogName', () => { + const result = + client.matchBillingAccountFromBillingAccountLogName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromBillingAccountLogName', () => { + const result = client.matchLogFromBillingAccountLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountSettings', async () => { + 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', + }); + await 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', async () => { + const fakePath = '/rendered/path/billingAccountSink'; + const expectedParameters = { + billing_account: 'billingAccountValue', + sink: 'sinkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountSinkPath', () => { + const result = client.billingAccountSinkPath( + 'billingAccountValue', + 'sinkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountSinkName', () => { + const result = + client.matchBillingAccountFromBillingAccountSinkName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromBillingAccountSinkName', () => { + const result = client.matchSinkFromBillingAccountSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderCmekSettings', async () => { + const fakePath = '/rendered/path/folderCmekSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderCmekSettingsPath', () => { + const result = client.folderCmekSettingsPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderCmekSettingsName', () => { + const result = client.matchFolderFromFolderCmekSettingsName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderExclusion', async () => { + const fakePath = '/rendered/path/folderExclusion'; + const expectedParameters = { + folder: 'folderValue', + exclusion: 'exclusionValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderExclusionPath', () => { + const result = client.folderExclusionPath( + 'folderValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderExclusionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderExclusionName', () => { + const result = client.matchFolderFromFolderExclusionName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromFolderExclusionName', () => { + const result = client.matchExclusionFromFolderExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + (client.pathTemplates.folderExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucket', async () => { + const fakePath = '/rendered/path/folderLocationBucket'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketPath', () => { + const result = client.folderLocationBucketPath( + 'folderValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketName', () => { + const result = client.matchFolderFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketName', () => { + const result = + client.matchLocationFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketName', () => { + const result = client.matchBucketFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucketLink', async () => { + const fakePath = '/rendered/path/folderLocationBucketLink'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketLinkPath', () => { + const result = client.folderLocationBucketLinkPath( + 'folderValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketLinkName', () => { + const result = + client.matchFolderFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketLinkName', () => { + const result = + client.matchLocationFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketLinkName', () => { + const result = + client.matchBucketFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromFolderLocationBucketLinkName', () => { + const result = + client.matchLinkFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucketView', async () => { + const fakePath = '/rendered/path/folderLocationBucketView'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketViewPath', () => { + const result = client.folderLocationBucketViewPath( + 'folderValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketViewName', () => { + const result = + client.matchFolderFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketViewName', () => { + const result = + client.matchLocationFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketViewName', () => { + const result = + client.matchBucketFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromFolderLocationBucketViewName', () => { + const result = + client.matchViewFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLog', async () => { + const fakePath = '/rendered/path/folderLog'; + const expectedParameters = { + folder: 'folderValue', + log: 'logValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLogPath', () => { + const result = client.folderLogPath('folderValue', 'logValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLogName', () => { + const result = client.matchFolderFromFolderLogName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromFolderLogName', () => { + const result = client.matchLogFromFolderLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.folderLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderSettings', async () => { + const fakePath = '/rendered/path/folderSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/folderSink'; + const expectedParameters = { + folder: 'folderValue', + sink: 'sinkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSinkPath', () => { + const result = client.folderSinkPath('folderValue', 'sinkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSinkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderSinkName', () => { + const result = client.matchFolderFromFolderSinkName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromFolderSinkName', () => { + const result = client.matchSinkFromFolderSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.folderSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('logMetric', async () => { + const fakePath = '/rendered/path/logMetric'; + const expectedParameters = { + project: 'projectValue', + metric: 'metricValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.logMetricPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.logMetricPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('logMetricPath', () => { + const result = client.logMetricPath('projectValue', 'metricValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.logMetricPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLogMetricName', () => { + const result = client.matchProjectFromLogMetricName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.logMetricPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchMetricFromLogMetricName', () => { + const result = client.matchMetricFromLogMetricName(fakePath); + assert.strictEqual(result, 'metricValue'); + assert( + (client.pathTemplates.logMetricPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationCmekSettings', async () => { + const fakePath = '/rendered/path/organizationCmekSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCmekSettingsPath', () => { + const result = client.organizationCmekSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationCmekSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationCmekSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationExclusion', async () => { + const fakePath = '/rendered/path/organizationExclusion'; + const expectedParameters = { + organization: 'organizationValue', + exclusion: 'exclusionValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationExclusionPath', () => { + const result = client.organizationExclusionPath( + 'organizationValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationExclusionName', () => { + const result = + client.matchOrganizationFromOrganizationExclusionName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromOrganizationExclusionName', () => { + const result = + client.matchExclusionFromOrganizationExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucket', async () => { + const fakePath = '/rendered/path/organizationLocationBucket'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLocationBucketPath', () => { + const result = client.organizationLocationBucketPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucketLink', async () => { + const fakePath = '/rendered/path/organizationLocationBucketLink'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBucketLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBucketLinkPath', () => { + const result = client.organizationLocationBucketLinkPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchLinkFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucketView', async () => { + const fakePath = '/rendered/path/organizationLocationBucketView'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketViewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBucketViewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBucketViewPath', () => { + const result = client.organizationLocationBucketViewPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketViewName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketViewName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketViewName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromOrganizationLocationBucketViewName', () => { + const result = + client.matchViewFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLog', async () => { + const fakePath = '/rendered/path/organizationLog'; + const expectedParameters = { + organization: 'organizationValue', + log: 'logValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLogPath', () => { + const result = client.organizationLogPath( + 'organizationValue', + 'logValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLogName', () => { + const result = + client.matchOrganizationFromOrganizationLogName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromOrganizationLogName', () => { + const result = client.matchLogFromOrganizationLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.organizationLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationSettings', async () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/organizationSink'; + const expectedParameters = { + organization: 'organizationValue', + sink: 'sinkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSinkPath', () => { + const result = client.organizationSinkPath( + 'organizationValue', + 'sinkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationSinkName', () => { + const result = + client.matchOrganizationFromOrganizationSinkName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromOrganizationSinkName', () => { + const result = client.matchSinkFromOrganizationSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.organizationSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectCmekSettings', async () => { + const fakePath = '/rendered/path/projectCmekSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCmekSettingsPath', () => { + const result = client.projectCmekSettingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectCmekSettingsName', () => { + const result = client.matchProjectFromProjectCmekSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectExclusion', async () => { + const fakePath = '/rendered/path/projectExclusion'; + const expectedParameters = { + project: 'projectValue', + exclusion: 'exclusionValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectExclusionPath', () => { + const result = client.projectExclusionPath( + 'projectValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectExclusionName', () => { + const result = client.matchProjectFromProjectExclusionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromProjectExclusionName', () => { + const result = client.matchExclusionFromProjectExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + (client.pathTemplates.projectExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucket', async () => { + const fakePath = '/rendered/path/projectLocationBucket'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketPath', () => { + const result = client.projectLocationBucketPath( + 'projectValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketName', () => { + const result = + client.matchProjectFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketName', () => { + const result = + client.matchLocationFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketName', () => { + const result = + client.matchBucketFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucketLink', async () => { + const fakePath = '/rendered/path/projectLocationBucketLink'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketLinkPath', () => { + const result = client.projectLocationBucketLinkPath( + 'projectValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketLinkName', () => { + const result = + client.matchProjectFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketLinkName', () => { + const result = + client.matchLocationFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketLinkName', () => { + const result = + client.matchBucketFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromProjectLocationBucketLinkName', () => { + const result = + client.matchLinkFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucketView', async () => { + const fakePath = '/rendered/path/projectLocationBucketView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketViewPath', () => { + const result = client.projectLocationBucketViewPath( + 'projectValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketViewName', () => { + const result = + client.matchProjectFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketViewName', () => { + const result = + client.matchLocationFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketViewName', () => { + const result = + client.matchBucketFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromProjectLocationBucketViewName', () => { + const result = + client.matchViewFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLog', async () => { + const fakePath = '/rendered/path/projectLog'; + const expectedParameters = { + project: 'projectValue', + log: 'logValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLogPath', () => { + const result = client.projectLogPath('projectValue', 'logValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLogName', () => { + const result = client.matchProjectFromProjectLogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromProjectLogName', () => { + const result = client.matchLogFromProjectLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.projectLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectSettings', async () => { + const fakePath = '/rendered/path/projectSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/projectSink'; + const expectedParameters = { + project: 'projectValue', + sink: 'sinkValue', + }; + const client = new loggingservicev2Module.v2.LoggingServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSinkPath', () => { + const result = client.projectSinkPath('projectValue', 'sinkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSinkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectSinkName', () => { + const result = client.matchProjectFromProjectSinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromProjectSinkName', () => { + const result = client.matchSinkFromProjectSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.projectSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-logging-api/test/gapic_metrics_service_v2_v2.ts b/packages/google-cloud-logging-api/test/gapic_metrics_service_v2_v2.ts new file mode 100644 index 000000000000..08d008059574 --- /dev/null +++ b/packages/google-cloud-logging-api/test/gapic_metrics_service_v2_v2.ts @@ -0,0 +1,3319 @@ +// Copyright 2026 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { SinonStub } from 'sinon'; +import { describe, it } from 'mocha'; +import * as metricsservicev2Module from '../src'; + +import { PassThrough } from 'stream'; + +import { protobuf } from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json'), +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, { defaults: true }); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject, + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error, +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error, +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error, +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({ done: true, value: undefined }); + } + return Promise.resolve({ done: false, value: responses![counter++] }); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.MetricsServiceV2Client', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'logging.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + metricsservicev2Module.v2.MetricsServiceV2Client.servicePath; + assert.strictEqual(servicePath, 'logging.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + metricsservicev2Module.v2.MetricsServiceV2Client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'logging.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'logging.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new metricsservicev2Module.v2.MetricsServiceV2Client({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = metricsservicev2Module.v2.MetricsServiceV2Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.metricsServiceV2Stub, undefined); + await client.initialize(); + assert(client.metricsServiceV2Stub); + }); + + 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.initialize().catch((err) => { + throw err; + }); + assert(client.metricsServiceV2Stub); + client + .close() + .then(() => { + done(); + }) + .catch((err) => { + throw err; + }); + }); + + 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(); + }) + .catch((err) => { + throw err; + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getLogMetric', () => { + it('invokes getLogMetric without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogMetric(), + ); + client.innerApiCalls.getLogMetric = stubSimpleCall(expectedResponse); + const [response] = await client.getLogMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLogMetric without error using callback', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogMetric(), + ); + client.innerApiCalls.getLogMetric = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLogMetric( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogMetric | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLogMetric with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getLogMetric = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.getLogMetric(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.GetLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.GetLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.getLogMetric(request), expectedError); + }); + }); + + describe('createLogMetric', () => { + it('invokes createLogMetric without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLogMetricRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogMetric(), + ); + client.innerApiCalls.createLogMetric = stubSimpleCall(expectedResponse); + const [response] = await client.createLogMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLogMetric without error using callback', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLogMetricRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogMetric(), + ); + client.innerApiCalls.createLogMetric = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createLogMetric( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogMetric | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLogMetric with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLogMetricRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createLogMetric = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.createLogMetric(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.CreateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.CreateLogMetricRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.createLogMetric(request), expectedError); + }); + }); + + describe('updateLogMetric', () => { + it('invokes updateLogMetric without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogMetric(), + ); + client.innerApiCalls.updateLogMetric = stubSimpleCall(expectedResponse); + const [response] = await client.updateLogMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLogMetric without error using callback', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.logging.v2.LogMetric(), + ); + client.innerApiCalls.updateLogMetric = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateLogMetric( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogMetric | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLogMetric with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateLogMetric = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.updateLogMetric(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.UpdateLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.UpdateLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.updateLogMetric(request), expectedError); + }); + }); + + describe('deleteLogMetric', () => { + it('invokes deleteLogMetric without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteLogMetric = stubSimpleCall(expectedResponse); + const [response] = await client.deleteLogMetric(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLogMetric without error using callback', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty(), + ); + client.innerApiCalls.deleteLogMetric = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteLogMetric( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLogMetric with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedHeaderRequestParams = `metric_name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteLogMetric = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.deleteLogMetric(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteLogMetric as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteLogMetric as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteLogMetric with closed client', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.DeleteLogMetricRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.DeleteLogMetricRequest', + ['metricName'], + ); + request.metricName = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch((err) => { + throw err; + }); + await assert.rejects(client.deleteLogMetric(request), expectedError); + }); + }); + + describe('listLogMetrics', () => { + it('invokes listLogMetrics without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + ]; + client.innerApiCalls.listLogMetrics = stubSimpleCall(expectedResponse); + const [response] = await client.listLogMetrics(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLogMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogMetrics without error using callback', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + ]; + client.innerApiCalls.listLogMetrics = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listLogMetrics( + request, + ( + err?: Error | null, + result?: protos.google.logging.v2.ILogMetric[] | null, + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }, + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listLogMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogMetrics with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listLogMetrics = stubSimpleCall( + undefined, + expectedError, + ); + await assert.rejects(client.listLogMetrics(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listLogMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listLogMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listLogMetricsStream without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + ]; + client.descriptors.page.listLogMetrics.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listLogMetricsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogMetric[] = []; + stream.on('data', (response: protos.google.logging.v2.LogMetric) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listLogMetrics.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogMetrics, request), + ); + assert( + (client.descriptors.page.listLogMetrics.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('invokes listLogMetricsStream with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLogMetrics.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listLogMetricsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.logging.v2.LogMetric[] = []; + stream.on('data', (response: protos.google.logging.v2.LogMetric) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listLogMetrics.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listLogMetrics, request), + ); + assert( + (client.descriptors.page.listLogMetrics.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLogMetrics without error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + generateSampleMessage(new protos.google.logging.v2.LogMetric()), + ]; + client.descriptors.page.listLogMetrics.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.logging.v2.ILogMetric[] = []; + const iterable = client.listLogMetricsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listLogMetrics.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listLogMetrics.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + + it('uses async iteration with listLogMetrics with error', async () => { + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.logging.v2.ListLogMetricsRequest(), + ); + const defaultValue1 = getTypeDefaultValue( + '.google.logging.v2.ListLogMetricsRequest', + ['parent'], + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listLogMetrics.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLogMetricsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.logging.v2.ILogMetric[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listLogMetrics.asyncIterate as SinonStub + ).getCall(0).args[1], + request, + ); + assert( + (client.descriptors.page.listLogMetrics.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams), + ); + }); + }); + + describe('Path templates', () => { + describe('billingAccountCmekSettings', async () => { + const fakePath = '/rendered/path/billingAccountCmekSettings'; + const expectedParameters = { + billing_account: 'billingAccountValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountCmekSettingsPath', () => { + const result = client.billingAccountCmekSettingsPath( + 'billingAccountValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountCmekSettingsName', () => { + const result = + client.matchBillingAccountFromBillingAccountCmekSettingsName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountExclusion', async () => { + const fakePath = '/rendered/path/billingAccountExclusion'; + const expectedParameters = { + billing_account: 'billingAccountValue', + exclusion: 'exclusionValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountExclusionPath', () => { + const result = client.billingAccountExclusionPath( + 'billingAccountValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountExclusionName', () => { + const result = + client.matchBillingAccountFromBillingAccountExclusionName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromBillingAccountExclusionName', () => { + const result = + client.matchExclusionFromBillingAccountExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + ( + client.pathTemplates.billingAccountExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucket', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucket'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketPath', () => { + const result = client.billingAccountLocationBucketPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucketLink', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucketLink'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketLinkPath', () => { + const result = client.billingAccountLocationBucketLinkPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromBillingAccountLocationBucketLinkName', () => { + const result = + client.matchLinkFromBillingAccountLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLocationBucketView', async () => { + const fakePath = '/rendered/path/billingAccountLocationBucketView'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLocationBucketViewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.billingAccountLocationBucketViewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('billingAccountLocationBucketViewPath', () => { + const result = client.billingAccountLocationBucketViewPath( + 'billingAccountValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchBillingAccountFromBillingAccountLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchLocationFromBillingAccountLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchBucketFromBillingAccountLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromBillingAccountLocationBucketViewName', () => { + const result = + client.matchViewFromBillingAccountLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.billingAccountLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountLog', async () => { + const fakePath = '/rendered/path/billingAccountLog'; + const expectedParameters = { + billing_account: 'billingAccountValue', + log: 'logValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountLogPath', () => { + const result = client.billingAccountLogPath( + 'billingAccountValue', + 'logValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountLogName', () => { + const result = + client.matchBillingAccountFromBillingAccountLogName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromBillingAccountLogName', () => { + const result = client.matchLogFromBillingAccountLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + ( + client.pathTemplates.billingAccountLogPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('billingAccountSettings', async () => { + 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', + }); + await 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', async () => { + const fakePath = '/rendered/path/billingAccountSink'; + const expectedParameters = { + billing_account: 'billingAccountValue', + sink: 'sinkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.billingAccountSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountSinkPath', () => { + const result = client.billingAccountSinkPath( + 'billingAccountValue', + 'sinkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchBillingAccountFromBillingAccountSinkName', () => { + const result = + client.matchBillingAccountFromBillingAccountSinkName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromBillingAccountSinkName', () => { + const result = client.matchSinkFromBillingAccountSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + ( + client.pathTemplates.billingAccountSinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderCmekSettings', async () => { + const fakePath = '/rendered/path/folderCmekSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderCmekSettingsPath', () => { + const result = client.folderCmekSettingsPath('folderValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderCmekSettingsName', () => { + const result = client.matchFolderFromFolderCmekSettingsName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderExclusion', async () => { + const fakePath = '/rendered/path/folderExclusion'; + const expectedParameters = { + folder: 'folderValue', + exclusion: 'exclusionValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderExclusionPath', () => { + const result = client.folderExclusionPath( + 'folderValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderExclusionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderExclusionName', () => { + const result = client.matchFolderFromFolderExclusionName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromFolderExclusionName', () => { + const result = client.matchExclusionFromFolderExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + (client.pathTemplates.folderExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucket', async () => { + const fakePath = '/rendered/path/folderLocationBucket'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketPath', () => { + const result = client.folderLocationBucketPath( + 'folderValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketName', () => { + const result = client.matchFolderFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketName', () => { + const result = + client.matchLocationFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketName', () => { + const result = client.matchBucketFromFolderLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucketLink', async () => { + const fakePath = '/rendered/path/folderLocationBucketLink'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketLinkPath', () => { + const result = client.folderLocationBucketLinkPath( + 'folderValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketLinkName', () => { + const result = + client.matchFolderFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketLinkName', () => { + const result = + client.matchLocationFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketLinkName', () => { + const result = + client.matchBucketFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromFolderLocationBucketLinkName', () => { + const result = + client.matchLinkFromFolderLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.folderLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLocationBucketView', async () => { + const fakePath = '/rendered/path/folderLocationBucketView'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLocationBucketViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationBucketViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationBucketViewPath', () => { + const result = client.folderLocationBucketViewPath( + 'folderValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLocationBucketViewName', () => { + const result = + client.matchFolderFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromFolderLocationBucketViewName', () => { + const result = + client.matchLocationFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromFolderLocationBucketViewName', () => { + const result = + client.matchBucketFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromFolderLocationBucketViewName', () => { + const result = + client.matchViewFromFolderLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.folderLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderLog', async () => { + const fakePath = '/rendered/path/folderLog'; + const expectedParameters = { + folder: 'folderValue', + log: 'logValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLogPath', () => { + const result = client.folderLogPath('folderValue', 'logValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderLogName', () => { + const result = client.matchFolderFromFolderLogName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromFolderLogName', () => { + const result = client.matchLogFromFolderLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.folderLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('folderSettings', async () => { + const fakePath = '/rendered/path/folderSettings'; + const expectedParameters = { + folder: 'folderValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/folderSink'; + const expectedParameters = { + folder: 'folderValue', + sink: 'sinkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.folderSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderSinkPath', () => { + const result = client.folderSinkPath('folderValue', 'sinkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderSinkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchFolderFromFolderSinkName', () => { + const result = client.matchFolderFromFolderSinkName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromFolderSinkName', () => { + const result = client.matchSinkFromFolderSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.folderSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('logMetric', async () => { + const fakePath = '/rendered/path/logMetric'; + const expectedParameters = { + project: 'projectValue', + metric: 'metricValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.logMetricPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.logMetricPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('logMetricPath', () => { + const result = client.logMetricPath('projectValue', 'metricValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.logMetricPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromLogMetricName', () => { + const result = client.matchProjectFromLogMetricName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.logMetricPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchMetricFromLogMetricName', () => { + const result = client.matchMetricFromLogMetricName(fakePath); + assert.strictEqual(result, 'metricValue'); + assert( + (client.pathTemplates.logMetricPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationCmekSettings', async () => { + const fakePath = '/rendered/path/organizationCmekSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationCmekSettingsPath', () => { + const result = client.organizationCmekSettingsPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationCmekSettingsName', () => { + const result = + client.matchOrganizationFromOrganizationCmekSettingsName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationExclusion', async () => { + const fakePath = '/rendered/path/organizationExclusion'; + const expectedParameters = { + organization: 'organizationValue', + exclusion: 'exclusionValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationExclusionPath', () => { + const result = client.organizationExclusionPath( + 'organizationValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationExclusionName', () => { + const result = + client.matchOrganizationFromOrganizationExclusionName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromOrganizationExclusionName', () => { + const result = + client.matchExclusionFromOrganizationExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + ( + client.pathTemplates.organizationExclusionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucket', async () => { + const fakePath = '/rendered/path/organizationLocationBucket'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLocationBucketPath', () => { + const result = client.organizationLocationBucketPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucketLink', async () => { + const fakePath = '/rendered/path/organizationLocationBucketLink'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketLinkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBucketLinkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBucketLinkPath', () => { + const result = client.organizationLocationBucketLinkPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketLinkName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromOrganizationLocationBucketLinkName', () => { + const result = + client.matchLinkFromOrganizationLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLocationBucketView', async () => { + const fakePath = '/rendered/path/organizationLocationBucketView'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationBucketViewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationBucketViewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationBucketViewPath', () => { + const result = client.organizationLocationBucketViewPath( + 'organizationValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLocationBucketViewName', () => { + const result = + client.matchOrganizationFromOrganizationLocationBucketViewName( + fakePath, + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromOrganizationLocationBucketViewName', () => { + const result = + client.matchLocationFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromOrganizationLocationBucketViewName', () => { + const result = + client.matchBucketFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromOrganizationLocationBucketViewName', () => { + const result = + client.matchViewFromOrganizationLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.organizationLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationLog', async () => { + const fakePath = '/rendered/path/organizationLog'; + const expectedParameters = { + organization: 'organizationValue', + log: 'logValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLogPath', () => { + const result = client.organizationLogPath( + 'organizationValue', + 'logValue', + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationLogName', () => { + const result = + client.matchOrganizationFromOrganizationLogName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromOrganizationLogName', () => { + const result = client.matchLogFromOrganizationLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.organizationLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('organizationSettings', async () => { + const fakePath = '/rendered/path/organizationSettings'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/organizationSink'; + const expectedParameters = { + organization: 'organizationValue', + sink: 'sinkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationSinkPath', () => { + const result = client.organizationSinkPath( + 'organizationValue', + 'sinkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationSinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchOrganizationFromOrganizationSinkName', () => { + const result = + client.matchOrganizationFromOrganizationSinkName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromOrganizationSinkName', () => { + const result = client.matchSinkFromOrganizationSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.organizationSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('project', async () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectCmekSettings', async () => { + const fakePath = '/rendered/path/projectCmekSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectCmekSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectCmekSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectCmekSettingsPath', () => { + const result = client.projectCmekSettingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectCmekSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectCmekSettingsName', () => { + const result = client.matchProjectFromProjectCmekSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectCmekSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectExclusion', async () => { + const fakePath = '/rendered/path/projectExclusion'; + const expectedParameters = { + project: 'projectValue', + exclusion: 'exclusionValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectExclusionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectExclusionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectExclusionPath', () => { + const result = client.projectExclusionPath( + 'projectValue', + 'exclusionValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectExclusionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectExclusionName', () => { + const result = client.matchProjectFromProjectExclusionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchExclusionFromProjectExclusionName', () => { + const result = client.matchExclusionFromProjectExclusionName(fakePath); + assert.strictEqual(result, 'exclusionValue'); + assert( + (client.pathTemplates.projectExclusionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucket', async () => { + const fakePath = '/rendered/path/projectLocationBucket'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketPath', () => { + const result = client.projectLocationBucketPath( + 'projectValue', + 'locationValue', + 'bucketValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketName', () => { + const result = + client.matchProjectFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketName', () => { + const result = + client.matchLocationFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketName', () => { + const result = + client.matchBucketFromProjectLocationBucketName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucketLink', async () => { + const fakePath = '/rendered/path/projectLocationBucketLink'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + link: 'linkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketLinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketLinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketLinkPath', () => { + const result = client.projectLocationBucketLinkPath( + 'projectValue', + 'locationValue', + 'bucketValue', + 'linkValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketLinkName', () => { + const result = + client.matchProjectFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketLinkName', () => { + const result = + client.matchLocationFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketLinkName', () => { + const result = + client.matchBucketFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLinkFromProjectLocationBucketLinkName', () => { + const result = + client.matchLinkFromProjectLocationBucketLinkName(fakePath); + assert.strictEqual(result, 'linkValue'); + assert( + ( + client.pathTemplates.projectLocationBucketLinkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLocationBucketView', async () => { + const fakePath = '/rendered/path/projectLocationBucketView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + bucket: 'bucketValue', + view: 'viewValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationBucketViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBucketViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBucketViewPath', () => { + const result = client.projectLocationBucketViewPath( + 'projectValue', + 'locationValue', + 'bucketValue', + 'viewValue', + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLocationBucketViewName', () => { + const result = + client.matchProjectFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLocationFromProjectLocationBucketViewName', () => { + const result = + client.matchLocationFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchBucketFromProjectLocationBucketViewName', () => { + const result = + client.matchBucketFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'bucketValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchViewFromProjectLocationBucketViewName', () => { + const result = + client.matchViewFromProjectLocationBucketViewName(fakePath); + assert.strictEqual(result, 'viewValue'); + assert( + ( + client.pathTemplates.projectLocationBucketViewPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectLog', async () => { + const fakePath = '/rendered/path/projectLog'; + const expectedParameters = { + project: 'projectValue', + log: 'logValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLogPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLogPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLogPath', () => { + const result = client.projectLogPath('projectValue', 'logValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLogPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectLogName', () => { + const result = client.matchProjectFromProjectLogName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchLogFromProjectLogName', () => { + const result = client.matchLogFromProjectLogName(fakePath); + assert.strictEqual(result, 'logValue'); + assert( + (client.pathTemplates.projectLogPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + + describe('projectSettings', async () => { + const fakePath = '/rendered/path/projectSettings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await 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', async () => { + const fakePath = '/rendered/path/projectSink'; + const expectedParameters = { + project: 'projectValue', + sink: 'sinkValue', + }; + const client = new metricsservicev2Module.v2.MetricsServiceV2Client({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectSinkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectSinkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectSinkPath', () => { + const result = client.projectSinkPath('projectValue', 'sinkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectSinkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters), + ); + }); + + it('matchProjectFromProjectSinkName', () => { + const result = client.matchProjectFromProjectSinkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + + it('matchSinkFromProjectSinkName', () => { + const result = client.matchSinkFromProjectSinkName(fakePath); + assert.strictEqual(result, 'sinkValue'); + assert( + (client.pathTemplates.projectSinkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath), + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-logging-api/tsconfig.json b/packages/google-cloud-logging-api/tsconfig.json new file mode 100644 index 000000000000..ca73e7bfc824 --- /dev/null +++ b/packages/google-cloud-logging-api/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2023", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts", + "src/**/*.json", + "samples/**/*.json", + "protos/protos.json" + ] +} diff --git a/packages/google-cloud-logging-api/webpack.config.js b/packages/google-cloud-logging-api/webpack.config.js new file mode 100644 index 000000000000..be8cb0f75d83 --- /dev/null +++ b/packages/google-cloud-logging-api/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ConfigServiceV2', + filename: './config-service-v2.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +};