diff --git a/.gitignore b/.gitignore index a4b7d6a3..5d32b237 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ out/ @@ -9,7 +10,5 @@ system-test/secrets.js system-test/*key.json *.lock .DS_Store -google-cloud-logging-winston-*.tgz -google-cloud-logging-bunyan-*.tgz package-lock.json __pycache__ diff --git a/.jsdoc.js b/.jsdoc.js index 97b97e65..05a557ab 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -31,7 +31,7 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src' ], includePattern: '\\.js$' }, diff --git a/linkinator.config.json b/linkinator.config.json index 0c7bde97..b555215c 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -3,7 +3,6 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "https://cloud.google.com/monitoring/workspaces/tiers", "img.shields.io" ] } diff --git a/package.json b/package.json index d89662cb..3c2e3ca1 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "node": ">=8.10.0" }, "repository": "googleapis/nodejs-monitoring", - "main": "src/index.js", + "main": "build/src/index.js", "files": [ - "src", - "protos" + "build/src", + "build/protos" ], "keywords": [ "google apis client", @@ -28,29 +28,43 @@ ], "scripts": { "docs": "jsdoc -c .jsdoc.js", - "lint": "eslint '**/*.js'", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js --timeout 600000", - "test": "c8 mocha", - "fix": "eslint '**/*.js' --fix", + "lint": "gts fix && eslint --fix samples/*.js", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "system-test": "mocha build/system-test", + "test": "c8 mocha build/test", + "fix": "gts fix", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "predocs-test": "npm run docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile" }, "dependencies": { - "google-gax": "^1.7.5" + "google-gax": "^1.9.0" }, "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", "c8": "^7.0.0", "codecov": "^3.0.0", "eslint": "^6.0.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.0.0", + "gts": "^1.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.0", - "mocha": "^7.0.0", - "prettier": "^1.7.4" + "power-assert": "^1.6.0", + "prettier": "^1.13.7", + "mocha": "^6.1.4", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "ts-loader": "^6.2.1", + "typescript": "^3.7.0", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" } } diff --git a/protos/google/cloud/common_resources.proto b/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000..56c9f800 --- /dev/null +++ b/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 729dd9cc..7ab2191a 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -23,12964 +23,13150 @@ export namespace google { /** Namespace v3. */ namespace v3 { - /** Represents an AlertPolicyService */ - class AlertPolicyService extends $protobuf.rpc.Service { - - /** - * Constructs a new AlertPolicyService 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); + /** Properties of an AlertPolicy. */ + interface IAlertPolicy { - /** - * Creates new AlertPolicyService 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): AlertPolicyService; + /** AlertPolicy name */ + name?: (string|null); - /** - * Calls ListAlertPolicies. - * @param request ListAlertPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAlertPoliciesResponse - */ - public listAlertPolicies(request: google.monitoring.v3.IListAlertPoliciesRequest, callback: google.monitoring.v3.AlertPolicyService.ListAlertPoliciesCallback): void; + /** AlertPolicy displayName */ + displayName?: (string|null); - /** - * Calls ListAlertPolicies. - * @param request ListAlertPoliciesRequest message or plain object - * @returns Promise - */ - public listAlertPolicies(request: google.monitoring.v3.IListAlertPoliciesRequest): Promise; + /** AlertPolicy documentation */ + documentation?: (google.monitoring.v3.AlertPolicy.IDocumentation|null); - /** - * Calls GetAlertPolicy. - * @param request GetAlertPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AlertPolicy - */ - public getAlertPolicy(request: google.monitoring.v3.IGetAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.GetAlertPolicyCallback): void; + /** AlertPolicy userLabels */ + userLabels?: ({ [k: string]: string }|null); - /** - * Calls GetAlertPolicy. - * @param request GetAlertPolicyRequest message or plain object - * @returns Promise - */ - public getAlertPolicy(request: google.monitoring.v3.IGetAlertPolicyRequest): Promise; + /** AlertPolicy conditions */ + conditions?: (google.monitoring.v3.AlertPolicy.ICondition[]|null); - /** - * Calls CreateAlertPolicy. - * @param request CreateAlertPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AlertPolicy - */ - public createAlertPolicy(request: google.monitoring.v3.ICreateAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.CreateAlertPolicyCallback): void; + /** AlertPolicy combiner */ + combiner?: (google.monitoring.v3.AlertPolicy.ConditionCombinerType|keyof typeof google.monitoring.v3.AlertPolicy.ConditionCombinerType|null); - /** - * Calls CreateAlertPolicy. - * @param request CreateAlertPolicyRequest message or plain object - * @returns Promise - */ - public createAlertPolicy(request: google.monitoring.v3.ICreateAlertPolicyRequest): Promise; + /** AlertPolicy enabled */ + enabled?: (google.protobuf.IBoolValue|null); - /** - * Calls DeleteAlertPolicy. - * @param request DeleteAlertPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAlertPolicy(request: google.monitoring.v3.IDeleteAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.DeleteAlertPolicyCallback): void; + /** AlertPolicy validity */ + validity?: (google.rpc.IStatus|null); - /** - * Calls DeleteAlertPolicy. - * @param request DeleteAlertPolicyRequest message or plain object - * @returns Promise - */ - public deleteAlertPolicy(request: google.monitoring.v3.IDeleteAlertPolicyRequest): Promise; + /** AlertPolicy notificationChannels */ + notificationChannels?: (string[]|null); - /** - * Calls UpdateAlertPolicy. - * @param request UpdateAlertPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AlertPolicy - */ - public updateAlertPolicy(request: google.monitoring.v3.IUpdateAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.UpdateAlertPolicyCallback): void; + /** AlertPolicy creationRecord */ + creationRecord?: (google.monitoring.v3.IMutationRecord|null); - /** - * Calls UpdateAlertPolicy. - * @param request UpdateAlertPolicyRequest message or plain object - * @returns Promise - */ - public updateAlertPolicy(request: google.monitoring.v3.IUpdateAlertPolicyRequest): Promise; + /** AlertPolicy mutationRecord */ + mutationRecord?: (google.monitoring.v3.IMutationRecord|null); } - namespace AlertPolicyService { + /** Represents an AlertPolicy. */ + class AlertPolicy implements IAlertPolicy { /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#listAlertPolicies}. - * @param error Error, if any - * @param [response] ListAlertPoliciesResponse + * Constructs a new AlertPolicy. + * @param [properties] Properties to set */ - type ListAlertPoliciesCallback = (error: (Error|null), response?: google.monitoring.v3.ListAlertPoliciesResponse) => void; + constructor(properties?: google.monitoring.v3.IAlertPolicy); - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#getAlertPolicy}. - * @param error Error, if any - * @param [response] AlertPolicy - */ - type GetAlertPolicyCallback = (error: (Error|null), response?: google.monitoring.v3.AlertPolicy) => void; + /** AlertPolicy name. */ + public name: string; - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#createAlertPolicy}. - * @param error Error, if any - * @param [response] AlertPolicy - */ - type CreateAlertPolicyCallback = (error: (Error|null), response?: google.monitoring.v3.AlertPolicy) => void; + /** AlertPolicy displayName. */ + public displayName: string; - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#deleteAlertPolicy}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAlertPolicyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** AlertPolicy documentation. */ + public documentation?: (google.monitoring.v3.AlertPolicy.IDocumentation|null); - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#updateAlertPolicy}. - * @param error Error, if any - * @param [response] AlertPolicy - */ - type UpdateAlertPolicyCallback = (error: (Error|null), response?: google.monitoring.v3.AlertPolicy) => void; - } + /** AlertPolicy userLabels. */ + public userLabels: { [k: string]: string }; - /** Properties of a CreateAlertPolicyRequest. */ - interface ICreateAlertPolicyRequest { + /** AlertPolicy conditions. */ + public conditions: google.monitoring.v3.AlertPolicy.ICondition[]; - /** CreateAlertPolicyRequest name */ - name?: (string|null); + /** AlertPolicy combiner. */ + public combiner: (google.monitoring.v3.AlertPolicy.ConditionCombinerType|keyof typeof google.monitoring.v3.AlertPolicy.ConditionCombinerType); - /** CreateAlertPolicyRequest alertPolicy */ - alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); - } + /** AlertPolicy enabled. */ + public enabled?: (google.protobuf.IBoolValue|null); - /** Represents a CreateAlertPolicyRequest. */ - class CreateAlertPolicyRequest implements ICreateAlertPolicyRequest { + /** AlertPolicy validity. */ + public validity?: (google.rpc.IStatus|null); - /** - * Constructs a new CreateAlertPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.ICreateAlertPolicyRequest); + /** AlertPolicy notificationChannels. */ + public notificationChannels: string[]; - /** CreateAlertPolicyRequest name. */ - public name: string; + /** AlertPolicy creationRecord. */ + public creationRecord?: (google.monitoring.v3.IMutationRecord|null); - /** CreateAlertPolicyRequest alertPolicy. */ - public alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); + /** AlertPolicy mutationRecord. */ + public mutationRecord?: (google.monitoring.v3.IMutationRecord|null); /** - * Creates a new CreateAlertPolicyRequest instance using the specified properties. + * Creates a new AlertPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns CreateAlertPolicyRequest instance + * @returns AlertPolicy instance */ - public static create(properties?: google.monitoring.v3.ICreateAlertPolicyRequest): google.monitoring.v3.CreateAlertPolicyRequest; + public static create(properties?: google.monitoring.v3.IAlertPolicy): google.monitoring.v3.AlertPolicy; /** - * Encodes the specified CreateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. - * @param message CreateAlertPolicyRequest message or plain object to encode + * Encodes the specified AlertPolicy message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. + * @param message AlertPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ICreateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IAlertPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. - * @param message CreateAlertPolicyRequest message or plain object to encode + * Encodes the specified AlertPolicy message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. + * @param message AlertPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ICreateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IAlertPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer. + * Decodes an AlertPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateAlertPolicyRequest + * @returns AlertPolicy * @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.monitoring.v3.CreateAlertPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.AlertPolicy; /** - * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an AlertPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateAlertPolicyRequest + * @returns AlertPolicy * @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.monitoring.v3.CreateAlertPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.AlertPolicy; /** - * Verifies a CreateAlertPolicyRequest message. + * Verifies an AlertPolicy 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 CreateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AlertPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateAlertPolicyRequest + * @returns AlertPolicy */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateAlertPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy; /** - * Creates a plain object from a CreateAlertPolicyRequest message. Also converts values to other types if specified. - * @param message CreateAlertPolicyRequest + * Creates a plain object from an AlertPolicy message. Also converts values to other types if specified. + * @param message AlertPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.CreateAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.AlertPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateAlertPolicyRequest to JSON. + * Converts this AlertPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetAlertPolicyRequest. */ - interface IGetAlertPolicyRequest { - - /** GetAlertPolicyRequest name */ - name?: (string|null); - } + namespace AlertPolicy { - /** Represents a GetAlertPolicyRequest. */ - class GetAlertPolicyRequest implements IGetAlertPolicyRequest { + /** Properties of a Documentation. */ + interface IDocumentation { - /** - * Constructs a new GetAlertPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IGetAlertPolicyRequest); + /** Documentation content */ + content?: (string|null); - /** GetAlertPolicyRequest name. */ - public name: string; + /** Documentation mimeType */ + mimeType?: (string|null); + } - /** - * Creates a new GetAlertPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAlertPolicyRequest instance - */ - public static create(properties?: google.monitoring.v3.IGetAlertPolicyRequest): google.monitoring.v3.GetAlertPolicyRequest; + /** Represents a Documentation. */ + class Documentation implements IDocumentation { - /** - * Encodes the specified GetAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. - * @param message GetAlertPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IGetAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. - * @param message GetAlertPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IGetAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Documentation. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.AlertPolicy.IDocumentation); - /** - * Decodes a GetAlertPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAlertPolicyRequest - * @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.monitoring.v3.GetAlertPolicyRequest; + /** Documentation content. */ + public content: string; - /** - * Decodes a GetAlertPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAlertPolicyRequest - * @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.monitoring.v3.GetAlertPolicyRequest; + /** Documentation mimeType. */ + public mimeType: string; - /** - * Verifies a GetAlertPolicyRequest 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 new Documentation instance using the specified properties. + * @param [properties] Properties to set + * @returns Documentation instance + */ + public static create(properties?: google.monitoring.v3.AlertPolicy.IDocumentation): google.monitoring.v3.AlertPolicy.Documentation; - /** - * Creates a GetAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAlertPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetAlertPolicyRequest; + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.AlertPolicy.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a GetAlertPolicyRequest message. Also converts values to other types if specified. - * @param message GetAlertPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.GetAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. + * @param message Documentation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this GetAlertPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a Documentation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documentation + * @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.monitoring.v3.AlertPolicy.Documentation; - /** Properties of a ListAlertPoliciesRequest. */ - interface IListAlertPoliciesRequest { + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documentation + * @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.monitoring.v3.AlertPolicy.Documentation; - /** ListAlertPoliciesRequest name */ - name?: (string|null); + /** + * Verifies a Documentation 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); - /** ListAlertPoliciesRequest filter */ - filter?: (string|null); + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documentation + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Documentation; - /** ListAlertPoliciesRequest orderBy */ - orderBy?: (string|null); + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @param message Documentation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.AlertPolicy.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListAlertPoliciesRequest pageSize */ - pageSize?: (number|null); + /** + * Converts this Documentation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListAlertPoliciesRequest pageToken */ - pageToken?: (string|null); - } + /** Properties of a Condition. */ + interface ICondition { - /** Represents a ListAlertPoliciesRequest. */ - class ListAlertPoliciesRequest implements IListAlertPoliciesRequest { + /** Condition name */ + name?: (string|null); - /** - * Constructs a new ListAlertPoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListAlertPoliciesRequest); + /** Condition displayName */ + displayName?: (string|null); - /** ListAlertPoliciesRequest name. */ - public name: string; + /** Condition conditionThreshold */ + conditionThreshold?: (google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null); - /** ListAlertPoliciesRequest filter. */ - public filter: string; + /** Condition conditionAbsent */ + conditionAbsent?: (google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null); + } - /** ListAlertPoliciesRequest orderBy. */ - public orderBy: string; + /** Represents a Condition. */ + class Condition implements ICondition { - /** ListAlertPoliciesRequest pageSize. */ - public pageSize: number; + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.AlertPolicy.ICondition); - /** ListAlertPoliciesRequest pageToken. */ - public pageToken: string; + /** Condition name. */ + public name: string; - /** - * Creates a new ListAlertPoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAlertPoliciesRequest instance - */ - public static create(properties?: google.monitoring.v3.IListAlertPoliciesRequest): google.monitoring.v3.ListAlertPoliciesRequest; + /** Condition displayName. */ + public displayName: string; - /** - * Encodes the specified ListAlertPoliciesRequest message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. - * @param message ListAlertPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListAlertPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Condition conditionThreshold. */ + public conditionThreshold?: (google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null); - /** - * Encodes the specified ListAlertPoliciesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. - * @param message ListAlertPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListAlertPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Condition conditionAbsent. */ + public conditionAbsent?: (google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null); - /** - * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAlertPoliciesRequest - * @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.monitoring.v3.ListAlertPoliciesRequest; + /** Condition condition. */ + public condition?: ("conditionThreshold"|"conditionAbsent"); - /** - * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAlertPoliciesRequest - * @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.monitoring.v3.ListAlertPoliciesRequest; + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.monitoring.v3.AlertPolicy.ICondition): google.monitoring.v3.AlertPolicy.Condition; - /** - * Verifies a ListAlertPoliciesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified Condition message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.AlertPolicy.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a ListAlertPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAlertPoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListAlertPoliciesRequest; + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ListAlertPoliciesRequest message. Also converts values to other types if specified. - * @param message ListAlertPoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListAlertPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.monitoring.v3.AlertPolicy.Condition; - /** - * Converts this ListAlertPoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.monitoring.v3.AlertPolicy.Condition; - /** Properties of a ListAlertPoliciesResponse. */ - interface IListAlertPoliciesResponse { + /** + * Verifies a Condition 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); - /** ListAlertPoliciesResponse alertPolicies */ - alertPolicies?: (google.monitoring.v3.IAlertPolicy[]|null); + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition; - /** ListAlertPoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.AlertPolicy.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a ListAlertPoliciesResponse. */ - class ListAlertPoliciesResponse implements IListAlertPoliciesResponse { + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ListAlertPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListAlertPoliciesResponse); + namespace Condition { - /** ListAlertPoliciesResponse alertPolicies. */ - public alertPolicies: google.monitoring.v3.IAlertPolicy[]; + /** Properties of a Trigger. */ + interface ITrigger { - /** ListAlertPoliciesResponse nextPageToken. */ - public nextPageToken: string; + /** Trigger count */ + count?: (number|null); - /** - * Creates a new ListAlertPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAlertPoliciesResponse instance - */ - public static create(properties?: google.monitoring.v3.IListAlertPoliciesResponse): google.monitoring.v3.ListAlertPoliciesResponse; + /** Trigger percent */ + percent?: (number|null); + } - /** - * Encodes the specified ListAlertPoliciesResponse message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. - * @param message ListAlertPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListAlertPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Trigger. */ + class Trigger implements ITrigger { - /** - * Encodes the specified ListAlertPoliciesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. - * @param message ListAlertPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListAlertPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Trigger. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.ITrigger); - /** - * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAlertPoliciesResponse - * @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.monitoring.v3.ListAlertPoliciesResponse; + /** Trigger count. */ + public count: number; - /** - * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAlertPoliciesResponse - * @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.monitoring.v3.ListAlertPoliciesResponse; + /** Trigger percent. */ + public percent: number; - /** - * Verifies a ListAlertPoliciesResponse 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); + /** Trigger type. */ + public type?: ("count"|"percent"); - /** - * Creates a ListAlertPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAlertPoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListAlertPoliciesResponse; + /** + * Creates a new Trigger instance using the specified properties. + * @param [properties] Properties to set + * @returns Trigger instance + */ + public static create(properties?: google.monitoring.v3.AlertPolicy.Condition.ITrigger): google.monitoring.v3.AlertPolicy.Condition.Trigger; - /** - * Creates a plain object from a ListAlertPoliciesResponse message. Also converts values to other types if specified. - * @param message ListAlertPoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListAlertPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified Trigger message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. + * @param message Trigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.AlertPolicy.Condition.ITrigger, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ListAlertPoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified Trigger message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. + * @param message Trigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.Condition.ITrigger, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an UpdateAlertPolicyRequest. */ - interface IUpdateAlertPolicyRequest { + /** + * Decodes a Trigger message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Trigger + * @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.monitoring.v3.AlertPolicy.Condition.Trigger; - /** UpdateAlertPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** + * Decodes a Trigger message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Trigger + * @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.monitoring.v3.AlertPolicy.Condition.Trigger; - /** UpdateAlertPolicyRequest alertPolicy */ - alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); - } + /** + * Verifies a Trigger 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); - /** Represents an UpdateAlertPolicyRequest. */ - class UpdateAlertPolicyRequest implements IUpdateAlertPolicyRequest { + /** + * Creates a Trigger message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Trigger + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition.Trigger; - /** - * Constructs a new UpdateAlertPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IUpdateAlertPolicyRequest); + /** + * Creates a plain object from a Trigger message. Also converts values to other types if specified. + * @param message Trigger + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.AlertPolicy.Condition.Trigger, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UpdateAlertPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Converts this Trigger to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** UpdateAlertPolicyRequest alertPolicy. */ - public alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); + /** Properties of a MetricThreshold. */ + interface IMetricThreshold { - /** - * Creates a new UpdateAlertPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAlertPolicyRequest instance - */ - public static create(properties?: google.monitoring.v3.IUpdateAlertPolicyRequest): google.monitoring.v3.UpdateAlertPolicyRequest; + /** MetricThreshold filter */ + filter?: (string|null); - /** - * Encodes the specified UpdateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. - * @param message UpdateAlertPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IUpdateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MetricThreshold aggregations */ + aggregations?: (google.monitoring.v3.IAggregation[]|null); - /** - * Encodes the specified UpdateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. - * @param message UpdateAlertPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IUpdateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAlertPolicyRequest - * @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.monitoring.v3.UpdateAlertPolicyRequest; + /** MetricThreshold denominatorFilter */ + denominatorFilter?: (string|null); - /** - * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAlertPolicyRequest - * @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.monitoring.v3.UpdateAlertPolicyRequest; + /** MetricThreshold denominatorAggregations */ + denominatorAggregations?: (google.monitoring.v3.IAggregation[]|null); - /** - * Verifies an UpdateAlertPolicyRequest 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); + /** MetricThreshold comparison */ + comparison?: (google.monitoring.v3.ComparisonType|keyof typeof google.monitoring.v3.ComparisonType|null); - /** - * Creates an UpdateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAlertPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateAlertPolicyRequest; + /** MetricThreshold thresholdValue */ + thresholdValue?: (number|null); - /** - * Creates a plain object from an UpdateAlertPolicyRequest message. Also converts values to other types if specified. - * @param message UpdateAlertPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UpdateAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MetricThreshold duration */ + duration?: (google.protobuf.IDuration|null); - /** - * Converts this UpdateAlertPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MetricThreshold trigger */ + trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); + } - /** Properties of a DeleteAlertPolicyRequest. */ - interface IDeleteAlertPolicyRequest { + /** Represents a MetricThreshold. */ + class MetricThreshold implements IMetricThreshold { - /** DeleteAlertPolicyRequest name */ - name?: (string|null); - } + /** + * Constructs a new MetricThreshold. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold); - /** Represents a DeleteAlertPolicyRequest. */ - class DeleteAlertPolicyRequest implements IDeleteAlertPolicyRequest { + /** MetricThreshold filter. */ + public filter: string; - /** - * Constructs a new DeleteAlertPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IDeleteAlertPolicyRequest); + /** MetricThreshold aggregations. */ + public aggregations: google.monitoring.v3.IAggregation[]; - /** DeleteAlertPolicyRequest name. */ - public name: string; + /** MetricThreshold denominatorFilter. */ + public denominatorFilter: string; - /** - * Creates a new DeleteAlertPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAlertPolicyRequest instance - */ - public static create(properties?: google.monitoring.v3.IDeleteAlertPolicyRequest): google.monitoring.v3.DeleteAlertPolicyRequest; + /** MetricThreshold denominatorAggregations. */ + public denominatorAggregations: google.monitoring.v3.IAggregation[]; - /** - * Encodes the specified DeleteAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. - * @param message DeleteAlertPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IDeleteAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MetricThreshold comparison. */ + public comparison: (google.monitoring.v3.ComparisonType|keyof typeof google.monitoring.v3.ComparisonType); - /** - * Encodes the specified DeleteAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. - * @param message DeleteAlertPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MetricThreshold thresholdValue. */ + public thresholdValue: number; - /** - * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAlertPolicyRequest - * @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.monitoring.v3.DeleteAlertPolicyRequest; + /** MetricThreshold duration. */ + public duration?: (google.protobuf.IDuration|null); - /** - * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAlertPolicyRequest - * @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.monitoring.v3.DeleteAlertPolicyRequest; + /** MetricThreshold trigger. */ + public trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); - /** - * Verifies a DeleteAlertPolicyRequest 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 new MetricThreshold instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricThreshold instance + */ + public static create(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold): google.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - /** - * Creates a DeleteAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAlertPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteAlertPolicyRequest; + /** + * Encodes the specified MetricThreshold message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. + * @param message MetricThreshold message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a DeleteAlertPolicyRequest message. Also converts values to other types if specified. - * @param message DeleteAlertPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.DeleteAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified MetricThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. + * @param message MetricThreshold message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this DeleteAlertPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a MetricThreshold message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricThreshold + * @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.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - /** Properties of an AlertPolicy. */ - interface IAlertPolicy { + /** + * Decodes a MetricThreshold message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricThreshold + * @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.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - /** AlertPolicy name */ - name?: (string|null); + /** + * Verifies a MetricThreshold 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); - /** AlertPolicy displayName */ - displayName?: (string|null); + /** + * Creates a MetricThreshold message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricThreshold + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - /** AlertPolicy documentation */ - documentation?: (google.monitoring.v3.AlertPolicy.IDocumentation|null); + /** + * Creates a plain object from a MetricThreshold message. Also converts values to other types if specified. + * @param message MetricThreshold + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AlertPolicy userLabels */ - userLabels?: ({ [k: string]: string }|null); + /** + * Converts this MetricThreshold to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** AlertPolicy conditions */ - conditions?: (google.monitoring.v3.AlertPolicy.ICondition[]|null); + /** Properties of a MetricAbsence. */ + interface IMetricAbsence { - /** AlertPolicy combiner */ - combiner?: (google.monitoring.v3.AlertPolicy.ConditionCombinerType|keyof typeof google.monitoring.v3.AlertPolicy.ConditionCombinerType|null); + /** MetricAbsence filter */ + filter?: (string|null); - /** AlertPolicy enabled */ - enabled?: (google.protobuf.IBoolValue|null); + /** MetricAbsence aggregations */ + aggregations?: (google.monitoring.v3.IAggregation[]|null); - /** AlertPolicy validity */ - validity?: (google.rpc.IStatus|null); + /** MetricAbsence duration */ + duration?: (google.protobuf.IDuration|null); - /** AlertPolicy notificationChannels */ - notificationChannels?: (string[]|null); + /** MetricAbsence trigger */ + trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); + } - /** AlertPolicy creationRecord */ - creationRecord?: (google.monitoring.v3.IMutationRecord|null); + /** Represents a MetricAbsence. */ + class MetricAbsence implements IMetricAbsence { - /** AlertPolicy mutationRecord */ - mutationRecord?: (google.monitoring.v3.IMutationRecord|null); + /** + * Constructs a new MetricAbsence. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence); + + /** MetricAbsence filter. */ + public filter: string; + + /** MetricAbsence aggregations. */ + public aggregations: google.monitoring.v3.IAggregation[]; + + /** MetricAbsence duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** MetricAbsence trigger. */ + public trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); + + /** + * Creates a new MetricAbsence instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricAbsence instance + */ + public static create(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence): google.monitoring.v3.AlertPolicy.Condition.MetricAbsence; + + /** + * Encodes the specified MetricAbsence message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. + * @param message MetricAbsence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricAbsence message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. + * @param message MetricAbsence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricAbsence message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricAbsence + * @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.monitoring.v3.AlertPolicy.Condition.MetricAbsence; + + /** + * Decodes a MetricAbsence message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricAbsence + * @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.monitoring.v3.AlertPolicy.Condition.MetricAbsence; + + /** + * Verifies a MetricAbsence 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 MetricAbsence message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricAbsence + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition.MetricAbsence; + + /** + * Creates a plain object from a MetricAbsence message. Also converts values to other types if specified. + * @param message MetricAbsence + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricAbsence to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** ConditionCombinerType enum. */ + enum ConditionCombinerType { + COMBINE_UNSPECIFIED = 0, + AND = 1, + OR = 2, + AND_WITH_MATCHING_RESOURCE = 3 + } } - /** Represents an AlertPolicy. */ - class AlertPolicy implements IAlertPolicy { + /** Properties of a TypedValue. */ + interface ITypedValue { - /** - * Constructs a new AlertPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IAlertPolicy); + /** TypedValue boolValue */ + boolValue?: (boolean|null); - /** AlertPolicy name. */ - public name: string; + /** TypedValue int64Value */ + int64Value?: (number|Long|string|null); - /** AlertPolicy displayName. */ - public displayName: string; + /** TypedValue doubleValue */ + doubleValue?: (number|null); - /** AlertPolicy documentation. */ - public documentation?: (google.monitoring.v3.AlertPolicy.IDocumentation|null); + /** TypedValue stringValue */ + stringValue?: (string|null); - /** AlertPolicy userLabels. */ - public userLabels: { [k: string]: string }; + /** TypedValue distributionValue */ + distributionValue?: (google.api.IDistribution|null); + } - /** AlertPolicy conditions. */ - public conditions: google.monitoring.v3.AlertPolicy.ICondition[]; + /** Represents a TypedValue. */ + class TypedValue implements ITypedValue { - /** AlertPolicy combiner. */ - public combiner: (google.monitoring.v3.AlertPolicy.ConditionCombinerType|keyof typeof google.monitoring.v3.AlertPolicy.ConditionCombinerType); + /** + * Constructs a new TypedValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ITypedValue); - /** AlertPolicy enabled. */ - public enabled?: (google.protobuf.IBoolValue|null); + /** TypedValue boolValue. */ + public boolValue: boolean; - /** AlertPolicy validity. */ - public validity?: (google.rpc.IStatus|null); + /** TypedValue int64Value. */ + public int64Value: (number|Long|string); - /** AlertPolicy notificationChannels. */ - public notificationChannels: string[]; + /** TypedValue doubleValue. */ + public doubleValue: number; - /** AlertPolicy creationRecord. */ - public creationRecord?: (google.monitoring.v3.IMutationRecord|null); + /** TypedValue stringValue. */ + public stringValue: string; - /** AlertPolicy mutationRecord. */ - public mutationRecord?: (google.monitoring.v3.IMutationRecord|null); + /** TypedValue distributionValue. */ + public distributionValue?: (google.api.IDistribution|null); + + /** TypedValue value. */ + public value?: ("boolValue"|"int64Value"|"doubleValue"|"stringValue"|"distributionValue"); /** - * Creates a new AlertPolicy instance using the specified properties. + * Creates a new TypedValue instance using the specified properties. * @param [properties] Properties to set - * @returns AlertPolicy instance + * @returns TypedValue instance */ - public static create(properties?: google.monitoring.v3.IAlertPolicy): google.monitoring.v3.AlertPolicy; + public static create(properties?: google.monitoring.v3.ITypedValue): google.monitoring.v3.TypedValue; /** - * Encodes the specified AlertPolicy message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. - * @param message AlertPolicy message or plain object to encode + * Encodes the specified TypedValue message. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. + * @param message TypedValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IAlertPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ITypedValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AlertPolicy message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. - * @param message AlertPolicy message or plain object to encode + * Encodes the specified TypedValue message, length delimited. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. + * @param message TypedValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IAlertPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ITypedValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AlertPolicy message from the specified reader or buffer. + * Decodes a TypedValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AlertPolicy + * @returns TypedValue * @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.monitoring.v3.AlertPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.TypedValue; /** - * Decodes an AlertPolicy message from the specified reader or buffer, length delimited. + * Decodes a TypedValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AlertPolicy + * @returns TypedValue * @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.monitoring.v3.AlertPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.TypedValue; /** - * Verifies an AlertPolicy message. + * Verifies a TypedValue 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 AlertPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a TypedValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AlertPolicy + * @returns TypedValue */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TypedValue; /** - * Creates a plain object from an AlertPolicy message. Also converts values to other types if specified. - * @param message AlertPolicy + * Creates a plain object from a TypedValue message. Also converts values to other types if specified. + * @param message TypedValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.AlertPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.TypedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AlertPolicy to JSON. + * Converts this TypedValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AlertPolicy { - - /** Properties of a Documentation. */ - interface IDocumentation { + /** Properties of a TimeInterval. */ + interface ITimeInterval { - /** Documentation content */ - content?: (string|null); + /** TimeInterval endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** Documentation mimeType */ - mimeType?: (string|null); - } + /** TimeInterval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } - /** Represents a Documentation. */ - class Documentation implements IDocumentation { + /** Represents a TimeInterval. */ + class TimeInterval implements ITimeInterval { - /** - * Constructs a new Documentation. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.AlertPolicy.IDocumentation); + /** + * Constructs a new TimeInterval. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ITimeInterval); - /** Documentation content. */ - public content: string; + /** TimeInterval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** Documentation mimeType. */ - public mimeType: string; + /** TimeInterval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new Documentation instance using the specified properties. - * @param [properties] Properties to set - * @returns Documentation instance - */ - public static create(properties?: google.monitoring.v3.AlertPolicy.IDocumentation): google.monitoring.v3.AlertPolicy.Documentation; + /** + * Creates a new TimeInterval instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeInterval instance + */ + public static create(properties?: google.monitoring.v3.ITimeInterval): google.monitoring.v3.TimeInterval; - /** - * Encodes the specified Documentation message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. - * @param message Documentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.AlertPolicy.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. - * @param message Documentation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.IDocumentation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified TimeInterval message. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. + * @param message TimeInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.ITimeInterval, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Documentation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Documentation - * @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.monitoring.v3.AlertPolicy.Documentation; + /** + * Encodes the specified TimeInterval message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. + * @param message TimeInterval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.ITimeInterval, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Documentation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Documentation - * @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.monitoring.v3.AlertPolicy.Documentation; + /** + * Decodes a TimeInterval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeInterval + * @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.monitoring.v3.TimeInterval; - /** - * Verifies a Documentation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a TimeInterval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeInterval + * @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.monitoring.v3.TimeInterval; - /** - * Creates a Documentation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Documentation - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Documentation; + /** + * Verifies a TimeInterval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a Documentation message. Also converts values to other types if specified. - * @param message Documentation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.AlertPolicy.Documentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a TimeInterval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeInterval + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeInterval; - /** - * Converts this Documentation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a TimeInterval message. Also converts values to other types if specified. + * @param message TimeInterval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.TimeInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a Condition. */ - interface ICondition { + /** + * Converts this TimeInterval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Condition name */ - name?: (string|null); + /** Properties of an Aggregation. */ + interface IAggregation { - /** Condition displayName */ - displayName?: (string|null); + /** Aggregation alignmentPeriod */ + alignmentPeriod?: (google.protobuf.IDuration|null); - /** Condition conditionThreshold */ - conditionThreshold?: (google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null); + /** Aggregation perSeriesAligner */ + perSeriesAligner?: (google.monitoring.v3.Aggregation.Aligner|keyof typeof google.monitoring.v3.Aggregation.Aligner|null); - /** Condition conditionAbsent */ - conditionAbsent?: (google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null); - } + /** Aggregation crossSeriesReducer */ + crossSeriesReducer?: (google.monitoring.v3.Aggregation.Reducer|keyof typeof google.monitoring.v3.Aggregation.Reducer|null); - /** Represents a Condition. */ - class Condition implements ICondition { + /** Aggregation groupByFields */ + groupByFields?: (string[]|null); + } - /** - * Constructs a new Condition. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.AlertPolicy.ICondition); + /** Represents an Aggregation. */ + class Aggregation implements IAggregation { - /** Condition name. */ - public name: string; + /** + * Constructs a new Aggregation. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IAggregation); - /** Condition displayName. */ - public displayName: string; + /** Aggregation alignmentPeriod. */ + public alignmentPeriod?: (google.protobuf.IDuration|null); - /** Condition conditionThreshold. */ - public conditionThreshold?: (google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null); + /** Aggregation perSeriesAligner. */ + public perSeriesAligner: (google.monitoring.v3.Aggregation.Aligner|keyof typeof google.monitoring.v3.Aggregation.Aligner); - /** Condition conditionAbsent. */ - public conditionAbsent?: (google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null); + /** Aggregation crossSeriesReducer. */ + public crossSeriesReducer: (google.monitoring.v3.Aggregation.Reducer|keyof typeof google.monitoring.v3.Aggregation.Reducer); - /** Condition condition. */ - public condition?: ("conditionThreshold"|"conditionAbsent"); + /** Aggregation groupByFields. */ + public groupByFields: string[]; - /** - * Creates a new Condition instance using the specified properties. - * @param [properties] Properties to set - * @returns Condition instance - */ - public static create(properties?: google.monitoring.v3.AlertPolicy.ICondition): google.monitoring.v3.AlertPolicy.Condition; + /** + * Creates a new Aggregation instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregation instance + */ + public static create(properties?: google.monitoring.v3.IAggregation): google.monitoring.v3.Aggregation; - /** - * Encodes the specified Condition message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.AlertPolicy.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. - * @param message Condition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Condition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Condition - * @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.monitoring.v3.AlertPolicy.Condition; + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregation + * @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.monitoring.v3.Aggregation; - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Condition - * @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.monitoring.v3.AlertPolicy.Condition; + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregation + * @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.monitoring.v3.Aggregation; - /** - * Verifies a Condition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an Aggregation 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 Condition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Condition - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition; - - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @param message Condition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.AlertPolicy.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Condition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Condition { - - /** Properties of a Trigger. */ - interface ITrigger { - - /** Trigger count */ - count?: (number|null); - - /** Trigger percent */ - percent?: (number|null); - } - - /** Represents a Trigger. */ - class Trigger implements ITrigger { - - /** - * Constructs a new Trigger. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.ITrigger); - - /** Trigger count. */ - public count: number; - - /** Trigger percent. */ - public percent: number; - - /** Trigger type. */ - public type?: ("count"|"percent"); - - /** - * Creates a new Trigger instance using the specified properties. - * @param [properties] Properties to set - * @returns Trigger instance - */ - public static create(properties?: google.monitoring.v3.AlertPolicy.Condition.ITrigger): google.monitoring.v3.AlertPolicy.Condition.Trigger; - - /** - * Encodes the specified Trigger message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. - * @param message Trigger message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.AlertPolicy.Condition.ITrigger, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Trigger message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. - * @param message Trigger message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.Condition.ITrigger, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Trigger message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Trigger - * @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.monitoring.v3.AlertPolicy.Condition.Trigger; - - /** - * Decodes a Trigger message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Trigger - * @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.monitoring.v3.AlertPolicy.Condition.Trigger; - - /** - * Verifies a Trigger 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 Trigger message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Trigger - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition.Trigger; - - /** - * Creates a plain object from a Trigger message. Also converts values to other types if specified. - * @param message Trigger - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.AlertPolicy.Condition.Trigger, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Trigger to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MetricThreshold. */ - interface IMetricThreshold { - - /** MetricThreshold filter */ - filter?: (string|null); - - /** MetricThreshold aggregations */ - aggregations?: (google.monitoring.v3.IAggregation[]|null); - - /** MetricThreshold denominatorFilter */ - denominatorFilter?: (string|null); - - /** MetricThreshold denominatorAggregations */ - denominatorAggregations?: (google.monitoring.v3.IAggregation[]|null); - - /** MetricThreshold comparison */ - comparison?: (google.monitoring.v3.ComparisonType|keyof typeof google.monitoring.v3.ComparisonType|null); - - /** MetricThreshold thresholdValue */ - thresholdValue?: (number|null); - - /** MetricThreshold duration */ - duration?: (google.protobuf.IDuration|null); - - /** MetricThreshold trigger */ - trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); - } - - /** Represents a MetricThreshold. */ - class MetricThreshold implements IMetricThreshold { - - /** - * Constructs a new MetricThreshold. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold); - - /** MetricThreshold filter. */ - public filter: string; - - /** MetricThreshold aggregations. */ - public aggregations: google.monitoring.v3.IAggregation[]; - - /** MetricThreshold denominatorFilter. */ - public denominatorFilter: string; - - /** MetricThreshold denominatorAggregations. */ - public denominatorAggregations: google.monitoring.v3.IAggregation[]; - - /** MetricThreshold comparison. */ - public comparison: (google.monitoring.v3.ComparisonType|keyof typeof google.monitoring.v3.ComparisonType); - - /** MetricThreshold thresholdValue. */ - public thresholdValue: number; - - /** MetricThreshold duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** MetricThreshold trigger. */ - public trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); - - /** - * Creates a new MetricThreshold instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricThreshold instance - */ - public static create(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold): google.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - - /** - * Encodes the specified MetricThreshold message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. - * @param message MetricThreshold message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetricThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. - * @param message MetricThreshold message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetricThreshold message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricThreshold - * @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.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - - /** - * Decodes a MetricThreshold message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricThreshold - * @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.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - - /** - * Verifies a MetricThreshold 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 MetricThreshold message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricThreshold - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition.MetricThreshold; - - /** - * Creates a plain object from a MetricThreshold message. Also converts values to other types if specified. - * @param message MetricThreshold - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.AlertPolicy.Condition.MetricThreshold, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MetricThreshold to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MetricAbsence. */ - interface IMetricAbsence { - - /** MetricAbsence filter */ - filter?: (string|null); - - /** MetricAbsence aggregations */ - aggregations?: (google.monitoring.v3.IAggregation[]|null); - - /** MetricAbsence duration */ - duration?: (google.protobuf.IDuration|null); - - /** MetricAbsence trigger */ - trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); - } - - /** Represents a MetricAbsence. */ - class MetricAbsence implements IMetricAbsence { - - /** - * Constructs a new MetricAbsence. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence); - - /** MetricAbsence filter. */ - public filter: string; - - /** MetricAbsence aggregations. */ - public aggregations: google.monitoring.v3.IAggregation[]; - - /** MetricAbsence duration. */ - public duration?: (google.protobuf.IDuration|null); - - /** MetricAbsence trigger. */ - public trigger?: (google.monitoring.v3.AlertPolicy.Condition.ITrigger|null); - - /** - * Creates a new MetricAbsence instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricAbsence instance - */ - public static create(properties?: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence): google.monitoring.v3.AlertPolicy.Condition.MetricAbsence; - - /** - * Encodes the specified MetricAbsence message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. - * @param message MetricAbsence message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetricAbsence message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. - * @param message MetricAbsence message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetricAbsence message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricAbsence - * @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.monitoring.v3.AlertPolicy.Condition.MetricAbsence; - - /** - * Decodes a MetricAbsence message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricAbsence - * @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.monitoring.v3.AlertPolicy.Condition.MetricAbsence; - - /** - * Verifies a MetricAbsence 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 MetricAbsence message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricAbsence - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.AlertPolicy.Condition.MetricAbsence; + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregation + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Aggregation; - /** - * Creates a plain object from a MetricAbsence message. Also converts values to other types if specified. - * @param message MetricAbsence - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.AlertPolicy.Condition.MetricAbsence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @param message Aggregation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this MetricAbsence to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Aggregation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Aggregation { + + /** Aligner enum. */ + enum Aligner { + ALIGN_NONE = 0, + ALIGN_DELTA = 1, + ALIGN_RATE = 2, + ALIGN_INTERPOLATE = 3, + ALIGN_NEXT_OLDER = 4, + ALIGN_MIN = 10, + ALIGN_MAX = 11, + ALIGN_MEAN = 12, + ALIGN_COUNT = 13, + ALIGN_SUM = 14, + ALIGN_STDDEV = 15, + ALIGN_COUNT_TRUE = 16, + ALIGN_COUNT_FALSE = 24, + ALIGN_FRACTION_TRUE = 17, + ALIGN_PERCENTILE_99 = 18, + ALIGN_PERCENTILE_95 = 19, + ALIGN_PERCENTILE_50 = 20, + ALIGN_PERCENTILE_05 = 21, + ALIGN_PERCENT_CHANGE = 23 } - /** ConditionCombinerType enum. */ - enum ConditionCombinerType { - COMBINE_UNSPECIFIED = 0, - AND = 1, - OR = 2, - AND_WITH_MATCHING_RESOURCE = 3 + /** Reducer enum. */ + enum Reducer { + REDUCE_NONE = 0, + REDUCE_MEAN = 1, + REDUCE_MIN = 2, + REDUCE_MAX = 3, + REDUCE_SUM = 4, + REDUCE_STDDEV = 5, + REDUCE_COUNT = 6, + REDUCE_COUNT_TRUE = 7, + REDUCE_COUNT_FALSE = 15, + REDUCE_FRACTION_TRUE = 8, + REDUCE_PERCENTILE_99 = 9, + REDUCE_PERCENTILE_95 = 10, + REDUCE_PERCENTILE_50 = 11, + REDUCE_PERCENTILE_05 = 12 } } - /** Properties of a TypedValue. */ - interface ITypedValue { - - /** TypedValue boolValue */ - boolValue?: (boolean|null); + /** ComparisonType enum. */ + enum ComparisonType { + COMPARISON_UNSPECIFIED = 0, + COMPARISON_GT = 1, + COMPARISON_GE = 2, + COMPARISON_LT = 3, + COMPARISON_LE = 4, + COMPARISON_EQ = 5, + COMPARISON_NE = 6 + } - /** TypedValue int64Value */ - int64Value?: (number|Long|string|null); + /** ServiceTier enum. */ + enum ServiceTier { + SERVICE_TIER_UNSPECIFIED = 0, + SERVICE_TIER_BASIC = 1, + SERVICE_TIER_PREMIUM = 2 + } - /** TypedValue doubleValue */ - doubleValue?: (number|null); + /** Properties of a MutationRecord. */ + interface IMutationRecord { - /** TypedValue stringValue */ - stringValue?: (string|null); + /** MutationRecord mutateTime */ + mutateTime?: (google.protobuf.ITimestamp|null); - /** TypedValue distributionValue */ - distributionValue?: (google.api.IDistribution|null); + /** MutationRecord mutatedBy */ + mutatedBy?: (string|null); } - /** Represents a TypedValue. */ - class TypedValue implements ITypedValue { + /** Represents a MutationRecord. */ + class MutationRecord implements IMutationRecord { /** - * Constructs a new TypedValue. + * Constructs a new MutationRecord. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ITypedValue); - - /** TypedValue boolValue. */ - public boolValue: boolean; - - /** TypedValue int64Value. */ - public int64Value: (number|Long|string); - - /** TypedValue doubleValue. */ - public doubleValue: number; - - /** TypedValue stringValue. */ - public stringValue: string; + constructor(properties?: google.monitoring.v3.IMutationRecord); - /** TypedValue distributionValue. */ - public distributionValue?: (google.api.IDistribution|null); + /** MutationRecord mutateTime. */ + public mutateTime?: (google.protobuf.ITimestamp|null); - /** TypedValue value. */ - public value?: ("boolValue"|"int64Value"|"doubleValue"|"stringValue"|"distributionValue"); + /** MutationRecord mutatedBy. */ + public mutatedBy: string; /** - * Creates a new TypedValue instance using the specified properties. + * Creates a new MutationRecord instance using the specified properties. * @param [properties] Properties to set - * @returns TypedValue instance + * @returns MutationRecord instance */ - public static create(properties?: google.monitoring.v3.ITypedValue): google.monitoring.v3.TypedValue; + public static create(properties?: google.monitoring.v3.IMutationRecord): google.monitoring.v3.MutationRecord; /** - * Encodes the specified TypedValue message. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. - * @param message TypedValue message or plain object to encode + * Encodes the specified MutationRecord message. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. + * @param message MutationRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ITypedValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IMutationRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TypedValue message, length delimited. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. - * @param message TypedValue message or plain object to encode + * Encodes the specified MutationRecord message, length delimited. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. + * @param message MutationRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ITypedValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IMutationRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TypedValue message from the specified reader or buffer. + * Decodes a MutationRecord message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TypedValue + * @returns MutationRecord + * @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.monitoring.v3.MutationRecord; + + /** + * Decodes a MutationRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationRecord * @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.monitoring.v3.TypedValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.MutationRecord; + + /** + * Verifies a MutationRecord 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 MutationRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationRecord + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.MutationRecord; + + /** + * Creates a plain object from a MutationRecord message. Also converts values to other types if specified. + * @param message MutationRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.MutationRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MutationRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents an AlertPolicyService */ + class AlertPolicyService extends $protobuf.rpc.Service { + + /** + * Constructs a new AlertPolicyService 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 AlertPolicyService 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): AlertPolicyService; + + /** + * Calls ListAlertPolicies. + * @param request ListAlertPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAlertPoliciesResponse + */ + public listAlertPolicies(request: google.monitoring.v3.IListAlertPoliciesRequest, callback: google.monitoring.v3.AlertPolicyService.ListAlertPoliciesCallback): void; + + /** + * Calls ListAlertPolicies. + * @param request ListAlertPoliciesRequest message or plain object + * @returns Promise + */ + public listAlertPolicies(request: google.monitoring.v3.IListAlertPoliciesRequest): Promise; + + /** + * Calls GetAlertPolicy. + * @param request GetAlertPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AlertPolicy + */ + public getAlertPolicy(request: google.monitoring.v3.IGetAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.GetAlertPolicyCallback): void; + + /** + * Calls GetAlertPolicy. + * @param request GetAlertPolicyRequest message or plain object + * @returns Promise + */ + public getAlertPolicy(request: google.monitoring.v3.IGetAlertPolicyRequest): Promise; + + /** + * Calls CreateAlertPolicy. + * @param request CreateAlertPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AlertPolicy + */ + public createAlertPolicy(request: google.monitoring.v3.ICreateAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.CreateAlertPolicyCallback): void; + + /** + * Calls CreateAlertPolicy. + * @param request CreateAlertPolicyRequest message or plain object + * @returns Promise + */ + public createAlertPolicy(request: google.monitoring.v3.ICreateAlertPolicyRequest): Promise; + + /** + * Calls DeleteAlertPolicy. + * @param request DeleteAlertPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAlertPolicy(request: google.monitoring.v3.IDeleteAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.DeleteAlertPolicyCallback): void; + + /** + * Calls DeleteAlertPolicy. + * @param request DeleteAlertPolicyRequest message or plain object + * @returns Promise + */ + public deleteAlertPolicy(request: google.monitoring.v3.IDeleteAlertPolicyRequest): Promise; + + /** + * Calls UpdateAlertPolicy. + * @param request UpdateAlertPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AlertPolicy + */ + public updateAlertPolicy(request: google.monitoring.v3.IUpdateAlertPolicyRequest, callback: google.monitoring.v3.AlertPolicyService.UpdateAlertPolicyCallback): void; + + /** + * Calls UpdateAlertPolicy. + * @param request UpdateAlertPolicyRequest message or plain object + * @returns Promise + */ + public updateAlertPolicy(request: google.monitoring.v3.IUpdateAlertPolicyRequest): Promise; + } + + namespace AlertPolicyService { /** - * Decodes a TypedValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TypedValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#listAlertPolicies}. + * @param error Error, if any + * @param [response] ListAlertPoliciesResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.TypedValue; + type ListAlertPoliciesCallback = (error: (Error|null), response?: google.monitoring.v3.ListAlertPoliciesResponse) => void; /** - * Verifies a TypedValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#getAlertPolicy}. + * @param error Error, if any + * @param [response] AlertPolicy */ - public static verify(message: { [k: string]: any }): (string|null); + type GetAlertPolicyCallback = (error: (Error|null), response?: google.monitoring.v3.AlertPolicy) => void; /** - * Creates a TypedValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TypedValue + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#createAlertPolicy}. + * @param error Error, if any + * @param [response] AlertPolicy */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TypedValue; + type CreateAlertPolicyCallback = (error: (Error|null), response?: google.monitoring.v3.AlertPolicy) => void; /** - * Creates a plain object from a TypedValue message. Also converts values to other types if specified. - * @param message TypedValue - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#deleteAlertPolicy}. + * @param error Error, if any + * @param [response] Empty */ - public static toObject(message: google.monitoring.v3.TypedValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type DeleteAlertPolicyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Converts this TypedValue to JSON. - * @returns JSON object + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#updateAlertPolicy}. + * @param error Error, if any + * @param [response] AlertPolicy */ - public toJSON(): { [k: string]: any }; + type UpdateAlertPolicyCallback = (error: (Error|null), response?: google.monitoring.v3.AlertPolicy) => void; } - /** Properties of a TimeInterval. */ - interface ITimeInterval { + /** Properties of a CreateAlertPolicyRequest. */ + interface ICreateAlertPolicyRequest { - /** TimeInterval endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** CreateAlertPolicyRequest name */ + name?: (string|null); - /** TimeInterval startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** CreateAlertPolicyRequest alertPolicy */ + alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); } - /** Represents a TimeInterval. */ - class TimeInterval implements ITimeInterval { + /** Represents a CreateAlertPolicyRequest. */ + class CreateAlertPolicyRequest implements ICreateAlertPolicyRequest { /** - * Constructs a new TimeInterval. + * Constructs a new CreateAlertPolicyRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ITimeInterval); + constructor(properties?: google.monitoring.v3.ICreateAlertPolicyRequest); - /** TimeInterval endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** CreateAlertPolicyRequest name. */ + public name: string; - /** TimeInterval startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** CreateAlertPolicyRequest alertPolicy. */ + public alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); /** - * Creates a new TimeInterval instance using the specified properties. + * Creates a new CreateAlertPolicyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeInterval instance + * @returns CreateAlertPolicyRequest instance */ - public static create(properties?: google.monitoring.v3.ITimeInterval): google.monitoring.v3.TimeInterval; + public static create(properties?: google.monitoring.v3.ICreateAlertPolicyRequest): google.monitoring.v3.CreateAlertPolicyRequest; /** - * Encodes the specified TimeInterval message. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. - * @param message TimeInterval message or plain object to encode + * Encodes the specified CreateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. + * @param message CreateAlertPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ITimeInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ICreateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeInterval message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. - * @param message TimeInterval message or plain object to encode + * Encodes the specified CreateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. + * @param message CreateAlertPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ITimeInterval, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ICreateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeInterval message from the specified reader or buffer. + * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeInterval + * @returns CreateAlertPolicyRequest * @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.monitoring.v3.TimeInterval; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateAlertPolicyRequest; /** - * Decodes a TimeInterval message from the specified reader or buffer, length delimited. + * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeInterval + * @returns CreateAlertPolicyRequest * @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.monitoring.v3.TimeInterval; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateAlertPolicyRequest; /** - * Verifies a TimeInterval message. + * Verifies a CreateAlertPolicyRequest 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 TimeInterval message from a plain object. Also converts values to their respective internal types. + * Creates a CreateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeInterval + * @returns CreateAlertPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeInterval; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateAlertPolicyRequest; /** - * Creates a plain object from a TimeInterval message. Also converts values to other types if specified. - * @param message TimeInterval + * Creates a plain object from a CreateAlertPolicyRequest message. Also converts values to other types if specified. + * @param message CreateAlertPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.TimeInterval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.CreateAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeInterval to JSON. + * Converts this CreateAlertPolicyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Aggregation. */ - interface IAggregation { - - /** Aggregation alignmentPeriod */ - alignmentPeriod?: (google.protobuf.IDuration|null); - - /** Aggregation perSeriesAligner */ - perSeriesAligner?: (google.monitoring.v3.Aggregation.Aligner|keyof typeof google.monitoring.v3.Aggregation.Aligner|null); - - /** Aggregation crossSeriesReducer */ - crossSeriesReducer?: (google.monitoring.v3.Aggregation.Reducer|keyof typeof google.monitoring.v3.Aggregation.Reducer|null); + /** Properties of a GetAlertPolicyRequest. */ + interface IGetAlertPolicyRequest { - /** Aggregation groupByFields */ - groupByFields?: (string[]|null); + /** GetAlertPolicyRequest name */ + name?: (string|null); } - /** Represents an Aggregation. */ - class Aggregation implements IAggregation { + /** Represents a GetAlertPolicyRequest. */ + class GetAlertPolicyRequest implements IGetAlertPolicyRequest { /** - * Constructs a new Aggregation. + * Constructs a new GetAlertPolicyRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IAggregation); - - /** Aggregation alignmentPeriod. */ - public alignmentPeriod?: (google.protobuf.IDuration|null); - - /** Aggregation perSeriesAligner. */ - public perSeriesAligner: (google.monitoring.v3.Aggregation.Aligner|keyof typeof google.monitoring.v3.Aggregation.Aligner); - - /** Aggregation crossSeriesReducer. */ - public crossSeriesReducer: (google.monitoring.v3.Aggregation.Reducer|keyof typeof google.monitoring.v3.Aggregation.Reducer); + constructor(properties?: google.monitoring.v3.IGetAlertPolicyRequest); - /** Aggregation groupByFields. */ - public groupByFields: string[]; + /** GetAlertPolicyRequest name. */ + public name: string; /** - * Creates a new Aggregation instance using the specified properties. + * Creates a new GetAlertPolicyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Aggregation instance + * @returns GetAlertPolicyRequest instance */ - public static create(properties?: google.monitoring.v3.IAggregation): google.monitoring.v3.Aggregation; + public static create(properties?: google.monitoring.v3.IGetAlertPolicyRequest): google.monitoring.v3.GetAlertPolicyRequest; /** - * Encodes the specified Aggregation message. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. - * @param message Aggregation message or plain object to encode + * Encodes the specified GetAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. + * @param message GetAlertPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. - * @param message Aggregation message or plain object to encode + * Encodes the specified GetAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. + * @param message GetAlertPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Aggregation message from the specified reader or buffer. + * Decodes a GetAlertPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Aggregation + * @returns GetAlertPolicyRequest * @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.monitoring.v3.Aggregation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetAlertPolicyRequest; /** - * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * Decodes a GetAlertPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Aggregation + * @returns GetAlertPolicyRequest * @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.monitoring.v3.Aggregation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetAlertPolicyRequest; /** - * Verifies an Aggregation message. + * Verifies a GetAlertPolicyRequest 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 Aggregation message from a plain object. Also converts values to their respective internal types. + * Creates a GetAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Aggregation + * @returns GetAlertPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Aggregation; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetAlertPolicyRequest; /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. - * @param message Aggregation + * Creates a plain object from a GetAlertPolicyRequest message. Also converts values to other types if specified. + * @param message GetAlertPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Aggregation to JSON. + * Converts this GetAlertPolicyRequest to JSON. * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Aggregation { - - /** Aligner enum. */ - enum Aligner { - ALIGN_NONE = 0, - ALIGN_DELTA = 1, - ALIGN_RATE = 2, - ALIGN_INTERPOLATE = 3, - ALIGN_NEXT_OLDER = 4, - ALIGN_MIN = 10, - ALIGN_MAX = 11, - ALIGN_MEAN = 12, - ALIGN_COUNT = 13, - ALIGN_SUM = 14, - ALIGN_STDDEV = 15, - ALIGN_COUNT_TRUE = 16, - ALIGN_COUNT_FALSE = 24, - ALIGN_FRACTION_TRUE = 17, - ALIGN_PERCENTILE_99 = 18, - ALIGN_PERCENTILE_95 = 19, - ALIGN_PERCENTILE_50 = 20, - ALIGN_PERCENTILE_05 = 21, - ALIGN_PERCENT_CHANGE = 23 - } - - /** Reducer enum. */ - enum Reducer { - REDUCE_NONE = 0, - REDUCE_MEAN = 1, - REDUCE_MIN = 2, - REDUCE_MAX = 3, - REDUCE_SUM = 4, - REDUCE_STDDEV = 5, - REDUCE_COUNT = 6, - REDUCE_COUNT_TRUE = 7, - REDUCE_COUNT_FALSE = 15, - REDUCE_FRACTION_TRUE = 8, - REDUCE_PERCENTILE_99 = 9, - REDUCE_PERCENTILE_95 = 10, - REDUCE_PERCENTILE_50 = 11, - REDUCE_PERCENTILE_05 = 12 - } + */ + public toJSON(): { [k: string]: any }; } - /** ComparisonType enum. */ - enum ComparisonType { - COMPARISON_UNSPECIFIED = 0, - COMPARISON_GT = 1, - COMPARISON_GE = 2, - COMPARISON_LT = 3, - COMPARISON_LE = 4, - COMPARISON_EQ = 5, - COMPARISON_NE = 6 - } + /** Properties of a ListAlertPoliciesRequest. */ + interface IListAlertPoliciesRequest { - /** ServiceTier enum. */ - enum ServiceTier { - SERVICE_TIER_UNSPECIFIED = 0, - SERVICE_TIER_BASIC = 1, - SERVICE_TIER_PREMIUM = 2 - } + /** ListAlertPoliciesRequest name */ + name?: (string|null); - /** Properties of a MutationRecord. */ - interface IMutationRecord { + /** ListAlertPoliciesRequest filter */ + filter?: (string|null); - /** MutationRecord mutateTime */ - mutateTime?: (google.protobuf.ITimestamp|null); + /** ListAlertPoliciesRequest orderBy */ + orderBy?: (string|null); - /** MutationRecord mutatedBy */ - mutatedBy?: (string|null); + /** ListAlertPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListAlertPoliciesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a MutationRecord. */ - class MutationRecord implements IMutationRecord { + /** Represents a ListAlertPoliciesRequest. */ + class ListAlertPoliciesRequest implements IListAlertPoliciesRequest { /** - * Constructs a new MutationRecord. + * Constructs a new ListAlertPoliciesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IMutationRecord); + constructor(properties?: google.monitoring.v3.IListAlertPoliciesRequest); - /** MutationRecord mutateTime. */ - public mutateTime?: (google.protobuf.ITimestamp|null); + /** ListAlertPoliciesRequest name. */ + public name: string; - /** MutationRecord mutatedBy. */ - public mutatedBy: string; + /** ListAlertPoliciesRequest filter. */ + public filter: string; + + /** ListAlertPoliciesRequest orderBy. */ + public orderBy: string; + + /** ListAlertPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListAlertPoliciesRequest pageToken. */ + public pageToken: string; /** - * Creates a new MutationRecord instance using the specified properties. + * Creates a new ListAlertPoliciesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns MutationRecord instance + * @returns ListAlertPoliciesRequest instance */ - public static create(properties?: google.monitoring.v3.IMutationRecord): google.monitoring.v3.MutationRecord; + public static create(properties?: google.monitoring.v3.IListAlertPoliciesRequest): google.monitoring.v3.ListAlertPoliciesRequest; /** - * Encodes the specified MutationRecord message. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. - * @param message MutationRecord message or plain object to encode + * Encodes the specified ListAlertPoliciesRequest message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. + * @param message ListAlertPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IMutationRecord, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListAlertPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MutationRecord message, length delimited. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. - * @param message MutationRecord message or plain object to encode + * Encodes the specified ListAlertPoliciesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. + * @param message ListAlertPoliciesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IMutationRecord, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListAlertPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MutationRecord message from the specified reader or buffer. + * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MutationRecord + * @returns ListAlertPoliciesRequest * @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.monitoring.v3.MutationRecord; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListAlertPoliciesRequest; /** - * Decodes a MutationRecord message from the specified reader or buffer, length delimited. + * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MutationRecord + * @returns ListAlertPoliciesRequest * @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.monitoring.v3.MutationRecord; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListAlertPoliciesRequest; /** - * Verifies a MutationRecord message. + * Verifies a ListAlertPoliciesRequest 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 MutationRecord message from a plain object. Also converts values to their respective internal types. + * Creates a ListAlertPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MutationRecord + * @returns ListAlertPoliciesRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.MutationRecord; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListAlertPoliciesRequest; /** - * Creates a plain object from a MutationRecord message. Also converts values to other types if specified. - * @param message MutationRecord + * Creates a plain object from a ListAlertPoliciesRequest message. Also converts values to other types if specified. + * @param message ListAlertPoliciesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.MutationRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListAlertPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MutationRecord to JSON. + * Converts this ListAlertPoliciesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a GroupService */ - class GroupService extends $protobuf.rpc.Service { + /** Properties of a ListAlertPoliciesResponse. */ + interface IListAlertPoliciesResponse { - /** - * Constructs a new GroupService 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); + /** ListAlertPoliciesResponse alertPolicies */ + alertPolicies?: (google.monitoring.v3.IAlertPolicy[]|null); + + /** ListAlertPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAlertPoliciesResponse. */ + class ListAlertPoliciesResponse implements IListAlertPoliciesResponse { /** - * Creates new GroupService 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. + * Constructs a new ListAlertPoliciesResponse. + * @param [properties] Properties to set */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): GroupService; + constructor(properties?: google.monitoring.v3.IListAlertPoliciesResponse); + + /** ListAlertPoliciesResponse alertPolicies. */ + public alertPolicies: google.monitoring.v3.IAlertPolicy[]; + + /** ListAlertPoliciesResponse nextPageToken. */ + public nextPageToken: string; /** - * Calls ListGroups. - * @param request ListGroupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListGroupsResponse + * Creates a new ListAlertPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAlertPoliciesResponse instance */ - public listGroups(request: google.monitoring.v3.IListGroupsRequest, callback: google.monitoring.v3.GroupService.ListGroupsCallback): void; + public static create(properties?: google.monitoring.v3.IListAlertPoliciesResponse): google.monitoring.v3.ListAlertPoliciesResponse; /** - * Calls ListGroups. - * @param request ListGroupsRequest message or plain object - * @returns Promise + * Encodes the specified ListAlertPoliciesResponse message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. + * @param message ListAlertPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listGroups(request: google.monitoring.v3.IListGroupsRequest): Promise; + public static encode(message: google.monitoring.v3.IListAlertPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetGroup. - * @param request GetGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Group + * Encodes the specified ListAlertPoliciesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. + * @param message ListAlertPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getGroup(request: google.monitoring.v3.IGetGroupRequest, callback: google.monitoring.v3.GroupService.GetGroupCallback): void; + public static encodeDelimited(message: google.monitoring.v3.IListAlertPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetGroup. - * @param request GetGroupRequest message or plain object - * @returns Promise + * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAlertPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getGroup(request: google.monitoring.v3.IGetGroupRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListAlertPoliciesResponse; /** - * Calls CreateGroup. - * @param request CreateGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Group + * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAlertPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createGroup(request: google.monitoring.v3.ICreateGroupRequest, callback: google.monitoring.v3.GroupService.CreateGroupCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListAlertPoliciesResponse; /** - * Calls CreateGroup. - * @param request CreateGroupRequest message or plain object - * @returns Promise + * Verifies a ListAlertPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public createGroup(request: google.monitoring.v3.ICreateGroupRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls UpdateGroup. - * @param request UpdateGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Group + * Creates a ListAlertPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAlertPoliciesResponse */ - public updateGroup(request: google.monitoring.v3.IUpdateGroupRequest, callback: google.monitoring.v3.GroupService.UpdateGroupCallback): void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListAlertPoliciesResponse; /** - * Calls UpdateGroup. - * @param request UpdateGroupRequest message or plain object - * @returns Promise + * Creates a plain object from a ListAlertPoliciesResponse message. Also converts values to other types if specified. + * @param message ListAlertPoliciesResponse + * @param [options] Conversion options + * @returns Plain object */ - public updateGroup(request: google.monitoring.v3.IUpdateGroupRequest): Promise; + public static toObject(message: google.monitoring.v3.ListAlertPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteGroup. - * @param request DeleteGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Converts this ListAlertPoliciesResponse to JSON. + * @returns JSON object */ - public deleteGroup(request: google.monitoring.v3.IDeleteGroupRequest, callback: google.monitoring.v3.GroupService.DeleteGroupCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateAlertPolicyRequest. */ + interface IUpdateAlertPolicyRequest { + + /** UpdateAlertPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAlertPolicyRequest alertPolicy */ + alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); + } + + /** Represents an UpdateAlertPolicyRequest. */ + class UpdateAlertPolicyRequest implements IUpdateAlertPolicyRequest { /** - * Calls DeleteGroup. - * @param request DeleteGroupRequest message or plain object - * @returns Promise + * Constructs a new UpdateAlertPolicyRequest. + * @param [properties] Properties to set */ - public deleteGroup(request: google.monitoring.v3.IDeleteGroupRequest): Promise; + constructor(properties?: google.monitoring.v3.IUpdateAlertPolicyRequest); + + /** UpdateAlertPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAlertPolicyRequest alertPolicy. */ + public alertPolicy?: (google.monitoring.v3.IAlertPolicy|null); /** - * Calls ListGroupMembers. - * @param request ListGroupMembersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListGroupMembersResponse + * Creates a new UpdateAlertPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAlertPolicyRequest instance */ - public listGroupMembers(request: google.monitoring.v3.IListGroupMembersRequest, callback: google.monitoring.v3.GroupService.ListGroupMembersCallback): void; + public static create(properties?: google.monitoring.v3.IUpdateAlertPolicyRequest): google.monitoring.v3.UpdateAlertPolicyRequest; /** - * Calls ListGroupMembers. - * @param request ListGroupMembersRequest message or plain object - * @returns Promise + * Encodes the specified UpdateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. + * @param message UpdateAlertPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listGroupMembers(request: google.monitoring.v3.IListGroupMembersRequest): Promise; - } + public static encode(message: google.monitoring.v3.IUpdateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - namespace GroupService { + /** + * Encodes the specified UpdateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. + * @param message UpdateAlertPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IUpdateAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.GroupService#listGroups}. - * @param error Error, if any - * @param [response] ListGroupsResponse + * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAlertPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListGroupsCallback = (error: (Error|null), response?: google.monitoring.v3.ListGroupsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateAlertPolicyRequest; /** - * Callback as used by {@link google.monitoring.v3.GroupService#getGroup}. - * @param error Error, if any - * @param [response] Group + * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAlertPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetGroupCallback = (error: (Error|null), response?: google.monitoring.v3.Group) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateAlertPolicyRequest; /** - * Callback as used by {@link google.monitoring.v3.GroupService#createGroup}. - * @param error Error, if any - * @param [response] Group + * Verifies an UpdateAlertPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type CreateGroupCallback = (error: (Error|null), response?: google.monitoring.v3.Group) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.monitoring.v3.GroupService#updateGroup}. - * @param error Error, if any - * @param [response] Group + * Creates an UpdateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAlertPolicyRequest */ - type UpdateGroupCallback = (error: (Error|null), response?: google.monitoring.v3.Group) => void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateAlertPolicyRequest; /** - * Callback as used by {@link google.monitoring.v3.GroupService#deleteGroup}. - * @param error Error, if any - * @param [response] Empty + * Creates a plain object from an UpdateAlertPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateAlertPolicyRequest + * @param [options] Conversion options + * @returns Plain object */ - type DeleteGroupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static toObject(message: google.monitoring.v3.UpdateAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.monitoring.v3.GroupService#listGroupMembers}. - * @param error Error, if any - * @param [response] ListGroupMembersResponse + * Converts this UpdateAlertPolicyRequest to JSON. + * @returns JSON object */ - type ListGroupMembersCallback = (error: (Error|null), response?: google.monitoring.v3.ListGroupMembersResponse) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a ListGroupsRequest. */ - interface IListGroupsRequest { + /** Properties of a DeleteAlertPolicyRequest. */ + interface IDeleteAlertPolicyRequest { - /** ListGroupsRequest name */ + /** DeleteAlertPolicyRequest name */ name?: (string|null); - - /** ListGroupsRequest childrenOfGroup */ - childrenOfGroup?: (string|null); - - /** ListGroupsRequest ancestorsOfGroup */ - ancestorsOfGroup?: (string|null); - - /** ListGroupsRequest descendantsOfGroup */ - descendantsOfGroup?: (string|null); - - /** ListGroupsRequest pageSize */ - pageSize?: (number|null); - - /** ListGroupsRequest pageToken */ - pageToken?: (string|null); } - /** Represents a ListGroupsRequest. */ - class ListGroupsRequest implements IListGroupsRequest { + /** Represents a DeleteAlertPolicyRequest. */ + class DeleteAlertPolicyRequest implements IDeleteAlertPolicyRequest { /** - * Constructs a new ListGroupsRequest. + * Constructs a new DeleteAlertPolicyRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListGroupsRequest); + constructor(properties?: google.monitoring.v3.IDeleteAlertPolicyRequest); - /** ListGroupsRequest name. */ + /** DeleteAlertPolicyRequest name. */ public name: string; - /** ListGroupsRequest childrenOfGroup. */ - public childrenOfGroup: string; - - /** ListGroupsRequest ancestorsOfGroup. */ - public ancestorsOfGroup: string; - - /** ListGroupsRequest descendantsOfGroup. */ - public descendantsOfGroup: string; - - /** ListGroupsRequest pageSize. */ - public pageSize: number; - - /** ListGroupsRequest pageToken. */ - public pageToken: string; - - /** ListGroupsRequest filter. */ - public filter?: ("childrenOfGroup"|"ancestorsOfGroup"|"descendantsOfGroup"); - /** - * Creates a new ListGroupsRequest instance using the specified properties. + * Creates a new DeleteAlertPolicyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListGroupsRequest instance + * @returns DeleteAlertPolicyRequest instance */ - public static create(properties?: google.monitoring.v3.IListGroupsRequest): google.monitoring.v3.ListGroupsRequest; + public static create(properties?: google.monitoring.v3.IDeleteAlertPolicyRequest): google.monitoring.v3.DeleteAlertPolicyRequest; /** - * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. - * @param message ListGroupsRequest message or plain object to encode + * Encodes the specified DeleteAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. + * @param message DeleteAlertPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IDeleteAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. - * @param message ListGroupsRequest message or plain object to encode + * Encodes the specified DeleteAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. + * @param message DeleteAlertPolicyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IDeleteAlertPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGroupsRequest message from the specified reader or buffer. + * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGroupsRequest + * @returns DeleteAlertPolicyRequest * @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.monitoring.v3.ListGroupsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteAlertPolicyRequest; /** - * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGroupsRequest + * @returns DeleteAlertPolicyRequest * @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.monitoring.v3.ListGroupsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteAlertPolicyRequest; /** - * Verifies a ListGroupsRequest message. + * Verifies a DeleteAlertPolicyRequest 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 ListGroupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGroupsRequest + * @returns DeleteAlertPolicyRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupsRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteAlertPolicyRequest; /** - * Creates a plain object from a ListGroupsRequest message. Also converts values to other types if specified. - * @param message ListGroupsRequest + * Creates a plain object from a DeleteAlertPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteAlertPolicyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.DeleteAlertPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGroupsRequest to JSON. + * Converts this DeleteAlertPolicyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGroupsResponse. */ - interface IListGroupsResponse { - - /** ListGroupsResponse group */ - group?: (google.monitoring.v3.IGroup[]|null); + /** Properties of a DroppedLabels. */ + interface IDroppedLabels { - /** ListGroupsResponse nextPageToken */ - nextPageToken?: (string|null); + /** DroppedLabels label */ + label?: ({ [k: string]: string }|null); } - /** Represents a ListGroupsResponse. */ - class ListGroupsResponse implements IListGroupsResponse { + /** Represents a DroppedLabels. */ + class DroppedLabels implements IDroppedLabels { /** - * Constructs a new ListGroupsResponse. + * Constructs a new DroppedLabels. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListGroupsResponse); - - /** ListGroupsResponse group. */ - public group: google.monitoring.v3.IGroup[]; + constructor(properties?: google.monitoring.v3.IDroppedLabels); - /** ListGroupsResponse nextPageToken. */ - public nextPageToken: string; + /** DroppedLabels label. */ + public label: { [k: string]: string }; /** - * Creates a new ListGroupsResponse instance using the specified properties. + * Creates a new DroppedLabels instance using the specified properties. * @param [properties] Properties to set - * @returns ListGroupsResponse instance + * @returns DroppedLabels instance */ - public static create(properties?: google.monitoring.v3.IListGroupsResponse): google.monitoring.v3.ListGroupsResponse; + public static create(properties?: google.monitoring.v3.IDroppedLabels): google.monitoring.v3.DroppedLabels; /** - * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. - * @param message ListGroupsResponse message or plain object to encode + * Encodes the specified DroppedLabels message. Does not implicitly {@link google.monitoring.v3.DroppedLabels.verify|verify} messages. + * @param message DroppedLabels message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IDroppedLabels, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. - * @param message ListGroupsResponse message or plain object to encode + * Encodes the specified DroppedLabels message, length delimited. Does not implicitly {@link google.monitoring.v3.DroppedLabels.verify|verify} messages. + * @param message DroppedLabels message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IDroppedLabels, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGroupsResponse message from the specified reader or buffer. + * Decodes a DroppedLabels message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGroupsResponse + * @returns DroppedLabels * @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.monitoring.v3.ListGroupsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DroppedLabels; /** - * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. + * Decodes a DroppedLabels message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGroupsResponse + * @returns DroppedLabels * @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.monitoring.v3.ListGroupsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DroppedLabels; /** - * Verifies a ListGroupsResponse message. + * Verifies a DroppedLabels 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 ListGroupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DroppedLabels message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGroupsResponse + * @returns DroppedLabels */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupsResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DroppedLabels; /** - * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. - * @param message ListGroupsResponse + * Creates a plain object from a DroppedLabels message. Also converts values to other types if specified. + * @param message DroppedLabels * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.DroppedLabels, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGroupsResponse to JSON. + * Converts this DroppedLabels to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetGroupRequest. */ - interface IGetGroupRequest { + /** Properties of a Group. */ + interface IGroup { - /** GetGroupRequest name */ + /** Group name */ name?: (string|null); + + /** Group displayName */ + displayName?: (string|null); + + /** Group parentName */ + parentName?: (string|null); + + /** Group filter */ + filter?: (string|null); + + /** Group isCluster */ + isCluster?: (boolean|null); } - /** Represents a GetGroupRequest. */ - class GetGroupRequest implements IGetGroupRequest { + /** Represents a Group. */ + class Group implements IGroup { /** - * Constructs a new GetGroupRequest. + * Constructs a new Group. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetGroupRequest); + constructor(properties?: google.monitoring.v3.IGroup); - /** GetGroupRequest name. */ + /** Group name. */ public name: string; + /** Group displayName. */ + public displayName: string; + + /** Group parentName. */ + public parentName: string; + + /** Group filter. */ + public filter: string; + + /** Group isCluster. */ + public isCluster: boolean; + /** - * Creates a new GetGroupRequest instance using the specified properties. + * Creates a new Group instance using the specified properties. * @param [properties] Properties to set - * @returns GetGroupRequest instance + * @returns Group instance */ - public static create(properties?: google.monitoring.v3.IGetGroupRequest): google.monitoring.v3.GetGroupRequest; + public static create(properties?: google.monitoring.v3.IGroup): google.monitoring.v3.Group; /** - * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. - * @param message GetGroupRequest message or plain object to encode + * Encodes the specified Group message. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. + * @param message Group message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. - * @param message GetGroupRequest message or plain object to encode + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. + * @param message Group message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetGroupRequest message from the specified reader or buffer. + * Decodes a Group message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetGroupRequest + * @returns Group * @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.monitoring.v3.GetGroupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Group; /** - * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. + * Decodes a Group message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetGroupRequest + * @returns Group * @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.monitoring.v3.GetGroupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Group; /** - * Verifies a GetGroupRequest message. + * Verifies a Group 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 GetGroupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Group message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetGroupRequest + * @returns Group */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetGroupRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Group; /** - * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. - * @param message GetGroupRequest + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetGroupRequest to JSON. + * Converts this Group to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateGroupRequest. */ - interface ICreateGroupRequest { + /** Represents a GroupService */ + class GroupService extends $protobuf.rpc.Service { - /** CreateGroupRequest name */ - name?: (string|null); + /** + * Constructs a new GroupService 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); - /** CreateGroupRequest group */ - group?: (google.monitoring.v3.IGroup|null); + /** + * Creates new GroupService 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): GroupService; - /** CreateGroupRequest validateOnly */ - validateOnly?: (boolean|null); - } + /** + * Calls ListGroups. + * @param request ListGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGroupsResponse + */ + public listGroups(request: google.monitoring.v3.IListGroupsRequest, callback: google.monitoring.v3.GroupService.ListGroupsCallback): void; - /** Represents a CreateGroupRequest. */ - class CreateGroupRequest implements ICreateGroupRequest { + /** + * Calls ListGroups. + * @param request ListGroupsRequest message or plain object + * @returns Promise + */ + public listGroups(request: google.monitoring.v3.IListGroupsRequest): Promise; /** - * Constructs a new CreateGroupRequest. - * @param [properties] Properties to set + * Calls GetGroup. + * @param request GetGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Group */ - constructor(properties?: google.monitoring.v3.ICreateGroupRequest); + public getGroup(request: google.monitoring.v3.IGetGroupRequest, callback: google.monitoring.v3.GroupService.GetGroupCallback): void; - /** CreateGroupRequest name. */ - public name: string; + /** + * Calls GetGroup. + * @param request GetGroupRequest message or plain object + * @returns Promise + */ + public getGroup(request: google.monitoring.v3.IGetGroupRequest): Promise; - /** CreateGroupRequest group. */ - public group?: (google.monitoring.v3.IGroup|null); + /** + * Calls CreateGroup. + * @param request CreateGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Group + */ + public createGroup(request: google.monitoring.v3.ICreateGroupRequest, callback: google.monitoring.v3.GroupService.CreateGroupCallback): void; - /** CreateGroupRequest validateOnly. */ - public validateOnly: boolean; + /** + * Calls CreateGroup. + * @param request CreateGroupRequest message or plain object + * @returns Promise + */ + public createGroup(request: google.monitoring.v3.ICreateGroupRequest): Promise; /** - * Creates a new CreateGroupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateGroupRequest instance + * Calls UpdateGroup. + * @param request UpdateGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Group */ - public static create(properties?: google.monitoring.v3.ICreateGroupRequest): google.monitoring.v3.CreateGroupRequest; + public updateGroup(request: google.monitoring.v3.IUpdateGroupRequest, callback: google.monitoring.v3.GroupService.UpdateGroupCallback): void; /** - * Encodes the specified CreateGroupRequest message. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. - * @param message CreateGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls UpdateGroup. + * @param request UpdateGroupRequest message or plain object + * @returns Promise */ - public static encode(message: google.monitoring.v3.ICreateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public updateGroup(request: google.monitoring.v3.IUpdateGroupRequest): Promise; /** - * Encodes the specified CreateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. - * @param message CreateGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteGroup. + * @param request DeleteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static encodeDelimited(message: google.monitoring.v3.ICreateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteGroup(request: google.monitoring.v3.IDeleteGroupRequest, callback: google.monitoring.v3.GroupService.DeleteGroupCallback): void; /** - * Decodes a CreateGroupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteGroup. + * @param request DeleteGroupRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateGroupRequest; + public deleteGroup(request: google.monitoring.v3.IDeleteGroupRequest): Promise; /** - * Decodes a CreateGroupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListGroupMembers. + * @param request ListGroupMembersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGroupMembersResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateGroupRequest; + public listGroupMembers(request: google.monitoring.v3.IListGroupMembersRequest, callback: google.monitoring.v3.GroupService.ListGroupMembersCallback): void; /** - * Verifies a CreateGroupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListGroupMembers. + * @param request ListGroupMembersRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listGroupMembers(request: google.monitoring.v3.IListGroupMembersRequest): Promise; + } + + namespace GroupService { /** - * Creates a CreateGroupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateGroupRequest + * Callback as used by {@link google.monitoring.v3.GroupService#listGroups}. + * @param error Error, if any + * @param [response] ListGroupsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateGroupRequest; + type ListGroupsCallback = (error: (Error|null), response?: google.monitoring.v3.ListGroupsResponse) => void; /** - * Creates a plain object from a CreateGroupRequest message. Also converts values to other types if specified. - * @param message CreateGroupRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.monitoring.v3.GroupService#getGroup}. + * @param error Error, if any + * @param [response] Group */ - public static toObject(message: google.monitoring.v3.CreateGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type GetGroupCallback = (error: (Error|null), response?: google.monitoring.v3.Group) => void; /** - * Converts this CreateGroupRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.monitoring.v3.GroupService#createGroup}. + * @param error Error, if any + * @param [response] Group */ - public toJSON(): { [k: string]: any }; + type CreateGroupCallback = (error: (Error|null), response?: google.monitoring.v3.Group) => void; + + /** + * Callback as used by {@link google.monitoring.v3.GroupService#updateGroup}. + * @param error Error, if any + * @param [response] Group + */ + type UpdateGroupCallback = (error: (Error|null), response?: google.monitoring.v3.Group) => void; + + /** + * Callback as used by {@link google.monitoring.v3.GroupService#deleteGroup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteGroupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.monitoring.v3.GroupService#listGroupMembers}. + * @param error Error, if any + * @param [response] ListGroupMembersResponse + */ + type ListGroupMembersCallback = (error: (Error|null), response?: google.monitoring.v3.ListGroupMembersResponse) => void; } - /** Properties of an UpdateGroupRequest. */ - interface IUpdateGroupRequest { + /** Properties of a ListGroupsRequest. */ + interface IListGroupsRequest { - /** UpdateGroupRequest group */ - group?: (google.monitoring.v3.IGroup|null); + /** ListGroupsRequest name */ + name?: (string|null); - /** UpdateGroupRequest validateOnly */ - validateOnly?: (boolean|null); + /** ListGroupsRequest childrenOfGroup */ + childrenOfGroup?: (string|null); + + /** ListGroupsRequest ancestorsOfGroup */ + ancestorsOfGroup?: (string|null); + + /** ListGroupsRequest descendantsOfGroup */ + descendantsOfGroup?: (string|null); + + /** ListGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListGroupsRequest pageToken */ + pageToken?: (string|null); } - /** Represents an UpdateGroupRequest. */ - class UpdateGroupRequest implements IUpdateGroupRequest { + /** Represents a ListGroupsRequest. */ + class ListGroupsRequest implements IListGroupsRequest { + + /** + * Constructs a new ListGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListGroupsRequest); + + /** ListGroupsRequest name. */ + public name: string; + + /** ListGroupsRequest childrenOfGroup. */ + public childrenOfGroup: string; + + /** ListGroupsRequest ancestorsOfGroup. */ + public ancestorsOfGroup: string; + + /** ListGroupsRequest descendantsOfGroup. */ + public descendantsOfGroup: string; - /** - * Constructs a new UpdateGroupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IUpdateGroupRequest); + /** ListGroupsRequest pageSize. */ + public pageSize: number; - /** UpdateGroupRequest group. */ - public group?: (google.monitoring.v3.IGroup|null); + /** ListGroupsRequest pageToken. */ + public pageToken: string; - /** UpdateGroupRequest validateOnly. */ - public validateOnly: boolean; + /** ListGroupsRequest filter. */ + public filter?: ("childrenOfGroup"|"ancestorsOfGroup"|"descendantsOfGroup"); /** - * Creates a new UpdateGroupRequest instance using the specified properties. + * Creates a new ListGroupsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateGroupRequest instance + * @returns ListGroupsRequest instance */ - public static create(properties?: google.monitoring.v3.IUpdateGroupRequest): google.monitoring.v3.UpdateGroupRequest; + public static create(properties?: google.monitoring.v3.IListGroupsRequest): google.monitoring.v3.ListGroupsRequest; /** - * Encodes the specified UpdateGroupRequest message. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. - * @param message UpdateGroupRequest message or plain object to encode + * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. + * @param message ListGroupsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IUpdateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. - * @param message UpdateGroupRequest message or plain object to encode + * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. + * @param message ListGroupsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IUpdateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateGroupRequest message from the specified reader or buffer. + * Decodes a ListGroupsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateGroupRequest + * @returns ListGroupsRequest * @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.monitoring.v3.UpdateGroupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListGroupsRequest; /** - * Decodes an UpdateGroupRequest message from the specified reader or buffer, length delimited. + * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateGroupRequest + * @returns ListGroupsRequest * @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.monitoring.v3.UpdateGroupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListGroupsRequest; /** - * Verifies an UpdateGroupRequest message. + * Verifies a ListGroupsRequest 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 UpdateGroupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListGroupsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateGroupRequest + * @returns ListGroupsRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateGroupRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupsRequest; /** - * Creates a plain object from an UpdateGroupRequest message. Also converts values to other types if specified. - * @param message UpdateGroupRequest + * Creates a plain object from a ListGroupsRequest message. Also converts values to other types if specified. + * @param message ListGroupsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.UpdateGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateGroupRequest to JSON. + * Converts this ListGroupsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteGroupRequest. */ - interface IDeleteGroupRequest { + /** Properties of a ListGroupsResponse. */ + interface IListGroupsResponse { - /** DeleteGroupRequest name */ - name?: (string|null); + /** ListGroupsResponse group */ + group?: (google.monitoring.v3.IGroup[]|null); - /** DeleteGroupRequest recursive */ - recursive?: (boolean|null); + /** ListGroupsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a DeleteGroupRequest. */ - class DeleteGroupRequest implements IDeleteGroupRequest { + /** Represents a ListGroupsResponse. */ + class ListGroupsResponse implements IListGroupsResponse { /** - * Constructs a new DeleteGroupRequest. + * Constructs a new ListGroupsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IDeleteGroupRequest); + constructor(properties?: google.monitoring.v3.IListGroupsResponse); - /** DeleteGroupRequest name. */ - public name: string; + /** ListGroupsResponse group. */ + public group: google.monitoring.v3.IGroup[]; - /** DeleteGroupRequest recursive. */ - public recursive: boolean; + /** ListGroupsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new DeleteGroupRequest instance using the specified properties. + * Creates a new ListGroupsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteGroupRequest instance + * @returns ListGroupsResponse instance */ - public static create(properties?: google.monitoring.v3.IDeleteGroupRequest): google.monitoring.v3.DeleteGroupRequest; + public static create(properties?: google.monitoring.v3.IListGroupsResponse): google.monitoring.v3.ListGroupsResponse; /** - * Encodes the specified DeleteGroupRequest message. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. - * @param message DeleteGroupRequest message or plain object to encode + * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. + * @param message ListGroupsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IDeleteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. - * @param message DeleteGroupRequest message or plain object to encode + * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. + * @param message ListGroupsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteGroupRequest message from the specified reader or buffer. + * Decodes a ListGroupsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteGroupRequest + * @returns ListGroupsResponse * @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.monitoring.v3.DeleteGroupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListGroupsResponse; /** - * Decodes a DeleteGroupRequest message from the specified reader or buffer, length delimited. + * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteGroupRequest + * @returns ListGroupsResponse * @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.monitoring.v3.DeleteGroupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListGroupsResponse; /** - * Verifies a DeleteGroupRequest message. + * Verifies a ListGroupsResponse 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 DeleteGroupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListGroupsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteGroupRequest + * @returns ListGroupsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteGroupRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupsResponse; /** - * Creates a plain object from a DeleteGroupRequest message. Also converts values to other types if specified. - * @param message DeleteGroupRequest + * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. + * @param message ListGroupsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.DeleteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteGroupRequest to JSON. + * Converts this ListGroupsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGroupMembersRequest. */ - interface IListGroupMembersRequest { + /** Properties of a GetGroupRequest. */ + interface IGetGroupRequest { - /** ListGroupMembersRequest name */ + /** GetGroupRequest name */ name?: (string|null); - - /** ListGroupMembersRequest pageSize */ - pageSize?: (number|null); - - /** ListGroupMembersRequest pageToken */ - pageToken?: (string|null); - - /** ListGroupMembersRequest filter */ - filter?: (string|null); - - /** ListGroupMembersRequest interval */ - interval?: (google.monitoring.v3.ITimeInterval|null); } - /** Represents a ListGroupMembersRequest. */ - class ListGroupMembersRequest implements IListGroupMembersRequest { + /** Represents a GetGroupRequest. */ + class GetGroupRequest implements IGetGroupRequest { /** - * Constructs a new ListGroupMembersRequest. + * Constructs a new GetGroupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListGroupMembersRequest); + constructor(properties?: google.monitoring.v3.IGetGroupRequest); - /** ListGroupMembersRequest name. */ + /** GetGroupRequest name. */ public name: string; - /** ListGroupMembersRequest pageSize. */ - public pageSize: number; - - /** ListGroupMembersRequest pageToken. */ - public pageToken: string; - - /** ListGroupMembersRequest filter. */ - public filter: string; - - /** ListGroupMembersRequest interval. */ - public interval?: (google.monitoring.v3.ITimeInterval|null); - /** - * Creates a new ListGroupMembersRequest instance using the specified properties. + * Creates a new GetGroupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListGroupMembersRequest instance + * @returns GetGroupRequest instance */ - public static create(properties?: google.monitoring.v3.IListGroupMembersRequest): google.monitoring.v3.ListGroupMembersRequest; + public static create(properties?: google.monitoring.v3.IGetGroupRequest): google.monitoring.v3.GetGroupRequest; /** - * Encodes the specified ListGroupMembersRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. - * @param message ListGroupMembersRequest message or plain object to encode + * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. + * @param message GetGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListGroupMembersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGroupMembersRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. - * @param message ListGroupMembersRequest message or plain object to encode + * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. + * @param message GetGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListGroupMembersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGroupMembersRequest message from the specified reader or buffer. + * Decodes a GetGroupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGroupMembersRequest + * @returns GetGroupRequest * @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.monitoring.v3.ListGroupMembersRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetGroupRequest; /** - * Decodes a ListGroupMembersRequest message from the specified reader or buffer, length delimited. + * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGroupMembersRequest + * @returns GetGroupRequest * @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.monitoring.v3.ListGroupMembersRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetGroupRequest; /** - * Verifies a ListGroupMembersRequest message. + * Verifies a GetGroupRequest 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 ListGroupMembersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetGroupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGroupMembersRequest + * @returns GetGroupRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupMembersRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetGroupRequest; /** - * Creates a plain object from a ListGroupMembersRequest message. Also converts values to other types if specified. - * @param message ListGroupMembersRequest + * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. + * @param message GetGroupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListGroupMembersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGroupMembersRequest to JSON. + * Converts this GetGroupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListGroupMembersResponse. */ - interface IListGroupMembersResponse { + /** Properties of a CreateGroupRequest. */ + interface ICreateGroupRequest { - /** ListGroupMembersResponse members */ - members?: (google.api.IMonitoredResource[]|null); + /** CreateGroupRequest name */ + name?: (string|null); - /** ListGroupMembersResponse nextPageToken */ - nextPageToken?: (string|null); + /** CreateGroupRequest group */ + group?: (google.monitoring.v3.IGroup|null); - /** ListGroupMembersResponse totalSize */ - totalSize?: (number|null); + /** CreateGroupRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a ListGroupMembersResponse. */ - class ListGroupMembersResponse implements IListGroupMembersResponse { + /** Represents a CreateGroupRequest. */ + class CreateGroupRequest implements ICreateGroupRequest { /** - * Constructs a new ListGroupMembersResponse. + * Constructs a new CreateGroupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListGroupMembersResponse); - - /** ListGroupMembersResponse members. */ - public members: google.api.IMonitoredResource[]; + constructor(properties?: google.monitoring.v3.ICreateGroupRequest); - /** ListGroupMembersResponse nextPageToken. */ - public nextPageToken: string; + /** CreateGroupRequest name. */ + public name: string; - /** ListGroupMembersResponse totalSize. */ - public totalSize: number; + /** CreateGroupRequest group. */ + public group?: (google.monitoring.v3.IGroup|null); + + /** CreateGroupRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new ListGroupMembersResponse instance using the specified properties. + * Creates a new CreateGroupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListGroupMembersResponse instance + * @returns CreateGroupRequest instance */ - public static create(properties?: google.monitoring.v3.IListGroupMembersResponse): google.monitoring.v3.ListGroupMembersResponse; + public static create(properties?: google.monitoring.v3.ICreateGroupRequest): google.monitoring.v3.CreateGroupRequest; /** - * Encodes the specified ListGroupMembersResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. - * @param message ListGroupMembersResponse message or plain object to encode + * Encodes the specified CreateGroupRequest message. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. + * @param message CreateGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListGroupMembersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ICreateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListGroupMembersResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. - * @param message ListGroupMembersResponse message or plain object to encode + * Encodes the specified CreateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. + * @param message CreateGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListGroupMembersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ICreateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListGroupMembersResponse message from the specified reader or buffer. + * Decodes a CreateGroupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListGroupMembersResponse + * @returns CreateGroupRequest * @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.monitoring.v3.ListGroupMembersResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateGroupRequest; /** - * Decodes a ListGroupMembersResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateGroupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListGroupMembersResponse + * @returns CreateGroupRequest * @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.monitoring.v3.ListGroupMembersResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateGroupRequest; /** - * Verifies a ListGroupMembersResponse message. + * Verifies a CreateGroupRequest 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 ListGroupMembersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateGroupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListGroupMembersResponse + * @returns CreateGroupRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupMembersResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateGroupRequest; /** - * Creates a plain object from a ListGroupMembersResponse message. Also converts values to other types if specified. - * @param message ListGroupMembersResponse + * Creates a plain object from a CreateGroupRequest message. Also converts values to other types if specified. + * @param message CreateGroupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListGroupMembersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.CreateGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListGroupMembersResponse to JSON. + * Converts this CreateGroupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Group. */ - interface IGroup { - - /** Group name */ - name?: (string|null); - - /** Group displayName */ - displayName?: (string|null); - - /** Group parentName */ - parentName?: (string|null); + /** Properties of an UpdateGroupRequest. */ + interface IUpdateGroupRequest { - /** Group filter */ - filter?: (string|null); + /** UpdateGroupRequest group */ + group?: (google.monitoring.v3.IGroup|null); - /** Group isCluster */ - isCluster?: (boolean|null); + /** UpdateGroupRequest validateOnly */ + validateOnly?: (boolean|null); } - /** Represents a Group. */ - class Group implements IGroup { + /** Represents an UpdateGroupRequest. */ + class UpdateGroupRequest implements IUpdateGroupRequest { /** - * Constructs a new Group. + * Constructs a new UpdateGroupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGroup); - - /** Group name. */ - public name: string; - - /** Group displayName. */ - public displayName: string; - - /** Group parentName. */ - public parentName: string; + constructor(properties?: google.monitoring.v3.IUpdateGroupRequest); - /** Group filter. */ - public filter: string; + /** UpdateGroupRequest group. */ + public group?: (google.monitoring.v3.IGroup|null); - /** Group isCluster. */ - public isCluster: boolean; + /** UpdateGroupRequest validateOnly. */ + public validateOnly: boolean; /** - * Creates a new Group instance using the specified properties. + * Creates a new UpdateGroupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Group instance + * @returns UpdateGroupRequest instance */ - public static create(properties?: google.monitoring.v3.IGroup): google.monitoring.v3.Group; + public static create(properties?: google.monitoring.v3.IUpdateGroupRequest): google.monitoring.v3.UpdateGroupRequest; /** - * Encodes the specified Group message. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. - * @param message Group message or plain object to encode + * Encodes the specified UpdateGroupRequest message. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. + * @param message UpdateGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IUpdateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. - * @param message Group message or plain object to encode + * Encodes the specified UpdateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. + * @param message UpdateGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IUpdateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Group message from the specified reader or buffer. + * Decodes an UpdateGroupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Group + * @returns UpdateGroupRequest * @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.monitoring.v3.Group; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateGroupRequest; /** - * Decodes a Group message from the specified reader or buffer, length delimited. + * Decodes an UpdateGroupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Group + * @returns UpdateGroupRequest * @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.monitoring.v3.Group; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateGroupRequest; /** - * Verifies a Group message. + * Verifies an UpdateGroupRequest 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 Group message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateGroupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Group + * @returns UpdateGroupRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Group; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateGroupRequest; /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @param message Group + * Creates a plain object from an UpdateGroupRequest message. Also converts values to other types if specified. + * @param message UpdateGroupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.UpdateGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Group to JSON. + * Converts this UpdateGroupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a MetricService */ - class MetricService extends $protobuf.rpc.Service { - - /** - * Constructs a new MetricService 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 MetricService 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): MetricService; + /** Properties of a DeleteGroupRequest. */ + interface IDeleteGroupRequest { - /** - * 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.monitoring.v3.IListMonitoredResourceDescriptorsRequest, callback: google.monitoring.v3.MetricService.ListMonitoredResourceDescriptorsCallback): void; + /** DeleteGroupRequest name */ + name?: (string|null); - /** - * Calls ListMonitoredResourceDescriptors. - * @param request ListMonitoredResourceDescriptorsRequest message or plain object - * @returns Promise - */ - public listMonitoredResourceDescriptors(request: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest): Promise; + /** DeleteGroupRequest recursive */ + recursive?: (boolean|null); + } - /** - * Calls GetMonitoredResourceDescriptor. - * @param request GetMonitoredResourceDescriptorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and MonitoredResourceDescriptor - */ - public getMonitoredResourceDescriptor(request: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, callback: google.monitoring.v3.MetricService.GetMonitoredResourceDescriptorCallback): void; + /** Represents a DeleteGroupRequest. */ + class DeleteGroupRequest implements IDeleteGroupRequest { /** - * Calls GetMonitoredResourceDescriptor. - * @param request GetMonitoredResourceDescriptorRequest message or plain object - * @returns Promise + * Constructs a new DeleteGroupRequest. + * @param [properties] Properties to set */ - public getMonitoredResourceDescriptor(request: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest): Promise; + constructor(properties?: google.monitoring.v3.IDeleteGroupRequest); - /** - * Calls ListMetricDescriptors. - * @param request ListMetricDescriptorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListMetricDescriptorsResponse - */ - public listMetricDescriptors(request: google.monitoring.v3.IListMetricDescriptorsRequest, callback: google.monitoring.v3.MetricService.ListMetricDescriptorsCallback): void; + /** DeleteGroupRequest name. */ + public name: string; - /** - * Calls ListMetricDescriptors. - * @param request ListMetricDescriptorsRequest message or plain object - * @returns Promise - */ - public listMetricDescriptors(request: google.monitoring.v3.IListMetricDescriptorsRequest): Promise; + /** DeleteGroupRequest recursive. */ + public recursive: boolean; /** - * Calls GetMetricDescriptor. - * @param request GetMetricDescriptorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and MetricDescriptor + * Creates a new DeleteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGroupRequest instance */ - public getMetricDescriptor(request: google.monitoring.v3.IGetMetricDescriptorRequest, callback: google.monitoring.v3.MetricService.GetMetricDescriptorCallback): void; + public static create(properties?: google.monitoring.v3.IDeleteGroupRequest): google.monitoring.v3.DeleteGroupRequest; /** - * Calls GetMetricDescriptor. - * @param request GetMetricDescriptorRequest message or plain object - * @returns Promise + * Encodes the specified DeleteGroupRequest message. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. + * @param message DeleteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getMetricDescriptor(request: google.monitoring.v3.IGetMetricDescriptorRequest): Promise; + public static encode(message: google.monitoring.v3.IDeleteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateMetricDescriptor. - * @param request CreateMetricDescriptorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and MetricDescriptor + * Encodes the specified DeleteGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. + * @param message DeleteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createMetricDescriptor(request: google.monitoring.v3.ICreateMetricDescriptorRequest, callback: google.monitoring.v3.MetricService.CreateMetricDescriptorCallback): void; + public static encodeDelimited(message: google.monitoring.v3.IDeleteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateMetricDescriptor. - * @param request CreateMetricDescriptorRequest message or plain object - * @returns Promise + * Decodes a DeleteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createMetricDescriptor(request: google.monitoring.v3.ICreateMetricDescriptorRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteGroupRequest; /** - * Calls DeleteMetricDescriptor. - * @param request DeleteMetricDescriptorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Decodes a DeleteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteMetricDescriptor(request: google.monitoring.v3.IDeleteMetricDescriptorRequest, callback: google.monitoring.v3.MetricService.DeleteMetricDescriptorCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteGroupRequest; /** - * Calls DeleteMetricDescriptor. - * @param request DeleteMetricDescriptorRequest message or plain object - * @returns Promise + * Verifies a DeleteGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteMetricDescriptor(request: google.monitoring.v3.IDeleteMetricDescriptorRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListTimeSeries. - * @param request ListTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTimeSeriesResponse + * Creates a DeleteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGroupRequest */ - public listTimeSeries(request: google.monitoring.v3.IListTimeSeriesRequest, callback: google.monitoring.v3.MetricService.ListTimeSeriesCallback): void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteGroupRequest; /** - * Calls ListTimeSeries. - * @param request ListTimeSeriesRequest message or plain object - * @returns Promise + * Creates a plain object from a DeleteGroupRequest message. Also converts values to other types if specified. + * @param message DeleteGroupRequest + * @param [options] Conversion options + * @returns Plain object */ - public listTimeSeries(request: google.monitoring.v3.IListTimeSeriesRequest): Promise; + public static toObject(message: google.monitoring.v3.DeleteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls CreateTimeSeries. - * @param request CreateTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Converts this DeleteGroupRequest to JSON. + * @returns JSON object */ - public createTimeSeries(request: google.monitoring.v3.ICreateTimeSeriesRequest, callback: google.monitoring.v3.MetricService.CreateTimeSeriesCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGroupMembersRequest. */ + interface IListGroupMembersRequest { + + /** ListGroupMembersRequest name */ + name?: (string|null); + + /** ListGroupMembersRequest pageSize */ + pageSize?: (number|null); + + /** ListGroupMembersRequest pageToken */ + pageToken?: (string|null); + + /** ListGroupMembersRequest filter */ + filter?: (string|null); + + /** ListGroupMembersRequest interval */ + interval?: (google.monitoring.v3.ITimeInterval|null); + } + + /** Represents a ListGroupMembersRequest. */ + class ListGroupMembersRequest implements IListGroupMembersRequest { /** - * Calls CreateTimeSeries. - * @param request CreateTimeSeriesRequest message or plain object - * @returns Promise + * Constructs a new ListGroupMembersRequest. + * @param [properties] Properties to set */ - public createTimeSeries(request: google.monitoring.v3.ICreateTimeSeriesRequest): Promise; - } + constructor(properties?: google.monitoring.v3.IListGroupMembersRequest); - namespace MetricService { + /** ListGroupMembersRequest name. */ + public name: string; + + /** ListGroupMembersRequest pageSize. */ + public pageSize: number; + + /** ListGroupMembersRequest pageToken. */ + public pageToken: string; + + /** ListGroupMembersRequest filter. */ + public filter: string; + + /** ListGroupMembersRequest interval. */ + public interval?: (google.monitoring.v3.ITimeInterval|null); /** - * Callback as used by {@link google.monitoring.v3.MetricService#listMonitoredResourceDescriptors}. - * @param error Error, if any - * @param [response] ListMonitoredResourceDescriptorsResponse + * Creates a new ListGroupMembersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGroupMembersRequest instance */ - type ListMonitoredResourceDescriptorsCallback = (error: (Error|null), response?: google.monitoring.v3.ListMonitoredResourceDescriptorsResponse) => void; + public static create(properties?: google.monitoring.v3.IListGroupMembersRequest): google.monitoring.v3.ListGroupMembersRequest; /** - * Callback as used by {@link google.monitoring.v3.MetricService#getMonitoredResourceDescriptor}. - * @param error Error, if any - * @param [response] MonitoredResourceDescriptor + * Encodes the specified ListGroupMembersRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. + * @param message ListGroupMembersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetMonitoredResourceDescriptorCallback = (error: (Error|null), response?: google.api.MonitoredResourceDescriptor) => void; + public static encode(message: google.monitoring.v3.IListGroupMembersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.MetricService#listMetricDescriptors}. - * @param error Error, if any - * @param [response] ListMetricDescriptorsResponse + * Encodes the specified ListGroupMembersRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. + * @param message ListGroupMembersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListMetricDescriptorsCallback = (error: (Error|null), response?: google.monitoring.v3.ListMetricDescriptorsResponse) => void; + public static encodeDelimited(message: google.monitoring.v3.IListGroupMembersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.MetricService#getMetricDescriptor}. - * @param error Error, if any - * @param [response] MetricDescriptor + * Decodes a ListGroupMembersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGroupMembersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetMetricDescriptorCallback = (error: (Error|null), response?: google.api.MetricDescriptor) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListGroupMembersRequest; /** - * Callback as used by {@link google.monitoring.v3.MetricService#createMetricDescriptor}. - * @param error Error, if any - * @param [response] MetricDescriptor + * Decodes a ListGroupMembersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGroupMembersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateMetricDescriptorCallback = (error: (Error|null), response?: google.api.MetricDescriptor) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListGroupMembersRequest; /** - * Callback as used by {@link google.monitoring.v3.MetricService#deleteMetricDescriptor}. - * @param error Error, if any - * @param [response] Empty + * Verifies a ListGroupMembersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type DeleteMetricDescriptorCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.monitoring.v3.MetricService#listTimeSeries}. - * @param error Error, if any - * @param [response] ListTimeSeriesResponse + * Creates a ListGroupMembersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGroupMembersRequest */ - type ListTimeSeriesCallback = (error: (Error|null), response?: google.monitoring.v3.ListTimeSeriesResponse) => void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupMembersRequest; /** - * Callback as used by {@link google.monitoring.v3.MetricService#createTimeSeries}. - * @param error Error, if any - * @param [response] Empty + * Creates a plain object from a ListGroupMembersRequest message. Also converts values to other types if specified. + * @param message ListGroupMembersRequest + * @param [options] Conversion options + * @returns Plain object */ - type CreateTimeSeriesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } + public static toObject(message: google.monitoring.v3.ListGroupMembersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a ListMonitoredResourceDescriptorsRequest. */ - interface IListMonitoredResourceDescriptorsRequest { + /** + * Converts this ListGroupMembersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListMonitoredResourceDescriptorsRequest name */ - name?: (string|null); + /** Properties of a ListGroupMembersResponse. */ + interface IListGroupMembersResponse { - /** ListMonitoredResourceDescriptorsRequest filter */ - filter?: (string|null); + /** ListGroupMembersResponse members */ + members?: (google.api.IMonitoredResource[]|null); - /** ListMonitoredResourceDescriptorsRequest pageSize */ - pageSize?: (number|null); + /** ListGroupMembersResponse nextPageToken */ + nextPageToken?: (string|null); - /** ListMonitoredResourceDescriptorsRequest pageToken */ - pageToken?: (string|null); + /** ListGroupMembersResponse totalSize */ + totalSize?: (number|null); } - /** Represents a ListMonitoredResourceDescriptorsRequest. */ - class ListMonitoredResourceDescriptorsRequest implements IListMonitoredResourceDescriptorsRequest { + /** Represents a ListGroupMembersResponse. */ + class ListGroupMembersResponse implements IListGroupMembersResponse { /** - * Constructs a new ListMonitoredResourceDescriptorsRequest. + * Constructs a new ListGroupMembersResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest); - - /** ListMonitoredResourceDescriptorsRequest name. */ - public name: string; + constructor(properties?: google.monitoring.v3.IListGroupMembersResponse); - /** ListMonitoredResourceDescriptorsRequest filter. */ - public filter: string; + /** ListGroupMembersResponse members. */ + public members: google.api.IMonitoredResource[]; - /** ListMonitoredResourceDescriptorsRequest pageSize. */ - public pageSize: number; + /** ListGroupMembersResponse nextPageToken. */ + public nextPageToken: string; - /** ListMonitoredResourceDescriptorsRequest pageToken. */ - public pageToken: string; + /** ListGroupMembersResponse totalSize. */ + public totalSize: number; /** - * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. + * Creates a new ListGroupMembersResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListMonitoredResourceDescriptorsRequest instance + * @returns ListGroupMembersResponse instance */ - public static create(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest): google.monitoring.v3.ListMonitoredResourceDescriptorsRequest; + public static create(properties?: google.monitoring.v3.IListGroupMembersResponse): google.monitoring.v3.ListGroupMembersResponse; /** - * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. - * @param message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * Encodes the specified ListGroupMembersResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. + * @param message ListGroupMembersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListGroupMembersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. - * @param message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * Encodes the specified ListGroupMembersResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. + * @param message ListGroupMembersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListGroupMembersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer. + * Decodes a ListGroupMembersResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMonitoredResourceDescriptorsRequest + * @returns ListGroupMembersResponse * @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.monitoring.v3.ListMonitoredResourceDescriptorsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListGroupMembersResponse; /** - * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListGroupMembersResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMonitoredResourceDescriptorsRequest + * @returns ListGroupMembersResponse * @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.monitoring.v3.ListMonitoredResourceDescriptorsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListGroupMembersResponse; /** - * Verifies a ListMonitoredResourceDescriptorsRequest message. + * Verifies a ListGroupMembersResponse 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. + * Creates a ListGroupMembersResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMonitoredResourceDescriptorsRequest + * @returns ListGroupMembersResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMonitoredResourceDescriptorsRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListGroupMembersResponse; /** - * Creates a plain object from a ListMonitoredResourceDescriptorsRequest message. Also converts values to other types if specified. - * @param message ListMonitoredResourceDescriptorsRequest + * Creates a plain object from a ListGroupMembersResponse message. Also converts values to other types if specified. + * @param message ListGroupMembersResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListMonitoredResourceDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListGroupMembersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMonitoredResourceDescriptorsRequest to JSON. + * Converts this ListGroupMembersResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListMonitoredResourceDescriptorsResponse. */ - interface IListMonitoredResourceDescriptorsResponse { - - /** ListMonitoredResourceDescriptorsResponse resourceDescriptors */ - resourceDescriptors?: (google.api.IMonitoredResourceDescriptor[]|null); + /** Properties of a Point. */ + interface IPoint { - /** ListMonitoredResourceDescriptorsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Point interval */ + interval?: (google.monitoring.v3.ITimeInterval|null); + + /** Point value */ + value?: (google.monitoring.v3.ITypedValue|null); } - /** Represents a ListMonitoredResourceDescriptorsResponse. */ - class ListMonitoredResourceDescriptorsResponse implements IListMonitoredResourceDescriptorsResponse { + /** Represents a Point. */ + class Point implements IPoint { /** - * Constructs a new ListMonitoredResourceDescriptorsResponse. + * Constructs a new Point. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse); + constructor(properties?: google.monitoring.v3.IPoint); - /** ListMonitoredResourceDescriptorsResponse resourceDescriptors. */ - public resourceDescriptors: google.api.IMonitoredResourceDescriptor[]; + /** Point interval. */ + public interval?: (google.monitoring.v3.ITimeInterval|null); - /** ListMonitoredResourceDescriptorsResponse nextPageToken. */ - public nextPageToken: string; + /** Point value. */ + public value?: (google.monitoring.v3.ITypedValue|null); /** - * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. + * Creates a new Point instance using the specified properties. * @param [properties] Properties to set - * @returns ListMonitoredResourceDescriptorsResponse instance + * @returns Point instance */ - public static create(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse): google.monitoring.v3.ListMonitoredResourceDescriptorsResponse; + public static create(properties?: google.monitoring.v3.IPoint): google.monitoring.v3.Point; /** - * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. - * @param message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * Encodes the specified Point message. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. + * @param message Point message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. - * @param message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. + * @param message Point message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer. + * Decodes a Point message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMonitoredResourceDescriptorsResponse + * @returns Point * @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.monitoring.v3.ListMonitoredResourceDescriptorsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Point; /** - * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. + * Decodes a Point message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMonitoredResourceDescriptorsResponse + * @returns Point * @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.monitoring.v3.ListMonitoredResourceDescriptorsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Point; /** - * Verifies a ListMonitoredResourceDescriptorsResponse message. + * Verifies a Point 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. + * Creates a Point message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMonitoredResourceDescriptorsResponse + * @returns Point */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMonitoredResourceDescriptorsResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Point; /** - * Creates a plain object from a ListMonitoredResourceDescriptorsResponse message. Also converts values to other types if specified. - * @param message ListMonitoredResourceDescriptorsResponse + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @param message Point * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListMonitoredResourceDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMonitoredResourceDescriptorsResponse to JSON. + * Converts this Point to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetMonitoredResourceDescriptorRequest. */ - interface IGetMonitoredResourceDescriptorRequest { + /** Properties of a TimeSeries. */ + interface ITimeSeries { - /** GetMonitoredResourceDescriptorRequest name */ - name?: (string|null); + /** TimeSeries metric */ + metric?: (google.api.IMetric|null); + + /** TimeSeries resource */ + resource?: (google.api.IMonitoredResource|null); + + /** TimeSeries metadata */ + metadata?: (google.api.IMonitoredResourceMetadata|null); + + /** TimeSeries metricKind */ + metricKind?: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind|null); + + /** TimeSeries valueType */ + valueType?: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType|null); + + /** TimeSeries points */ + points?: (google.monitoring.v3.IPoint[]|null); } - /** Represents a GetMonitoredResourceDescriptorRequest. */ - class GetMonitoredResourceDescriptorRequest implements IGetMonitoredResourceDescriptorRequest { + /** Represents a TimeSeries. */ + class TimeSeries implements ITimeSeries { /** - * Constructs a new GetMonitoredResourceDescriptorRequest. + * Constructs a new TimeSeries. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest); + constructor(properties?: google.monitoring.v3.ITimeSeries); - /** GetMonitoredResourceDescriptorRequest name. */ - public name: string; + /** TimeSeries metric. */ + public metric?: (google.api.IMetric|null); + + /** TimeSeries resource. */ + public resource?: (google.api.IMonitoredResource|null); + + /** TimeSeries metadata. */ + public metadata?: (google.api.IMonitoredResourceMetadata|null); + + /** TimeSeries metricKind. */ + public metricKind: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind); + + /** TimeSeries valueType. */ + public valueType: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType); + + /** TimeSeries points. */ + public points: google.monitoring.v3.IPoint[]; /** - * Creates a new GetMonitoredResourceDescriptorRequest instance using the specified properties. + * Creates a new TimeSeries instance using the specified properties. * @param [properties] Properties to set - * @returns GetMonitoredResourceDescriptorRequest instance + * @returns TimeSeries instance */ - public static create(properties?: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest): google.monitoring.v3.GetMonitoredResourceDescriptorRequest; + public static create(properties?: google.monitoring.v3.ITimeSeries): google.monitoring.v3.TimeSeries; /** - * Encodes the specified GetMonitoredResourceDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. - * @param message GetMonitoredResourceDescriptorRequest message or plain object to encode + * Encodes the specified TimeSeries message. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. + * @param message TimeSeries message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ITimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetMonitoredResourceDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. - * @param message GetMonitoredResourceDescriptorRequest message or plain object to encode + * Encodes the specified TimeSeries message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. + * @param message TimeSeries message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ITimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer. + * Decodes a TimeSeries message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetMonitoredResourceDescriptorRequest + * @returns TimeSeries * @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.monitoring.v3.GetMonitoredResourceDescriptorRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.TimeSeries; /** - * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeSeries message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetMonitoredResourceDescriptorRequest + * @returns TimeSeries * @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.monitoring.v3.GetMonitoredResourceDescriptorRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.TimeSeries; /** - * Verifies a GetMonitoredResourceDescriptorRequest message. + * Verifies a TimeSeries 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 GetMonitoredResourceDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeSeries message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetMonitoredResourceDescriptorRequest + * @returns TimeSeries */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetMonitoredResourceDescriptorRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeSeries; /** - * Creates a plain object from a GetMonitoredResourceDescriptorRequest message. Also converts values to other types if specified. - * @param message GetMonitoredResourceDescriptorRequest + * Creates a plain object from a TimeSeries message. Also converts values to other types if specified. + * @param message TimeSeries * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetMonitoredResourceDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.TimeSeries, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetMonitoredResourceDescriptorRequest to JSON. + * Converts this TimeSeries to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListMetricDescriptorsRequest. */ - interface IListMetricDescriptorsRequest { - - /** ListMetricDescriptorsRequest name */ - name?: (string|null); - - /** ListMetricDescriptorsRequest filter */ - filter?: (string|null); - - /** ListMetricDescriptorsRequest pageSize */ - pageSize?: (number|null); + /** Represents a MetricService */ + class MetricService extends $protobuf.rpc.Service { - /** ListMetricDescriptorsRequest pageToken */ - pageToken?: (string|null); - } + /** + * Constructs a new MetricService 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); - /** Represents a ListMetricDescriptorsRequest. */ - class ListMetricDescriptorsRequest implements IListMetricDescriptorsRequest { + /** + * Creates new MetricService 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): MetricService; /** - * Constructs a new ListMetricDescriptorsRequest. - * @param [properties] Properties to set + * Calls ListMonitoredResourceDescriptors. + * @param request ListMonitoredResourceDescriptorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMonitoredResourceDescriptorsResponse */ - constructor(properties?: google.monitoring.v3.IListMetricDescriptorsRequest); + public listMonitoredResourceDescriptors(request: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, callback: google.monitoring.v3.MetricService.ListMonitoredResourceDescriptorsCallback): void; - /** ListMetricDescriptorsRequest name. */ - public name: string; + /** + * Calls ListMonitoredResourceDescriptors. + * @param request ListMonitoredResourceDescriptorsRequest message or plain object + * @returns Promise + */ + public listMonitoredResourceDescriptors(request: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest): Promise; - /** ListMetricDescriptorsRequest filter. */ - public filter: string; + /** + * Calls GetMonitoredResourceDescriptor. + * @param request GetMonitoredResourceDescriptorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MonitoredResourceDescriptor + */ + public getMonitoredResourceDescriptor(request: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, callback: google.monitoring.v3.MetricService.GetMonitoredResourceDescriptorCallback): void; - /** ListMetricDescriptorsRequest pageSize. */ - public pageSize: number; + /** + * Calls GetMonitoredResourceDescriptor. + * @param request GetMonitoredResourceDescriptorRequest message or plain object + * @returns Promise + */ + public getMonitoredResourceDescriptor(request: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest): Promise; - /** ListMetricDescriptorsRequest pageToken. */ - public pageToken: string; + /** + * Calls ListMetricDescriptors. + * @param request ListMetricDescriptorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMetricDescriptorsResponse + */ + public listMetricDescriptors(request: google.monitoring.v3.IListMetricDescriptorsRequest, callback: google.monitoring.v3.MetricService.ListMetricDescriptorsCallback): void; /** - * Creates a new ListMetricDescriptorsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListMetricDescriptorsRequest instance + * Calls ListMetricDescriptors. + * @param request ListMetricDescriptorsRequest message or plain object + * @returns Promise */ - public static create(properties?: google.monitoring.v3.IListMetricDescriptorsRequest): google.monitoring.v3.ListMetricDescriptorsRequest; + public listMetricDescriptors(request: google.monitoring.v3.IListMetricDescriptorsRequest): Promise; /** - * Encodes the specified ListMetricDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. - * @param message ListMetricDescriptorsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetMetricDescriptor. + * @param request GetMetricDescriptorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MetricDescriptor */ - public static encode(message: google.monitoring.v3.IListMetricDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getMetricDescriptor(request: google.monitoring.v3.IGetMetricDescriptorRequest, callback: google.monitoring.v3.MetricService.GetMetricDescriptorCallback): void; /** - * Encodes the specified ListMetricDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. - * @param message ListMetricDescriptorsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetMetricDescriptor. + * @param request GetMetricDescriptorRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.monitoring.v3.IListMetricDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getMetricDescriptor(request: google.monitoring.v3.IGetMetricDescriptorRequest): Promise; /** - * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListMetricDescriptorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateMetricDescriptor. + * @param request CreateMetricDescriptorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MetricDescriptor */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListMetricDescriptorsRequest; + public createMetricDescriptor(request: google.monitoring.v3.ICreateMetricDescriptorRequest, callback: google.monitoring.v3.MetricService.CreateMetricDescriptorCallback): void; /** - * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListMetricDescriptorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateMetricDescriptor. + * @param request CreateMetricDescriptorRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListMetricDescriptorsRequest; + public createMetricDescriptor(request: google.monitoring.v3.ICreateMetricDescriptorRequest): Promise; /** - * Verifies a ListMetricDescriptorsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls DeleteMetricDescriptor. + * @param request DeleteMetricDescriptorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static verify(message: { [k: string]: any }): (string|null); + public deleteMetricDescriptor(request: google.monitoring.v3.IDeleteMetricDescriptorRequest, callback: google.monitoring.v3.MetricService.DeleteMetricDescriptorCallback): void; /** - * Creates a ListMetricDescriptorsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListMetricDescriptorsRequest + * Calls DeleteMetricDescriptor. + * @param request DeleteMetricDescriptorRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMetricDescriptorsRequest; + public deleteMetricDescriptor(request: google.monitoring.v3.IDeleteMetricDescriptorRequest): Promise; /** - * Creates a plain object from a ListMetricDescriptorsRequest message. Also converts values to other types if specified. - * @param message ListMetricDescriptorsRequest - * @param [options] Conversion options - * @returns Plain object + * Calls ListTimeSeries. + * @param request ListTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTimeSeriesResponse */ - public static toObject(message: google.monitoring.v3.ListMetricDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public listTimeSeries(request: google.monitoring.v3.IListTimeSeriesRequest, callback: google.monitoring.v3.MetricService.ListTimeSeriesCallback): void; /** - * Converts this ListMetricDescriptorsRequest to JSON. - * @returns JSON object + * Calls ListTimeSeries. + * @param request ListTimeSeriesRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ListMetricDescriptorsResponse. */ - interface IListMetricDescriptorsResponse { - - /** ListMetricDescriptorsResponse metricDescriptors */ - metricDescriptors?: (google.api.IMetricDescriptor[]|null); - - /** ListMetricDescriptorsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListMetricDescriptorsResponse. */ - class ListMetricDescriptorsResponse implements IListMetricDescriptorsResponse { + public listTimeSeries(request: google.monitoring.v3.IListTimeSeriesRequest): Promise; /** - * Constructs a new ListMetricDescriptorsResponse. - * @param [properties] Properties to set + * Calls CreateTimeSeries. + * @param request CreateTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - constructor(properties?: google.monitoring.v3.IListMetricDescriptorsResponse); - - /** ListMetricDescriptorsResponse metricDescriptors. */ - public metricDescriptors: google.api.IMetricDescriptor[]; - - /** ListMetricDescriptorsResponse nextPageToken. */ - public nextPageToken: string; + public createTimeSeries(request: google.monitoring.v3.ICreateTimeSeriesRequest, callback: google.monitoring.v3.MetricService.CreateTimeSeriesCallback): void; /** - * Creates a new ListMetricDescriptorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListMetricDescriptorsResponse instance + * Calls CreateTimeSeries. + * @param request CreateTimeSeriesRequest message or plain object + * @returns Promise */ - public static create(properties?: google.monitoring.v3.IListMetricDescriptorsResponse): google.monitoring.v3.ListMetricDescriptorsResponse; + public createTimeSeries(request: google.monitoring.v3.ICreateTimeSeriesRequest): Promise; + } + + namespace MetricService { /** - * Encodes the specified ListMetricDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. - * @param message ListMetricDescriptorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.monitoring.v3.MetricService#listMonitoredResourceDescriptors}. + * @param error Error, if any + * @param [response] ListMonitoredResourceDescriptorsResponse */ - public static encode(message: google.monitoring.v3.IListMetricDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type ListMonitoredResourceDescriptorsCallback = (error: (Error|null), response?: google.monitoring.v3.ListMonitoredResourceDescriptorsResponse) => void; /** - * Encodes the specified ListMetricDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. - * @param message ListMetricDescriptorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.monitoring.v3.MetricService#getMonitoredResourceDescriptor}. + * @param error Error, if any + * @param [response] MonitoredResourceDescriptor */ - public static encodeDelimited(message: google.monitoring.v3.IListMetricDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type GetMonitoredResourceDescriptorCallback = (error: (Error|null), response?: google.api.MonitoredResourceDescriptor) => void; /** - * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListMetricDescriptorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.MetricService#listMetricDescriptors}. + * @param error Error, if any + * @param [response] ListMetricDescriptorsResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListMetricDescriptorsResponse; + type ListMetricDescriptorsCallback = (error: (Error|null), response?: google.monitoring.v3.ListMetricDescriptorsResponse) => void; /** - * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListMetricDescriptorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.MetricService#getMetricDescriptor}. + * @param error Error, if any + * @param [response] MetricDescriptor */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListMetricDescriptorsResponse; + type GetMetricDescriptorCallback = (error: (Error|null), response?: google.api.MetricDescriptor) => void; /** - * Verifies a ListMetricDescriptorsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.monitoring.v3.MetricService#createMetricDescriptor}. + * @param error Error, if any + * @param [response] MetricDescriptor */ - public static verify(message: { [k: string]: any }): (string|null); + type CreateMetricDescriptorCallback = (error: (Error|null), response?: google.api.MetricDescriptor) => void; /** - * Creates a ListMetricDescriptorsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListMetricDescriptorsResponse + * Callback as used by {@link google.monitoring.v3.MetricService#deleteMetricDescriptor}. + * @param error Error, if any + * @param [response] Empty */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMetricDescriptorsResponse; + type DeleteMetricDescriptorCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Creates a plain object from a ListMetricDescriptorsResponse message. Also converts values to other types if specified. - * @param message ListMetricDescriptorsResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.monitoring.v3.MetricService#listTimeSeries}. + * @param error Error, if any + * @param [response] ListTimeSeriesResponse */ - public static toObject(message: google.monitoring.v3.ListMetricDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ListTimeSeriesCallback = (error: (Error|null), response?: google.monitoring.v3.ListTimeSeriesResponse) => void; /** - * Converts this ListMetricDescriptorsResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.monitoring.v3.MetricService#createTimeSeries}. + * @param error Error, if any + * @param [response] Empty */ - public toJSON(): { [k: string]: any }; + type CreateTimeSeriesCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Properties of a GetMetricDescriptorRequest. */ - interface IGetMetricDescriptorRequest { + /** Properties of a ListMonitoredResourceDescriptorsRequest. */ + interface IListMonitoredResourceDescriptorsRequest { - /** GetMetricDescriptorRequest name */ + /** ListMonitoredResourceDescriptorsRequest name */ name?: (string|null); + + /** ListMonitoredResourceDescriptorsRequest filter */ + filter?: (string|null); + + /** ListMonitoredResourceDescriptorsRequest pageSize */ + pageSize?: (number|null); + + /** ListMonitoredResourceDescriptorsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a GetMetricDescriptorRequest. */ - class GetMetricDescriptorRequest implements IGetMetricDescriptorRequest { + /** Represents a ListMonitoredResourceDescriptorsRequest. */ + class ListMonitoredResourceDescriptorsRequest implements IListMonitoredResourceDescriptorsRequest { /** - * Constructs a new GetMetricDescriptorRequest. + * Constructs a new ListMonitoredResourceDescriptorsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetMetricDescriptorRequest); + constructor(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest); - /** GetMetricDescriptorRequest name. */ + /** ListMonitoredResourceDescriptorsRequest name. */ public name: string; + /** ListMonitoredResourceDescriptorsRequest filter. */ + public filter: string; + + /** ListMonitoredResourceDescriptorsRequest pageSize. */ + public pageSize: number; + + /** ListMonitoredResourceDescriptorsRequest pageToken. */ + public pageToken: string; + /** - * Creates a new GetMetricDescriptorRequest instance using the specified properties. + * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetMetricDescriptorRequest instance + * @returns ListMonitoredResourceDescriptorsRequest instance */ - public static create(properties?: google.monitoring.v3.IGetMetricDescriptorRequest): google.monitoring.v3.GetMetricDescriptorRequest; + public static create(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest): google.monitoring.v3.ListMonitoredResourceDescriptorsRequest; /** - * Encodes the specified GetMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. - * @param message GetMetricDescriptorRequest message or plain object to encode + * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.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.monitoring.v3.IGetMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. - * @param message GetMetricDescriptorRequest message or plain object to encode + * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.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.monitoring.v3.IGetMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer. + * 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 GetMetricDescriptorRequest + * @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.monitoring.v3.GetMetricDescriptorRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListMonitoredResourceDescriptorsRequest; /** - * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetMetricDescriptorRequest + * @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.monitoring.v3.GetMetricDescriptorRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListMonitoredResourceDescriptorsRequest; /** - * Verifies a GetMetricDescriptorRequest message. + * 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 GetMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMonitoredResourceDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetMetricDescriptorRequest + * @returns ListMonitoredResourceDescriptorsRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetMetricDescriptorRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMonitoredResourceDescriptorsRequest; /** - * Creates a plain object from a GetMetricDescriptorRequest message. Also converts values to other types if specified. - * @param message GetMetricDescriptorRequest + * 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.monitoring.v3.GetMetricDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListMonitoredResourceDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetMetricDescriptorRequest to JSON. + * Converts this ListMonitoredResourceDescriptorsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateMetricDescriptorRequest. */ - interface ICreateMetricDescriptorRequest { + /** Properties of a ListMonitoredResourceDescriptorsResponse. */ + interface IListMonitoredResourceDescriptorsResponse { - /** CreateMetricDescriptorRequest name */ - name?: (string|null); + /** ListMonitoredResourceDescriptorsResponse resourceDescriptors */ + resourceDescriptors?: (google.api.IMonitoredResourceDescriptor[]|null); - /** CreateMetricDescriptorRequest metricDescriptor */ - metricDescriptor?: (google.api.IMetricDescriptor|null); + /** ListMonitoredResourceDescriptorsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a CreateMetricDescriptorRequest. */ - class CreateMetricDescriptorRequest implements ICreateMetricDescriptorRequest { + /** Represents a ListMonitoredResourceDescriptorsResponse. */ + class ListMonitoredResourceDescriptorsResponse implements IListMonitoredResourceDescriptorsResponse { /** - * Constructs a new CreateMetricDescriptorRequest. + * Constructs a new ListMonitoredResourceDescriptorsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ICreateMetricDescriptorRequest); + constructor(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse); - /** CreateMetricDescriptorRequest name. */ - public name: string; + /** ListMonitoredResourceDescriptorsResponse resourceDescriptors. */ + public resourceDescriptors: google.api.IMonitoredResourceDescriptor[]; - /** CreateMetricDescriptorRequest metricDescriptor. */ - public metricDescriptor?: (google.api.IMetricDescriptor|null); + /** ListMonitoredResourceDescriptorsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new CreateMetricDescriptorRequest instance using the specified properties. + * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateMetricDescriptorRequest instance + * @returns ListMonitoredResourceDescriptorsResponse instance */ - public static create(properties?: google.monitoring.v3.ICreateMetricDescriptorRequest): google.monitoring.v3.CreateMetricDescriptorRequest; + public static create(properties?: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse): google.monitoring.v3.ListMonitoredResourceDescriptorsResponse; /** - * Encodes the specified CreateMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. - * @param message CreateMetricDescriptorRequest message or plain object to encode + * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.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.monitoring.v3.ICreateMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. - * @param message CreateMetricDescriptorRequest message or plain object to encode + * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.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.monitoring.v3.ICreateMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListMonitoredResourceDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer. + * 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 CreateMetricDescriptorRequest + * @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.monitoring.v3.CreateMetricDescriptorRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListMonitoredResourceDescriptorsResponse; /** - * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateMetricDescriptorRequest + * @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.monitoring.v3.CreateMetricDescriptorRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListMonitoredResourceDescriptorsResponse; /** - * Verifies a CreateMetricDescriptorRequest message. + * 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 CreateMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMonitoredResourceDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateMetricDescriptorRequest + * @returns ListMonitoredResourceDescriptorsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateMetricDescriptorRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMonitoredResourceDescriptorsResponse; /** - * Creates a plain object from a CreateMetricDescriptorRequest message. Also converts values to other types if specified. - * @param message CreateMetricDescriptorRequest + * 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.monitoring.v3.CreateMetricDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListMonitoredResourceDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateMetricDescriptorRequest to JSON. + * Converts this ListMonitoredResourceDescriptorsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteMetricDescriptorRequest. */ - interface IDeleteMetricDescriptorRequest { + /** Properties of a GetMonitoredResourceDescriptorRequest. */ + interface IGetMonitoredResourceDescriptorRequest { - /** DeleteMetricDescriptorRequest name */ + /** GetMonitoredResourceDescriptorRequest name */ name?: (string|null); } - /** Represents a DeleteMetricDescriptorRequest. */ - class DeleteMetricDescriptorRequest implements IDeleteMetricDescriptorRequest { + /** Represents a GetMonitoredResourceDescriptorRequest. */ + class GetMonitoredResourceDescriptorRequest implements IGetMonitoredResourceDescriptorRequest { /** - * Constructs a new DeleteMetricDescriptorRequest. + * Constructs a new GetMonitoredResourceDescriptorRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IDeleteMetricDescriptorRequest); + constructor(properties?: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest); - /** DeleteMetricDescriptorRequest name. */ + /** GetMonitoredResourceDescriptorRequest name. */ public name: string; /** - * Creates a new DeleteMetricDescriptorRequest instance using the specified properties. + * Creates a new GetMonitoredResourceDescriptorRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteMetricDescriptorRequest instance + * @returns GetMonitoredResourceDescriptorRequest instance */ - public static create(properties?: google.monitoring.v3.IDeleteMetricDescriptorRequest): google.monitoring.v3.DeleteMetricDescriptorRequest; + public static create(properties?: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest): google.monitoring.v3.GetMonitoredResourceDescriptorRequest; /** - * Encodes the specified DeleteMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. - * @param message DeleteMetricDescriptorRequest message or plain object to encode + * Encodes the specified GetMonitoredResourceDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. + * @param message GetMonitoredResourceDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IDeleteMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. - * @param message DeleteMetricDescriptorRequest message or plain object to encode + * Encodes the specified GetMonitoredResourceDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. + * @param message GetMonitoredResourceDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer. + * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteMetricDescriptorRequest + * @returns GetMonitoredResourceDescriptorRequest * @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.monitoring.v3.DeleteMetricDescriptorRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetMonitoredResourceDescriptorRequest; /** - * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteMetricDescriptorRequest + * @returns GetMonitoredResourceDescriptorRequest * @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.monitoring.v3.DeleteMetricDescriptorRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetMonitoredResourceDescriptorRequest; /** - * Verifies a DeleteMetricDescriptorRequest message. + * Verifies a GetMonitoredResourceDescriptorRequest 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 DeleteMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMonitoredResourceDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteMetricDescriptorRequest + * @returns GetMonitoredResourceDescriptorRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteMetricDescriptorRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetMonitoredResourceDescriptorRequest; /** - * Creates a plain object from a DeleteMetricDescriptorRequest message. Also converts values to other types if specified. - * @param message DeleteMetricDescriptorRequest + * Creates a plain object from a GetMonitoredResourceDescriptorRequest message. Also converts values to other types if specified. + * @param message GetMonitoredResourceDescriptorRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.DeleteMetricDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetMonitoredResourceDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteMetricDescriptorRequest to JSON. + * Converts this GetMonitoredResourceDescriptorRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListTimeSeriesRequest. */ - interface IListTimeSeriesRequest { + /** Properties of a ListMetricDescriptorsRequest. */ + interface IListMetricDescriptorsRequest { - /** ListTimeSeriesRequest name */ + /** ListMetricDescriptorsRequest name */ name?: (string|null); - /** ListTimeSeriesRequest filter */ + /** ListMetricDescriptorsRequest filter */ filter?: (string|null); - /** ListTimeSeriesRequest interval */ - interval?: (google.monitoring.v3.ITimeInterval|null); - - /** ListTimeSeriesRequest aggregation */ - aggregation?: (google.monitoring.v3.IAggregation|null); - - /** ListTimeSeriesRequest orderBy */ - orderBy?: (string|null); - - /** ListTimeSeriesRequest view */ - view?: (google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|keyof typeof google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|null); - - /** ListTimeSeriesRequest pageSize */ + /** ListMetricDescriptorsRequest pageSize */ pageSize?: (number|null); - /** ListTimeSeriesRequest pageToken */ + /** ListMetricDescriptorsRequest pageToken */ pageToken?: (string|null); } - /** Represents a ListTimeSeriesRequest. */ - class ListTimeSeriesRequest implements IListTimeSeriesRequest { + /** Represents a ListMetricDescriptorsRequest. */ + class ListMetricDescriptorsRequest implements IListMetricDescriptorsRequest { /** - * Constructs a new ListTimeSeriesRequest. + * Constructs a new ListMetricDescriptorsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListTimeSeriesRequest); + constructor(properties?: google.monitoring.v3.IListMetricDescriptorsRequest); - /** ListTimeSeriesRequest name. */ + /** ListMetricDescriptorsRequest name. */ public name: string; - /** ListTimeSeriesRequest filter. */ + /** ListMetricDescriptorsRequest filter. */ public filter: string; - /** ListTimeSeriesRequest interval. */ - public interval?: (google.monitoring.v3.ITimeInterval|null); - - /** ListTimeSeriesRequest aggregation. */ - public aggregation?: (google.monitoring.v3.IAggregation|null); - - /** ListTimeSeriesRequest orderBy. */ - public orderBy: string; - - /** ListTimeSeriesRequest view. */ - public view: (google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|keyof typeof google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView); - - /** ListTimeSeriesRequest pageSize. */ + /** ListMetricDescriptorsRequest pageSize. */ public pageSize: number; - /** ListTimeSeriesRequest pageToken. */ + /** ListMetricDescriptorsRequest pageToken. */ public pageToken: string; /** - * Creates a new ListTimeSeriesRequest instance using the specified properties. + * Creates a new ListMetricDescriptorsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTimeSeriesRequest instance + * @returns ListMetricDescriptorsRequest instance */ - public static create(properties?: google.monitoring.v3.IListTimeSeriesRequest): google.monitoring.v3.ListTimeSeriesRequest; + public static create(properties?: google.monitoring.v3.IListMetricDescriptorsRequest): google.monitoring.v3.ListMetricDescriptorsRequest; /** - * Encodes the specified ListTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. - * @param message ListTimeSeriesRequest message or plain object to encode + * Encodes the specified ListMetricDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. + * @param message ListMetricDescriptorsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListMetricDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. - * @param message ListTimeSeriesRequest message or plain object to encode + * Encodes the specified ListMetricDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. + * @param message ListMetricDescriptorsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListMetricDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTimeSeriesRequest message from the specified reader or buffer. + * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTimeSeriesRequest + * @returns ListMetricDescriptorsRequest * @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.monitoring.v3.ListTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListMetricDescriptorsRequest; /** - * Decodes a ListTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTimeSeriesRequest + * @returns ListMetricDescriptorsRequest * @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.monitoring.v3.ListTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListMetricDescriptorsRequest; /** - * Verifies a ListTimeSeriesRequest message. + * Verifies a ListMetricDescriptorsRequest 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 ListTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMetricDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTimeSeriesRequest + * @returns ListMetricDescriptorsRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMetricDescriptorsRequest; /** - * Creates a plain object from a ListTimeSeriesRequest message. Also converts values to other types if specified. - * @param message ListTimeSeriesRequest + * Creates a plain object from a ListMetricDescriptorsRequest message. Also converts values to other types if specified. + * @param message ListMetricDescriptorsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListMetricDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTimeSeriesRequest to JSON. + * Converts this ListMetricDescriptorsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ListTimeSeriesRequest { - - /** TimeSeriesView enum. */ - enum TimeSeriesView { - FULL = 0, - HEADERS = 1 - } - } - - /** Properties of a ListTimeSeriesResponse. */ - interface IListTimeSeriesResponse { + /** Properties of a ListMetricDescriptorsResponse. */ + interface IListMetricDescriptorsResponse { - /** ListTimeSeriesResponse timeSeries */ - timeSeries?: (google.monitoring.v3.ITimeSeries[]|null); + /** ListMetricDescriptorsResponse metricDescriptors */ + metricDescriptors?: (google.api.IMetricDescriptor[]|null); - /** ListTimeSeriesResponse nextPageToken */ + /** ListMetricDescriptorsResponse nextPageToken */ nextPageToken?: (string|null); - - /** ListTimeSeriesResponse executionErrors */ - executionErrors?: (google.rpc.IStatus[]|null); } - /** Represents a ListTimeSeriesResponse. */ - class ListTimeSeriesResponse implements IListTimeSeriesResponse { + /** Represents a ListMetricDescriptorsResponse. */ + class ListMetricDescriptorsResponse implements IListMetricDescriptorsResponse { /** - * Constructs a new ListTimeSeriesResponse. + * Constructs a new ListMetricDescriptorsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListTimeSeriesResponse); + constructor(properties?: google.monitoring.v3.IListMetricDescriptorsResponse); - /** ListTimeSeriesResponse timeSeries. */ - public timeSeries: google.monitoring.v3.ITimeSeries[]; + /** ListMetricDescriptorsResponse metricDescriptors. */ + public metricDescriptors: google.api.IMetricDescriptor[]; - /** ListTimeSeriesResponse nextPageToken. */ + /** ListMetricDescriptorsResponse nextPageToken. */ public nextPageToken: string; - /** ListTimeSeriesResponse executionErrors. */ - public executionErrors: google.rpc.IStatus[]; - /** - * Creates a new ListTimeSeriesResponse instance using the specified properties. + * Creates a new ListMetricDescriptorsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListTimeSeriesResponse instance + * @returns ListMetricDescriptorsResponse instance */ - public static create(properties?: google.monitoring.v3.IListTimeSeriesResponse): google.monitoring.v3.ListTimeSeriesResponse; + public static create(properties?: google.monitoring.v3.IListMetricDescriptorsResponse): google.monitoring.v3.ListMetricDescriptorsResponse; /** - * Encodes the specified ListTimeSeriesResponse message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. - * @param message ListTimeSeriesResponse message or plain object to encode + * Encodes the specified ListMetricDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. + * @param message ListMetricDescriptorsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListMetricDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTimeSeriesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. - * @param message ListTimeSeriesResponse message or plain object to encode + * Encodes the specified ListMetricDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. + * @param message ListMetricDescriptorsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListMetricDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTimeSeriesResponse message from the specified reader or buffer. + * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTimeSeriesResponse + * @returns ListMetricDescriptorsResponse * @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.monitoring.v3.ListTimeSeriesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListMetricDescriptorsResponse; /** - * Decodes a ListTimeSeriesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTimeSeriesResponse + * @returns ListMetricDescriptorsResponse * @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.monitoring.v3.ListTimeSeriesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListMetricDescriptorsResponse; /** - * Verifies a ListTimeSeriesResponse message. + * Verifies a ListMetricDescriptorsResponse 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 ListTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListMetricDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTimeSeriesResponse + * @returns ListMetricDescriptorsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListTimeSeriesResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListMetricDescriptorsResponse; /** - * Creates a plain object from a ListTimeSeriesResponse message. Also converts values to other types if specified. - * @param message ListTimeSeriesResponse + * Creates a plain object from a ListMetricDescriptorsResponse message. Also converts values to other types if specified. + * @param message ListMetricDescriptorsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListTimeSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListMetricDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTimeSeriesResponse to JSON. + * Converts this ListMetricDescriptorsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateTimeSeriesRequest. */ - interface ICreateTimeSeriesRequest { + /** Properties of a GetMetricDescriptorRequest. */ + interface IGetMetricDescriptorRequest { - /** CreateTimeSeriesRequest name */ + /** GetMetricDescriptorRequest name */ name?: (string|null); - - /** CreateTimeSeriesRequest timeSeries */ - timeSeries?: (google.monitoring.v3.ITimeSeries[]|null); } - /** Represents a CreateTimeSeriesRequest. */ - class CreateTimeSeriesRequest implements ICreateTimeSeriesRequest { + /** Represents a GetMetricDescriptorRequest. */ + class GetMetricDescriptorRequest implements IGetMetricDescriptorRequest { /** - * Constructs a new CreateTimeSeriesRequest. + * Constructs a new GetMetricDescriptorRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ICreateTimeSeriesRequest); + constructor(properties?: google.monitoring.v3.IGetMetricDescriptorRequest); - /** CreateTimeSeriesRequest name. */ + /** GetMetricDescriptorRequest name. */ public name: string; - /** CreateTimeSeriesRequest timeSeries. */ - public timeSeries: google.monitoring.v3.ITimeSeries[]; - /** - * Creates a new CreateTimeSeriesRequest instance using the specified properties. + * Creates a new GetMetricDescriptorRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTimeSeriesRequest instance + * @returns GetMetricDescriptorRequest instance */ - public static create(properties?: google.monitoring.v3.ICreateTimeSeriesRequest): google.monitoring.v3.CreateTimeSeriesRequest; + public static create(properties?: google.monitoring.v3.IGetMetricDescriptorRequest): google.monitoring.v3.GetMetricDescriptorRequest; /** - * Encodes the specified CreateTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. - * @param message CreateTimeSeriesRequest message or plain object to encode + * Encodes the specified GetMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. + * @param message GetMetricDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ICreateTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. - * @param message CreateTimeSeriesRequest message or plain object to encode + * Encodes the specified GetMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. + * @param message GetMetricDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ICreateTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer. + * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTimeSeriesRequest + * @returns GetMetricDescriptorRequest * @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.monitoring.v3.CreateTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetMetricDescriptorRequest; /** - * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTimeSeriesRequest + * @returns GetMetricDescriptorRequest * @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.monitoring.v3.CreateTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetMetricDescriptorRequest; /** - * Verifies a CreateTimeSeriesRequest message. + * Verifies a GetMetricDescriptorRequest 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 CreateTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTimeSeriesRequest + * @returns GetMetricDescriptorRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetMetricDescriptorRequest; /** - * Creates a plain object from a CreateTimeSeriesRequest message. Also converts values to other types if specified. - * @param message CreateTimeSeriesRequest + * Creates a plain object from a GetMetricDescriptorRequest message. Also converts values to other types if specified. + * @param message GetMetricDescriptorRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.CreateTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetMetricDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTimeSeriesRequest to JSON. + * Converts this GetMetricDescriptorRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateTimeSeriesError. */ - interface ICreateTimeSeriesError { + /** Properties of a CreateMetricDescriptorRequest. */ + interface ICreateMetricDescriptorRequest { - /** CreateTimeSeriesError timeSeries */ - timeSeries?: (google.monitoring.v3.ITimeSeries|null); + /** CreateMetricDescriptorRequest name */ + name?: (string|null); - /** CreateTimeSeriesError status */ - status?: (google.rpc.IStatus|null); + /** CreateMetricDescriptorRequest metricDescriptor */ + metricDescriptor?: (google.api.IMetricDescriptor|null); } - /** Represents a CreateTimeSeriesError. */ - class CreateTimeSeriesError implements ICreateTimeSeriesError { + /** Represents a CreateMetricDescriptorRequest. */ + class CreateMetricDescriptorRequest implements ICreateMetricDescriptorRequest { /** - * Constructs a new CreateTimeSeriesError. + * Constructs a new CreateMetricDescriptorRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ICreateTimeSeriesError); + constructor(properties?: google.monitoring.v3.ICreateMetricDescriptorRequest); - /** CreateTimeSeriesError timeSeries. */ - public timeSeries?: (google.monitoring.v3.ITimeSeries|null); + /** CreateMetricDescriptorRequest name. */ + public name: string; - /** CreateTimeSeriesError status. */ - public status?: (google.rpc.IStatus|null); + /** CreateMetricDescriptorRequest metricDescriptor. */ + public metricDescriptor?: (google.api.IMetricDescriptor|null); /** - * Creates a new CreateTimeSeriesError instance using the specified properties. + * Creates a new CreateMetricDescriptorRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTimeSeriesError instance + * @returns CreateMetricDescriptorRequest instance */ - public static create(properties?: google.monitoring.v3.ICreateTimeSeriesError): google.monitoring.v3.CreateTimeSeriesError; + public static create(properties?: google.monitoring.v3.ICreateMetricDescriptorRequest): google.monitoring.v3.CreateMetricDescriptorRequest; /** - * Encodes the specified CreateTimeSeriesError message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. - * @param message CreateTimeSeriesError message or plain object to encode + * Encodes the specified CreateMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. + * @param message CreateMetricDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ICreateTimeSeriesError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ICreateMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTimeSeriesError message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. - * @param message CreateTimeSeriesError message or plain object to encode + * Encodes the specified CreateMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. + * @param message CreateMetricDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ICreateTimeSeriesError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ICreateMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTimeSeriesError message from the specified reader or buffer. + * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTimeSeriesError + * @returns CreateMetricDescriptorRequest * @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.monitoring.v3.CreateTimeSeriesError; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateMetricDescriptorRequest; /** - * Decodes a CreateTimeSeriesError message from the specified reader or buffer, length delimited. + * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTimeSeriesError + * @returns CreateMetricDescriptorRequest * @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.monitoring.v3.CreateTimeSeriesError; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateMetricDescriptorRequest; /** - * Verifies a CreateTimeSeriesError message. + * Verifies a CreateMetricDescriptorRequest 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 CreateTimeSeriesError message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTimeSeriesError + * @returns CreateMetricDescriptorRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesError; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateMetricDescriptorRequest; /** - * Creates a plain object from a CreateTimeSeriesError message. Also converts values to other types if specified. - * @param message CreateTimeSeriesError + * Creates a plain object from a CreateMetricDescriptorRequest message. Also converts values to other types if specified. + * @param message CreateMetricDescriptorRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.CreateTimeSeriesError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.CreateMetricDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTimeSeriesError to JSON. + * Converts this CreateMetricDescriptorRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateTimeSeriesSummary. */ - interface ICreateTimeSeriesSummary { - - /** CreateTimeSeriesSummary totalPointCount */ - totalPointCount?: (number|null); - - /** CreateTimeSeriesSummary successPointCount */ - successPointCount?: (number|null); + /** Properties of a DeleteMetricDescriptorRequest. */ + interface IDeleteMetricDescriptorRequest { - /** CreateTimeSeriesSummary errors */ - errors?: (google.monitoring.v3.CreateTimeSeriesSummary.IError[]|null); + /** DeleteMetricDescriptorRequest name */ + name?: (string|null); } - /** Represents a CreateTimeSeriesSummary. */ - class CreateTimeSeriesSummary implements ICreateTimeSeriesSummary { + /** Represents a DeleteMetricDescriptorRequest. */ + class DeleteMetricDescriptorRequest implements IDeleteMetricDescriptorRequest { /** - * Constructs a new CreateTimeSeriesSummary. + * Constructs a new DeleteMetricDescriptorRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ICreateTimeSeriesSummary); - - /** CreateTimeSeriesSummary totalPointCount. */ - public totalPointCount: number; - - /** CreateTimeSeriesSummary successPointCount. */ - public successPointCount: number; + constructor(properties?: google.monitoring.v3.IDeleteMetricDescriptorRequest); - /** CreateTimeSeriesSummary errors. */ - public errors: google.monitoring.v3.CreateTimeSeriesSummary.IError[]; + /** DeleteMetricDescriptorRequest name. */ + public name: string; /** - * Creates a new CreateTimeSeriesSummary instance using the specified properties. + * Creates a new DeleteMetricDescriptorRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTimeSeriesSummary instance + * @returns DeleteMetricDescriptorRequest instance */ - public static create(properties?: google.monitoring.v3.ICreateTimeSeriesSummary): google.monitoring.v3.CreateTimeSeriesSummary; + public static create(properties?: google.monitoring.v3.IDeleteMetricDescriptorRequest): google.monitoring.v3.DeleteMetricDescriptorRequest; /** - * Encodes the specified CreateTimeSeriesSummary message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. - * @param message CreateTimeSeriesSummary message or plain object to encode + * Encodes the specified DeleteMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. + * @param message DeleteMetricDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ICreateTimeSeriesSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IDeleteMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTimeSeriesSummary message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. - * @param message CreateTimeSeriesSummary message or plain object to encode + * Encodes the specified DeleteMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. + * @param message DeleteMetricDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ICreateTimeSeriesSummary, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IDeleteMetricDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer. + * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTimeSeriesSummary + * @returns DeleteMetricDescriptorRequest * @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.monitoring.v3.CreateTimeSeriesSummary; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteMetricDescriptorRequest; /** - * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer, length delimited. + * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTimeSeriesSummary + * @returns DeleteMetricDescriptorRequest * @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.monitoring.v3.CreateTimeSeriesSummary; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteMetricDescriptorRequest; /** - * Verifies a CreateTimeSeriesSummary message. + * Verifies a DeleteMetricDescriptorRequest 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 CreateTimeSeriesSummary message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTimeSeriesSummary + * @returns DeleteMetricDescriptorRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesSummary; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteMetricDescriptorRequest; /** - * Creates a plain object from a CreateTimeSeriesSummary message. Also converts values to other types if specified. - * @param message CreateTimeSeriesSummary + * Creates a plain object from a DeleteMetricDescriptorRequest message. Also converts values to other types if specified. + * @param message DeleteMetricDescriptorRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.CreateTimeSeriesSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.DeleteMetricDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTimeSeriesSummary to JSON. + * Converts this DeleteMetricDescriptorRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CreateTimeSeriesSummary { - - /** Properties of an Error. */ - interface IError { - - /** Error status */ - status?: (google.rpc.IStatus|null); - - /** Error pointCount */ - pointCount?: (number|null); - } - - /** Represents an Error. */ - class Error implements IError { - - /** - * Constructs a new Error. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.CreateTimeSeriesSummary.IError); + /** Properties of a ListTimeSeriesRequest. */ + interface IListTimeSeriesRequest { - /** Error status. */ - public status?: (google.rpc.IStatus|null); + /** ListTimeSeriesRequest name */ + name?: (string|null); - /** Error pointCount. */ - public pointCount: number; + /** ListTimeSeriesRequest filter */ + filter?: (string|null); - /** - * Creates a new Error instance using the specified properties. - * @param [properties] Properties to set - * @returns Error instance - */ - public static create(properties?: google.monitoring.v3.CreateTimeSeriesSummary.IError): google.monitoring.v3.CreateTimeSeriesSummary.Error; + /** ListTimeSeriesRequest interval */ + interval?: (google.monitoring.v3.ITimeInterval|null); - /** - * Encodes the specified Error message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. - * @param message Error message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.CreateTimeSeriesSummary.IError, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListTimeSeriesRequest aggregation */ + aggregation?: (google.monitoring.v3.IAggregation|null); - /** - * Encodes the specified Error message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. - * @param message Error message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.CreateTimeSeriesSummary.IError, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListTimeSeriesRequest orderBy */ + orderBy?: (string|null); - /** - * Decodes an Error message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Error - * @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.monitoring.v3.CreateTimeSeriesSummary.Error; + /** ListTimeSeriesRequest view */ + view?: (google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|keyof typeof google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|null); - /** - * Decodes an Error message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Error - * @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.monitoring.v3.CreateTimeSeriesSummary.Error; + /** ListTimeSeriesRequest pageSize */ + pageSize?: (number|null); - /** - * Verifies an Error 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); + /** ListTimeSeriesRequest pageToken */ + pageToken?: (string|null); + } - /** - * Creates an Error message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Error - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesSummary.Error; + /** Represents a ListTimeSeriesRequest. */ + class ListTimeSeriesRequest implements IListTimeSeriesRequest { - /** - * Creates a plain object from an Error message. Also converts values to other types if specified. - * @param message Error - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.CreateTimeSeriesSummary.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ListTimeSeriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListTimeSeriesRequest); - /** - * Converts this Error to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** ListTimeSeriesRequest name. */ + public name: string; - /** Properties of a Point. */ - interface IPoint { + /** ListTimeSeriesRequest filter. */ + public filter: string; - /** Point interval */ - interval?: (google.monitoring.v3.ITimeInterval|null); + /** ListTimeSeriesRequest interval. */ + public interval?: (google.monitoring.v3.ITimeInterval|null); - /** Point value */ - value?: (google.monitoring.v3.ITypedValue|null); - } + /** ListTimeSeriesRequest aggregation. */ + public aggregation?: (google.monitoring.v3.IAggregation|null); - /** Represents a Point. */ - class Point implements IPoint { + /** ListTimeSeriesRequest orderBy. */ + public orderBy: string; - /** - * Constructs a new Point. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IPoint); + /** ListTimeSeriesRequest view. */ + public view: (google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|keyof typeof google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView); - /** Point interval. */ - public interval?: (google.monitoring.v3.ITimeInterval|null); + /** ListTimeSeriesRequest pageSize. */ + public pageSize: number; - /** Point value. */ - public value?: (google.monitoring.v3.ITypedValue|null); + /** ListTimeSeriesRequest pageToken. */ + public pageToken: string; /** - * Creates a new Point instance using the specified properties. + * Creates a new ListTimeSeriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Point instance + * @returns ListTimeSeriesRequest instance */ - public static create(properties?: google.monitoring.v3.IPoint): google.monitoring.v3.Point; + public static create(properties?: google.monitoring.v3.IListTimeSeriesRequest): google.monitoring.v3.ListTimeSeriesRequest; /** - * Encodes the specified Point message. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. - * @param message Point message or plain object to encode + * Encodes the specified ListTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. + * @param message ListTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Point message, length delimited. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. - * @param message Point message or plain object to encode + * Encodes the specified ListTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. + * @param message ListTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Point message from the specified reader or buffer. + * Decodes a ListTimeSeriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Point + * @returns ListTimeSeriesRequest * @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.monitoring.v3.Point; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListTimeSeriesRequest; /** - * Decodes a Point message from the specified reader or buffer, length delimited. + * Decodes a ListTimeSeriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Point + * @returns ListTimeSeriesRequest * @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.monitoring.v3.Point; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListTimeSeriesRequest; /** - * Verifies a Point message. + * Verifies a ListTimeSeriesRequest 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 Point message from a plain object. Also converts values to their respective internal types. + * Creates a ListTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Point + * @returns ListTimeSeriesRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Point; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListTimeSeriesRequest; /** - * Creates a plain object from a Point message. Also converts values to other types if specified. - * @param message Point + * Creates a plain object from a ListTimeSeriesRequest message. Also converts values to other types if specified. + * @param message ListTimeSeriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Point to JSON. + * Converts this ListTimeSeriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeSeries. */ - interface ITimeSeries { - - /** TimeSeries metric */ - metric?: (google.api.IMetric|null); + namespace ListTimeSeriesRequest { - /** TimeSeries resource */ - resource?: (google.api.IMonitoredResource|null); + /** TimeSeriesView enum. */ + enum TimeSeriesView { + FULL = 0, + HEADERS = 1 + } + } - /** TimeSeries metadata */ - metadata?: (google.api.IMonitoredResourceMetadata|null); + /** Properties of a ListTimeSeriesResponse. */ + interface IListTimeSeriesResponse { - /** TimeSeries metricKind */ - metricKind?: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind|null); + /** ListTimeSeriesResponse timeSeries */ + timeSeries?: (google.monitoring.v3.ITimeSeries[]|null); - /** TimeSeries valueType */ - valueType?: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType|null); + /** ListTimeSeriesResponse nextPageToken */ + nextPageToken?: (string|null); - /** TimeSeries points */ - points?: (google.monitoring.v3.IPoint[]|null); + /** ListTimeSeriesResponse executionErrors */ + executionErrors?: (google.rpc.IStatus[]|null); } - /** Represents a TimeSeries. */ - class TimeSeries implements ITimeSeries { + /** Represents a ListTimeSeriesResponse. */ + class ListTimeSeriesResponse implements IListTimeSeriesResponse { /** - * Constructs a new TimeSeries. + * Constructs a new ListTimeSeriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ITimeSeries); - - /** TimeSeries metric. */ - public metric?: (google.api.IMetric|null); - - /** TimeSeries resource. */ - public resource?: (google.api.IMonitoredResource|null); - - /** TimeSeries metadata. */ - public metadata?: (google.api.IMonitoredResourceMetadata|null); + constructor(properties?: google.monitoring.v3.IListTimeSeriesResponse); - /** TimeSeries metricKind. */ - public metricKind: (google.api.MetricDescriptor.MetricKind|keyof typeof google.api.MetricDescriptor.MetricKind); + /** ListTimeSeriesResponse timeSeries. */ + public timeSeries: google.monitoring.v3.ITimeSeries[]; - /** TimeSeries valueType. */ - public valueType: (google.api.MetricDescriptor.ValueType|keyof typeof google.api.MetricDescriptor.ValueType); + /** ListTimeSeriesResponse nextPageToken. */ + public nextPageToken: string; - /** TimeSeries points. */ - public points: google.monitoring.v3.IPoint[]; + /** ListTimeSeriesResponse executionErrors. */ + public executionErrors: google.rpc.IStatus[]; /** - * Creates a new TimeSeries instance using the specified properties. + * Creates a new ListTimeSeriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TimeSeries instance + * @returns ListTimeSeriesResponse instance */ - public static create(properties?: google.monitoring.v3.ITimeSeries): google.monitoring.v3.TimeSeries; + public static create(properties?: google.monitoring.v3.IListTimeSeriesResponse): google.monitoring.v3.ListTimeSeriesResponse; /** - * Encodes the specified TimeSeries message. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. - * @param message TimeSeries message or plain object to encode + * Encodes the specified ListTimeSeriesResponse message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. + * @param message ListTimeSeriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ITimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeSeries message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. - * @param message TimeSeries message or plain object to encode + * Encodes the specified ListTimeSeriesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. + * @param message ListTimeSeriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ITimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeSeries message from the specified reader or buffer. + * Decodes a ListTimeSeriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeSeries + * @returns ListTimeSeriesResponse * @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.monitoring.v3.TimeSeries; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListTimeSeriesResponse; /** - * Decodes a TimeSeries message from the specified reader or buffer, length delimited. + * Decodes a ListTimeSeriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeSeries + * @returns ListTimeSeriesResponse * @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.monitoring.v3.TimeSeries; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListTimeSeriesResponse; /** - * Verifies a TimeSeries message. + * Verifies a ListTimeSeriesResponse 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 TimeSeries message from a plain object. Also converts values to their respective internal types. + * Creates a ListTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeSeries + * @returns ListTimeSeriesResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeSeries; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListTimeSeriesResponse; /** - * Creates a plain object from a TimeSeries message. Also converts values to other types if specified. - * @param message TimeSeries + * Creates a plain object from a ListTimeSeriesResponse message. Also converts values to other types if specified. + * @param message ListTimeSeriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.TimeSeries, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListTimeSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeSeries to JSON. + * Converts this ListTimeSeriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a NotificationChannelService */ - class NotificationChannelService extends $protobuf.rpc.Service { + /** Properties of a CreateTimeSeriesRequest. */ + interface ICreateTimeSeriesRequest { - /** - * Constructs a new NotificationChannelService 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); + /** CreateTimeSeriesRequest name */ + name?: (string|null); - /** - * Creates new NotificationChannelService 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): NotificationChannelService; + /** CreateTimeSeriesRequest timeSeries */ + timeSeries?: (google.monitoring.v3.ITimeSeries[]|null); + } + + /** Represents a CreateTimeSeriesRequest. */ + class CreateTimeSeriesRequest implements ICreateTimeSeriesRequest { /** - * Calls ListNotificationChannelDescriptors. - * @param request ListNotificationChannelDescriptorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListNotificationChannelDescriptorsResponse + * Constructs a new CreateTimeSeriesRequest. + * @param [properties] Properties to set */ - public listNotificationChannelDescriptors(request: google.monitoring.v3.IListNotificationChannelDescriptorsRequest, callback: google.monitoring.v3.NotificationChannelService.ListNotificationChannelDescriptorsCallback): void; + constructor(properties?: google.monitoring.v3.ICreateTimeSeriesRequest); + + /** CreateTimeSeriesRequest name. */ + public name: string; + + /** CreateTimeSeriesRequest timeSeries. */ + public timeSeries: google.monitoring.v3.ITimeSeries[]; /** - * Calls ListNotificationChannelDescriptors. - * @param request ListNotificationChannelDescriptorsRequest message or plain object - * @returns Promise + * Creates a new CreateTimeSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTimeSeriesRequest instance */ - public listNotificationChannelDescriptors(request: google.monitoring.v3.IListNotificationChannelDescriptorsRequest): Promise; + public static create(properties?: google.monitoring.v3.ICreateTimeSeriesRequest): google.monitoring.v3.CreateTimeSeriesRequest; /** - * Calls GetNotificationChannelDescriptor. - * @param request GetNotificationChannelDescriptorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and NotificationChannelDescriptor + * Encodes the specified CreateTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. + * @param message CreateTimeSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getNotificationChannelDescriptor(request: google.monitoring.v3.IGetNotificationChannelDescriptorRequest, callback: google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptorCallback): void; + public static encode(message: google.monitoring.v3.ICreateTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetNotificationChannelDescriptor. - * @param request GetNotificationChannelDescriptorRequest message or plain object - * @returns Promise + * Encodes the specified CreateTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. + * @param message CreateTimeSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getNotificationChannelDescriptor(request: google.monitoring.v3.IGetNotificationChannelDescriptorRequest): Promise; + public static encodeDelimited(message: google.monitoring.v3.ICreateTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListNotificationChannels. - * @param request ListNotificationChannelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListNotificationChannelsResponse + * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTimeSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listNotificationChannels(request: google.monitoring.v3.IListNotificationChannelsRequest, callback: google.monitoring.v3.NotificationChannelService.ListNotificationChannelsCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateTimeSeriesRequest; /** - * Calls ListNotificationChannels. - * @param request ListNotificationChannelsRequest message or plain object - * @returns Promise + * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTimeSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listNotificationChannels(request: google.monitoring.v3.IListNotificationChannelsRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateTimeSeriesRequest; /** - * Calls GetNotificationChannel. - * @param request GetNotificationChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and NotificationChannel + * Verifies a CreateTimeSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getNotificationChannel(request: google.monitoring.v3.IGetNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.GetNotificationChannelCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetNotificationChannel. - * @param request GetNotificationChannelRequest message or plain object - * @returns Promise + * Creates a CreateTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTimeSeriesRequest */ - public getNotificationChannel(request: google.monitoring.v3.IGetNotificationChannelRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesRequest; /** - * Calls CreateNotificationChannel. - * @param request CreateNotificationChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and NotificationChannel + * Creates a plain object from a CreateTimeSeriesRequest message. Also converts values to other types if specified. + * @param message CreateTimeSeriesRequest + * @param [options] Conversion options + * @returns Plain object */ - public createNotificationChannel(request: google.monitoring.v3.ICreateNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.CreateNotificationChannelCallback): void; + public static toObject(message: google.monitoring.v3.CreateTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls CreateNotificationChannel. - * @param request CreateNotificationChannelRequest message or plain object - * @returns Promise + * Converts this CreateTimeSeriesRequest to JSON. + * @returns JSON object */ - public createNotificationChannel(request: google.monitoring.v3.ICreateNotificationChannelRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateTimeSeriesError. */ + interface ICreateTimeSeriesError { + + /** CreateTimeSeriesError timeSeries */ + timeSeries?: (google.monitoring.v3.ITimeSeries|null); + + /** CreateTimeSeriesError status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a CreateTimeSeriesError. */ + class CreateTimeSeriesError implements ICreateTimeSeriesError { /** - * Calls UpdateNotificationChannel. - * @param request UpdateNotificationChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and NotificationChannel + * Constructs a new CreateTimeSeriesError. + * @param [properties] Properties to set */ - public updateNotificationChannel(request: google.monitoring.v3.IUpdateNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.UpdateNotificationChannelCallback): void; + constructor(properties?: google.monitoring.v3.ICreateTimeSeriesError); + + /** CreateTimeSeriesError timeSeries. */ + public timeSeries?: (google.monitoring.v3.ITimeSeries|null); + + /** CreateTimeSeriesError status. */ + public status?: (google.rpc.IStatus|null); /** - * Calls UpdateNotificationChannel. - * @param request UpdateNotificationChannelRequest message or plain object - * @returns Promise + * Creates a new CreateTimeSeriesError instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTimeSeriesError instance */ - public updateNotificationChannel(request: google.monitoring.v3.IUpdateNotificationChannelRequest): Promise; + public static create(properties?: google.monitoring.v3.ICreateTimeSeriesError): google.monitoring.v3.CreateTimeSeriesError; /** - * Calls DeleteNotificationChannel. - * @param request DeleteNotificationChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Encodes the specified CreateTimeSeriesError message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. + * @param message CreateTimeSeriesError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteNotificationChannel(request: google.monitoring.v3.IDeleteNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.DeleteNotificationChannelCallback): void; + public static encode(message: google.monitoring.v3.ICreateTimeSeriesError, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteNotificationChannel. - * @param request DeleteNotificationChannelRequest message or plain object - * @returns Promise + * Encodes the specified CreateTimeSeriesError message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. + * @param message CreateTimeSeriesError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteNotificationChannel(request: google.monitoring.v3.IDeleteNotificationChannelRequest): Promise; + public static encodeDelimited(message: google.monitoring.v3.ICreateTimeSeriesError, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SendNotificationChannelVerificationCode. - * @param request SendNotificationChannelVerificationCodeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Decodes a CreateTimeSeriesError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTimeSeriesError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public sendNotificationChannelVerificationCode(request: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, callback: google.monitoring.v3.NotificationChannelService.SendNotificationChannelVerificationCodeCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateTimeSeriesError; /** - * Calls SendNotificationChannelVerificationCode. - * @param request SendNotificationChannelVerificationCodeRequest message or plain object - * @returns Promise + * Decodes a CreateTimeSeriesError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTimeSeriesError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public sendNotificationChannelVerificationCode(request: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateTimeSeriesError; /** - * Calls GetNotificationChannelVerificationCode. - * @param request GetNotificationChannelVerificationCodeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetNotificationChannelVerificationCodeResponse + * Verifies a CreateTimeSeriesError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getNotificationChannelVerificationCode(request: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, callback: google.monitoring.v3.NotificationChannelService.GetNotificationChannelVerificationCodeCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetNotificationChannelVerificationCode. - * @param request GetNotificationChannelVerificationCodeRequest message or plain object - * @returns Promise + * Creates a CreateTimeSeriesError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTimeSeriesError */ - public getNotificationChannelVerificationCode(request: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesError; /** - * Calls VerifyNotificationChannel. - * @param request VerifyNotificationChannelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and NotificationChannel + * Creates a plain object from a CreateTimeSeriesError message. Also converts values to other types if specified. + * @param message CreateTimeSeriesError + * @param [options] Conversion options + * @returns Plain object */ - public verifyNotificationChannel(request: google.monitoring.v3.IVerifyNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.VerifyNotificationChannelCallback): void; + public static toObject(message: google.monitoring.v3.CreateTimeSeriesError, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls VerifyNotificationChannel. - * @param request VerifyNotificationChannelRequest message or plain object - * @returns Promise + * Converts this CreateTimeSeriesError to JSON. + * @returns JSON object */ - public verifyNotificationChannel(request: google.monitoring.v3.IVerifyNotificationChannelRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace NotificationChannelService { + /** Properties of a CreateTimeSeriesSummary. */ + interface ICreateTimeSeriesSummary { + + /** CreateTimeSeriesSummary totalPointCount */ + totalPointCount?: (number|null); + + /** CreateTimeSeriesSummary successPointCount */ + successPointCount?: (number|null); + + /** CreateTimeSeriesSummary errors */ + errors?: (google.monitoring.v3.CreateTimeSeriesSummary.IError[]|null); + } + + /** Represents a CreateTimeSeriesSummary. */ + class CreateTimeSeriesSummary implements ICreateTimeSeriesSummary { /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannelDescriptors}. - * @param error Error, if any - * @param [response] ListNotificationChannelDescriptorsResponse + * Constructs a new CreateTimeSeriesSummary. + * @param [properties] Properties to set */ - type ListNotificationChannelDescriptorsCallback = (error: (Error|null), response?: google.monitoring.v3.ListNotificationChannelDescriptorsResponse) => void; + constructor(properties?: google.monitoring.v3.ICreateTimeSeriesSummary); + + /** CreateTimeSeriesSummary totalPointCount. */ + public totalPointCount: number; + + /** CreateTimeSeriesSummary successPointCount. */ + public successPointCount: number; + + /** CreateTimeSeriesSummary errors. */ + public errors: google.monitoring.v3.CreateTimeSeriesSummary.IError[]; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelDescriptor}. - * @param error Error, if any - * @param [response] NotificationChannelDescriptor + * Creates a new CreateTimeSeriesSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTimeSeriesSummary instance */ - type GetNotificationChannelDescriptorCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannelDescriptor) => void; + public static create(properties?: google.monitoring.v3.ICreateTimeSeriesSummary): google.monitoring.v3.CreateTimeSeriesSummary; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannels}. - * @param error Error, if any - * @param [response] ListNotificationChannelsResponse + * Encodes the specified CreateTimeSeriesSummary message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. + * @param message CreateTimeSeriesSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListNotificationChannelsCallback = (error: (Error|null), response?: google.monitoring.v3.ListNotificationChannelsResponse) => void; + public static encode(message: google.monitoring.v3.ICreateTimeSeriesSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannel}. - * @param error Error, if any - * @param [response] NotificationChannel + * Encodes the specified CreateTimeSeriesSummary message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. + * @param message CreateTimeSeriesSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; + public static encodeDelimited(message: google.monitoring.v3.ICreateTimeSeriesSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#createNotificationChannel}. - * @param error Error, if any - * @param [response] NotificationChannel + * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTimeSeriesSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateTimeSeriesSummary; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#updateNotificationChannel}. - * @param error Error, if any - * @param [response] NotificationChannel + * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTimeSeriesSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateTimeSeriesSummary; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#deleteNotificationChannel}. - * @param error Error, if any - * @param [response] Empty + * Verifies a CreateTimeSeriesSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type DeleteNotificationChannelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#sendNotificationChannelVerificationCode}. - * @param error Error, if any - * @param [response] Empty + * Creates a CreateTimeSeriesSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTimeSeriesSummary */ - type SendNotificationChannelVerificationCodeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesSummary; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelVerificationCode}. - * @param error Error, if any - * @param [response] GetNotificationChannelVerificationCodeResponse + * Creates a plain object from a CreateTimeSeriesSummary message. Also converts values to other types if specified. + * @param message CreateTimeSeriesSummary + * @param [options] Conversion options + * @returns Plain object */ - type GetNotificationChannelVerificationCodeCallback = (error: (Error|null), response?: google.monitoring.v3.GetNotificationChannelVerificationCodeResponse) => void; + public static toObject(message: google.monitoring.v3.CreateTimeSeriesSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#verifyNotificationChannel}. - * @param error Error, if any - * @param [response] NotificationChannel + * Converts this CreateTimeSeriesSummary to JSON. + * @returns JSON object */ - type VerifyNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a ListNotificationChannelDescriptorsRequest. */ - interface IListNotificationChannelDescriptorsRequest { + namespace CreateTimeSeriesSummary { - /** ListNotificationChannelDescriptorsRequest name */ + /** Properties of an Error. */ + interface IError { + + /** Error status */ + status?: (google.rpc.IStatus|null); + + /** Error pointCount */ + pointCount?: (number|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.CreateTimeSeriesSummary.IError); + + /** Error status. */ + public status?: (google.rpc.IStatus|null); + + /** Error pointCount. */ + public pointCount: number; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.monitoring.v3.CreateTimeSeriesSummary.IError): google.monitoring.v3.CreateTimeSeriesSummary.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.CreateTimeSeriesSummary.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.CreateTimeSeriesSummary.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @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.monitoring.v3.CreateTimeSeriesSummary.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @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.monitoring.v3.CreateTimeSeriesSummary.Error; + + /** + * Verifies an Error 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 Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateTimeSeriesSummary.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.CreateTimeSeriesSummary.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a NotificationChannelDescriptor. */ + interface INotificationChannelDescriptor { + + /** NotificationChannelDescriptor name */ name?: (string|null); - /** ListNotificationChannelDescriptorsRequest pageSize */ - pageSize?: (number|null); + /** NotificationChannelDescriptor type */ + type?: (string|null); + + /** NotificationChannelDescriptor displayName */ + displayName?: (string|null); + + /** NotificationChannelDescriptor description */ + description?: (string|null); + + /** NotificationChannelDescriptor labels */ + labels?: (google.api.ILabelDescriptor[]|null); - /** ListNotificationChannelDescriptorsRequest pageToken */ - pageToken?: (string|null); + /** NotificationChannelDescriptor supportedTiers */ + supportedTiers?: (google.monitoring.v3.ServiceTier[]|null); + + /** NotificationChannelDescriptor launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); } - /** Represents a ListNotificationChannelDescriptorsRequest. */ - class ListNotificationChannelDescriptorsRequest implements IListNotificationChannelDescriptorsRequest { + /** Represents a NotificationChannelDescriptor. */ + class NotificationChannelDescriptor implements INotificationChannelDescriptor { /** - * Constructs a new ListNotificationChannelDescriptorsRequest. + * Constructs a new NotificationChannelDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsRequest); + constructor(properties?: google.monitoring.v3.INotificationChannelDescriptor); - /** ListNotificationChannelDescriptorsRequest name. */ + /** NotificationChannelDescriptor name. */ public name: string; - /** ListNotificationChannelDescriptorsRequest pageSize. */ - public pageSize: number; + /** NotificationChannelDescriptor type. */ + public type: string; - /** ListNotificationChannelDescriptorsRequest pageToken. */ - public pageToken: string; + /** NotificationChannelDescriptor displayName. */ + public displayName: string; + + /** NotificationChannelDescriptor description. */ + public description: string; + + /** NotificationChannelDescriptor labels. */ + public labels: google.api.ILabelDescriptor[]; + + /** NotificationChannelDescriptor supportedTiers. */ + public supportedTiers: google.monitoring.v3.ServiceTier[]; + + /** NotificationChannelDescriptor launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); /** - * Creates a new ListNotificationChannelDescriptorsRequest instance using the specified properties. + * Creates a new NotificationChannelDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns ListNotificationChannelDescriptorsRequest instance + * @returns NotificationChannelDescriptor instance */ - public static create(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsRequest): google.monitoring.v3.ListNotificationChannelDescriptorsRequest; + public static create(properties?: google.monitoring.v3.INotificationChannelDescriptor): google.monitoring.v3.NotificationChannelDescriptor; /** - * Encodes the specified ListNotificationChannelDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. - * @param message ListNotificationChannelDescriptorsRequest message or plain object to encode + * Encodes the specified NotificationChannelDescriptor message. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. + * @param message NotificationChannelDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListNotificationChannelDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.INotificationChannelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListNotificationChannelDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. - * @param message ListNotificationChannelDescriptorsRequest message or plain object to encode + * Encodes the specified NotificationChannelDescriptor message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. + * @param message NotificationChannelDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.INotificationChannelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer. + * Decodes a NotificationChannelDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListNotificationChannelDescriptorsRequest + * @returns NotificationChannelDescriptor * @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.monitoring.v3.ListNotificationChannelDescriptorsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.NotificationChannelDescriptor; /** - * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer, length delimited. + * Decodes a NotificationChannelDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListNotificationChannelDescriptorsRequest + * @returns NotificationChannelDescriptor * @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.monitoring.v3.ListNotificationChannelDescriptorsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.NotificationChannelDescriptor; /** - * Verifies a ListNotificationChannelDescriptorsRequest message. + * Verifies a NotificationChannelDescriptor 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 ListNotificationChannelDescriptorsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationChannelDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListNotificationChannelDescriptorsRequest + * @returns NotificationChannelDescriptor */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelDescriptorsRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.NotificationChannelDescriptor; /** - * Creates a plain object from a ListNotificationChannelDescriptorsRequest message. Also converts values to other types if specified. - * @param message ListNotificationChannelDescriptorsRequest + * Creates a plain object from a NotificationChannelDescriptor message. Also converts values to other types if specified. + * @param message NotificationChannelDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListNotificationChannelDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.NotificationChannelDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListNotificationChannelDescriptorsRequest to JSON. + * Converts this NotificationChannelDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListNotificationChannelDescriptorsResponse. */ - interface IListNotificationChannelDescriptorsResponse { - - /** ListNotificationChannelDescriptorsResponse channelDescriptors */ - channelDescriptors?: (google.monitoring.v3.INotificationChannelDescriptor[]|null); - - /** ListNotificationChannelDescriptorsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** Properties of a NotificationChannel. */ + interface INotificationChannel { - /** Represents a ListNotificationChannelDescriptorsResponse. */ - class ListNotificationChannelDescriptorsResponse implements IListNotificationChannelDescriptorsResponse { + /** NotificationChannel type */ + type?: (string|null); - /** - * Constructs a new ListNotificationChannelDescriptorsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsResponse); + /** NotificationChannel name */ + name?: (string|null); - /** ListNotificationChannelDescriptorsResponse channelDescriptors. */ - public channelDescriptors: google.monitoring.v3.INotificationChannelDescriptor[]; + /** NotificationChannel displayName */ + displayName?: (string|null); - /** ListNotificationChannelDescriptorsResponse nextPageToken. */ - public nextPageToken: string; + /** NotificationChannel description */ + description?: (string|null); - /** - * Creates a new ListNotificationChannelDescriptorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListNotificationChannelDescriptorsResponse instance - */ - public static create(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsResponse): google.monitoring.v3.ListNotificationChannelDescriptorsResponse; + /** NotificationChannel labels */ + labels?: ({ [k: string]: string }|null); - /** - * Encodes the specified ListNotificationChannelDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. - * @param message ListNotificationChannelDescriptorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListNotificationChannelDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** NotificationChannel userLabels */ + userLabels?: ({ [k: string]: string }|null); - /** - * Encodes the specified ListNotificationChannelDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. - * @param message ListNotificationChannelDescriptorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** NotificationChannel verificationStatus */ + verificationStatus?: (google.monitoring.v3.NotificationChannel.VerificationStatus|keyof typeof google.monitoring.v3.NotificationChannel.VerificationStatus|null); - /** - * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListNotificationChannelDescriptorsResponse - * @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.monitoring.v3.ListNotificationChannelDescriptorsResponse; + /** NotificationChannel enabled */ + enabled?: (google.protobuf.IBoolValue|null); + } - /** - * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListNotificationChannelDescriptorsResponse - * @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.monitoring.v3.ListNotificationChannelDescriptorsResponse; + /** Represents a NotificationChannel. */ + class NotificationChannel implements INotificationChannel { /** - * Verifies a ListNotificationChannelDescriptorsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Constructs a new NotificationChannel. + * @param [properties] Properties to set */ - public static verify(message: { [k: string]: any }): (string|null); + constructor(properties?: google.monitoring.v3.INotificationChannel); - /** - * Creates a ListNotificationChannelDescriptorsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListNotificationChannelDescriptorsResponse - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelDescriptorsResponse; + /** NotificationChannel type. */ + public type: string; - /** - * Creates a plain object from a ListNotificationChannelDescriptorsResponse message. Also converts values to other types if specified. - * @param message ListNotificationChannelDescriptorsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListNotificationChannelDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** NotificationChannel name. */ + public name: string; - /** - * Converts this ListNotificationChannelDescriptorsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** NotificationChannel displayName. */ + public displayName: string; - /** Properties of a GetNotificationChannelDescriptorRequest. */ - interface IGetNotificationChannelDescriptorRequest { + /** NotificationChannel description. */ + public description: string; - /** GetNotificationChannelDescriptorRequest name */ - name?: (string|null); - } + /** NotificationChannel labels. */ + public labels: { [k: string]: string }; - /** Represents a GetNotificationChannelDescriptorRequest. */ - class GetNotificationChannelDescriptorRequest implements IGetNotificationChannelDescriptorRequest { + /** NotificationChannel userLabels. */ + public userLabels: { [k: string]: string }; - /** - * Constructs a new GetNotificationChannelDescriptorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IGetNotificationChannelDescriptorRequest); + /** NotificationChannel verificationStatus. */ + public verificationStatus: (google.monitoring.v3.NotificationChannel.VerificationStatus|keyof typeof google.monitoring.v3.NotificationChannel.VerificationStatus); - /** GetNotificationChannelDescriptorRequest name. */ - public name: string; + /** NotificationChannel enabled. */ + public enabled?: (google.protobuf.IBoolValue|null); /** - * Creates a new GetNotificationChannelDescriptorRequest instance using the specified properties. + * Creates a new NotificationChannel instance using the specified properties. * @param [properties] Properties to set - * @returns GetNotificationChannelDescriptorRequest instance + * @returns NotificationChannel instance */ - public static create(properties?: google.monitoring.v3.IGetNotificationChannelDescriptorRequest): google.monitoring.v3.GetNotificationChannelDescriptorRequest; + public static create(properties?: google.monitoring.v3.INotificationChannel): google.monitoring.v3.NotificationChannel; /** - * Encodes the specified GetNotificationChannelDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. - * @param message GetNotificationChannelDescriptorRequest message or plain object to encode + * Encodes the specified NotificationChannel message. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. + * @param message NotificationChannel message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetNotificationChannelDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.INotificationChannel, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetNotificationChannelDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. - * @param message GetNotificationChannelDescriptorRequest message or plain object to encode + * Encodes the specified NotificationChannel message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. + * @param message NotificationChannel message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.INotificationChannel, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer. + * Decodes a NotificationChannel message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetNotificationChannelDescriptorRequest + * @returns NotificationChannel * @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.monitoring.v3.GetNotificationChannelDescriptorRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.NotificationChannel; /** - * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a NotificationChannel message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetNotificationChannelDescriptorRequest + * @returns NotificationChannel * @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.monitoring.v3.GetNotificationChannelDescriptorRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.NotificationChannel; /** - * Verifies a GetNotificationChannelDescriptorRequest message. + * Verifies a NotificationChannel 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 GetNotificationChannelDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationChannel message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetNotificationChannelDescriptorRequest + * @returns NotificationChannel */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelDescriptorRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.NotificationChannel; /** - * Creates a plain object from a GetNotificationChannelDescriptorRequest message. Also converts values to other types if specified. - * @param message GetNotificationChannelDescriptorRequest + * Creates a plain object from a NotificationChannel message. Also converts values to other types if specified. + * @param message NotificationChannel * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetNotificationChannelDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.NotificationChannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetNotificationChannelDescriptorRequest to JSON. + * Converts this NotificationChannel to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateNotificationChannelRequest. */ - interface ICreateNotificationChannelRequest { - - /** CreateNotificationChannelRequest name */ - name?: (string|null); + namespace NotificationChannel { - /** CreateNotificationChannelRequest notificationChannel */ - notificationChannel?: (google.monitoring.v3.INotificationChannel|null); + /** VerificationStatus enum. */ + enum VerificationStatus { + VERIFICATION_STATUS_UNSPECIFIED = 0, + UNVERIFIED = 1, + VERIFIED = 2 + } } - /** Represents a CreateNotificationChannelRequest. */ - class CreateNotificationChannelRequest implements ICreateNotificationChannelRequest { + /** Represents a NotificationChannelService */ + class NotificationChannelService extends $protobuf.rpc.Service { /** - * Constructs a new CreateNotificationChannelRequest. - * @param [properties] Properties to set + * Constructs a new NotificationChannelService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.monitoring.v3.ICreateNotificationChannelRequest); - - /** CreateNotificationChannelRequest name. */ - public name: string; - - /** CreateNotificationChannelRequest notificationChannel. */ - public notificationChannel?: (google.monitoring.v3.INotificationChannel|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new CreateNotificationChannelRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateNotificationChannelRequest instance + * Creates new NotificationChannelService 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(properties?: google.monitoring.v3.ICreateNotificationChannelRequest): google.monitoring.v3.CreateNotificationChannelRequest; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): NotificationChannelService; /** - * Encodes the specified CreateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. - * @param message CreateNotificationChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListNotificationChannelDescriptors. + * @param request ListNotificationChannelDescriptorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNotificationChannelDescriptorsResponse */ - public static encode(message: google.monitoring.v3.ICreateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listNotificationChannelDescriptors(request: google.monitoring.v3.IListNotificationChannelDescriptorsRequest, callback: google.monitoring.v3.NotificationChannelService.ListNotificationChannelDescriptorsCallback): void; /** - * Encodes the specified CreateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. - * @param message CreateNotificationChannelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListNotificationChannelDescriptors. + * @param request ListNotificationChannelDescriptorsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.monitoring.v3.ICreateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listNotificationChannelDescriptors(request: google.monitoring.v3.IListNotificationChannelDescriptorsRequest): Promise; /** - * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateNotificationChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetNotificationChannelDescriptor. + * @param request GetNotificationChannelDescriptorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationChannelDescriptor */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateNotificationChannelRequest; + public getNotificationChannelDescriptor(request: google.monitoring.v3.IGetNotificationChannelDescriptorRequest, callback: google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptorCallback): void; /** - * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateNotificationChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetNotificationChannelDescriptor. + * @param request GetNotificationChannelDescriptorRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateNotificationChannelRequest; + public getNotificationChannelDescriptor(request: google.monitoring.v3.IGetNotificationChannelDescriptorRequest): Promise; /** - * Verifies a CreateNotificationChannelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListNotificationChannels. + * @param request ListNotificationChannelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNotificationChannelsResponse */ - public static verify(message: { [k: string]: any }): (string|null); + public listNotificationChannels(request: google.monitoring.v3.IListNotificationChannelsRequest, callback: google.monitoring.v3.NotificationChannelService.ListNotificationChannelsCallback): void; /** - * Creates a CreateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateNotificationChannelRequest + * Calls ListNotificationChannels. + * @param request ListNotificationChannelsRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateNotificationChannelRequest; + public listNotificationChannels(request: google.monitoring.v3.IListNotificationChannelsRequest): Promise; /** - * Creates a plain object from a CreateNotificationChannelRequest message. Also converts values to other types if specified. - * @param message CreateNotificationChannelRequest - * @param [options] Conversion options - * @returns Plain object + * Calls GetNotificationChannel. + * @param request GetNotificationChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationChannel */ - public static toObject(message: google.monitoring.v3.CreateNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getNotificationChannel(request: google.monitoring.v3.IGetNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.GetNotificationChannelCallback): void; /** - * Converts this CreateNotificationChannelRequest to JSON. - * @returns JSON object + * Calls GetNotificationChannel. + * @param request GetNotificationChannelRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } + public getNotificationChannel(request: google.monitoring.v3.IGetNotificationChannelRequest): Promise; - /** Properties of a ListNotificationChannelsRequest. */ - interface IListNotificationChannelsRequest { + /** + * Calls CreateNotificationChannel. + * @param request CreateNotificationChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationChannel + */ + public createNotificationChannel(request: google.monitoring.v3.ICreateNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.CreateNotificationChannelCallback): void; - /** ListNotificationChannelsRequest name */ - name?: (string|null); + /** + * Calls CreateNotificationChannel. + * @param request CreateNotificationChannelRequest message or plain object + * @returns Promise + */ + public createNotificationChannel(request: google.monitoring.v3.ICreateNotificationChannelRequest): Promise; - /** ListNotificationChannelsRequest filter */ - filter?: (string|null); + /** + * Calls UpdateNotificationChannel. + * @param request UpdateNotificationChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationChannel + */ + public updateNotificationChannel(request: google.monitoring.v3.IUpdateNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.UpdateNotificationChannelCallback): void; - /** ListNotificationChannelsRequest orderBy */ - orderBy?: (string|null); + /** + * Calls UpdateNotificationChannel. + * @param request UpdateNotificationChannelRequest message or plain object + * @returns Promise + */ + public updateNotificationChannel(request: google.monitoring.v3.IUpdateNotificationChannelRequest): Promise; - /** ListNotificationChannelsRequest pageSize */ - pageSize?: (number|null); + /** + * Calls DeleteNotificationChannel. + * @param request DeleteNotificationChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteNotificationChannel(request: google.monitoring.v3.IDeleteNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.DeleteNotificationChannelCallback): void; - /** ListNotificationChannelsRequest pageToken */ - pageToken?: (string|null); - } + /** + * Calls DeleteNotificationChannel. + * @param request DeleteNotificationChannelRequest message or plain object + * @returns Promise + */ + public deleteNotificationChannel(request: google.monitoring.v3.IDeleteNotificationChannelRequest): Promise; - /** Represents a ListNotificationChannelsRequest. */ - class ListNotificationChannelsRequest implements IListNotificationChannelsRequest { + /** + * Calls SendNotificationChannelVerificationCode. + * @param request SendNotificationChannelVerificationCodeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public sendNotificationChannelVerificationCode(request: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, callback: google.monitoring.v3.NotificationChannelService.SendNotificationChannelVerificationCodeCallback): void; /** - * Constructs a new ListNotificationChannelsRequest. - * @param [properties] Properties to set + * Calls SendNotificationChannelVerificationCode. + * @param request SendNotificationChannelVerificationCodeRequest message or plain object + * @returns Promise */ - constructor(properties?: google.monitoring.v3.IListNotificationChannelsRequest); + public sendNotificationChannelVerificationCode(request: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest): Promise; - /** ListNotificationChannelsRequest name. */ - public name: string; + /** + * Calls GetNotificationChannelVerificationCode. + * @param request GetNotificationChannelVerificationCodeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetNotificationChannelVerificationCodeResponse + */ + public getNotificationChannelVerificationCode(request: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, callback: google.monitoring.v3.NotificationChannelService.GetNotificationChannelVerificationCodeCallback): void; - /** ListNotificationChannelsRequest filter. */ - public filter: string; + /** + * Calls GetNotificationChannelVerificationCode. + * @param request GetNotificationChannelVerificationCodeRequest message or plain object + * @returns Promise + */ + public getNotificationChannelVerificationCode(request: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest): Promise; - /** ListNotificationChannelsRequest orderBy. */ - public orderBy: string; + /** + * Calls VerifyNotificationChannel. + * @param request VerifyNotificationChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationChannel + */ + public verifyNotificationChannel(request: google.monitoring.v3.IVerifyNotificationChannelRequest, callback: google.monitoring.v3.NotificationChannelService.VerifyNotificationChannelCallback): void; - /** ListNotificationChannelsRequest pageSize. */ - public pageSize: number; + /** + * Calls VerifyNotificationChannel. + * @param request VerifyNotificationChannelRequest message or plain object + * @returns Promise + */ + public verifyNotificationChannel(request: google.monitoring.v3.IVerifyNotificationChannelRequest): Promise; + } - /** ListNotificationChannelsRequest pageToken. */ - public pageToken: string; + namespace NotificationChannelService { /** - * Creates a new ListNotificationChannelsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListNotificationChannelsRequest instance + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannelDescriptors}. + * @param error Error, if any + * @param [response] ListNotificationChannelDescriptorsResponse */ - public static create(properties?: google.monitoring.v3.IListNotificationChannelsRequest): google.monitoring.v3.ListNotificationChannelsRequest; + type ListNotificationChannelDescriptorsCallback = (error: (Error|null), response?: google.monitoring.v3.ListNotificationChannelDescriptorsResponse) => void; /** - * Encodes the specified ListNotificationChannelsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. - * @param message ListNotificationChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelDescriptor}. + * @param error Error, if any + * @param [response] NotificationChannelDescriptor */ - public static encode(message: google.monitoring.v3.IListNotificationChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type GetNotificationChannelDescriptorCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannelDescriptor) => void; /** - * Encodes the specified ListNotificationChannelsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. - * @param message ListNotificationChannelsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannels}. + * @param error Error, if any + * @param [response] ListNotificationChannelsResponse */ - public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type ListNotificationChannelsCallback = (error: (Error|null), response?: google.monitoring.v3.ListNotificationChannelsResponse) => void; /** - * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListNotificationChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannel}. + * @param error Error, if any + * @param [response] NotificationChannel + */ + type GetNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; + + /** + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#createNotificationChannel}. + * @param error Error, if any + * @param [response] NotificationChannel */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListNotificationChannelsRequest; + type CreateNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; /** - * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListNotificationChannelsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#updateNotificationChannel}. + * @param error Error, if any + * @param [response] NotificationChannel */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListNotificationChannelsRequest; + type UpdateNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; /** - * Verifies a ListNotificationChannelsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#deleteNotificationChannel}. + * @param error Error, if any + * @param [response] Empty */ - public static verify(message: { [k: string]: any }): (string|null); + type DeleteNotificationChannelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Creates a ListNotificationChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListNotificationChannelsRequest + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#sendNotificationChannelVerificationCode}. + * @param error Error, if any + * @param [response] Empty */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelsRequest; + type SendNotificationChannelVerificationCodeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Creates a plain object from a ListNotificationChannelsRequest message. Also converts values to other types if specified. - * @param message ListNotificationChannelsRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelVerificationCode}. + * @param error Error, if any + * @param [response] GetNotificationChannelVerificationCodeResponse */ - public static toObject(message: google.monitoring.v3.ListNotificationChannelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type GetNotificationChannelVerificationCodeCallback = (error: (Error|null), response?: google.monitoring.v3.GetNotificationChannelVerificationCodeResponse) => void; /** - * Converts this ListNotificationChannelsRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#verifyNotificationChannel}. + * @param error Error, if any + * @param [response] NotificationChannel */ - public toJSON(): { [k: string]: any }; + type VerifyNotificationChannelCallback = (error: (Error|null), response?: google.monitoring.v3.NotificationChannel) => void; } - /** Properties of a ListNotificationChannelsResponse. */ - interface IListNotificationChannelsResponse { + /** Properties of a ListNotificationChannelDescriptorsRequest. */ + interface IListNotificationChannelDescriptorsRequest { - /** ListNotificationChannelsResponse notificationChannels */ - notificationChannels?: (google.monitoring.v3.INotificationChannel[]|null); + /** ListNotificationChannelDescriptorsRequest name */ + name?: (string|null); - /** ListNotificationChannelsResponse nextPageToken */ - nextPageToken?: (string|null); + /** ListNotificationChannelDescriptorsRequest pageSize */ + pageSize?: (number|null); + + /** ListNotificationChannelDescriptorsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a ListNotificationChannelsResponse. */ - class ListNotificationChannelsResponse implements IListNotificationChannelsResponse { + /** Represents a ListNotificationChannelDescriptorsRequest. */ + class ListNotificationChannelDescriptorsRequest implements IListNotificationChannelDescriptorsRequest { /** - * Constructs a new ListNotificationChannelsResponse. + * Constructs a new ListNotificationChannelDescriptorsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListNotificationChannelsResponse); + constructor(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsRequest); - /** ListNotificationChannelsResponse notificationChannels. */ - public notificationChannels: google.monitoring.v3.INotificationChannel[]; + /** ListNotificationChannelDescriptorsRequest name. */ + public name: string; - /** ListNotificationChannelsResponse nextPageToken. */ - public nextPageToken: string; + /** ListNotificationChannelDescriptorsRequest pageSize. */ + public pageSize: number; + + /** ListNotificationChannelDescriptorsRequest pageToken. */ + public pageToken: string; /** - * Creates a new ListNotificationChannelsResponse instance using the specified properties. + * Creates a new ListNotificationChannelDescriptorsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListNotificationChannelsResponse instance + * @returns ListNotificationChannelDescriptorsRequest instance */ - public static create(properties?: google.monitoring.v3.IListNotificationChannelsResponse): google.monitoring.v3.ListNotificationChannelsResponse; + public static create(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsRequest): google.monitoring.v3.ListNotificationChannelDescriptorsRequest; /** - * Encodes the specified ListNotificationChannelsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. - * @param message ListNotificationChannelsResponse message or plain object to encode + * Encodes the specified ListNotificationChannelDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. + * @param message ListNotificationChannelDescriptorsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListNotificationChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListNotificationChannelDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListNotificationChannelsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. - * @param message ListNotificationChannelsResponse message or plain object to encode + * Encodes the specified ListNotificationChannelDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. + * @param message ListNotificationChannelDescriptorsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelDescriptorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer. + * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListNotificationChannelsResponse + * @returns ListNotificationChannelDescriptorsRequest * @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.monitoring.v3.ListNotificationChannelsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListNotificationChannelDescriptorsRequest; /** - * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListNotificationChannelsResponse + * @returns ListNotificationChannelDescriptorsRequest * @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.monitoring.v3.ListNotificationChannelsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListNotificationChannelDescriptorsRequest; /** - * Verifies a ListNotificationChannelsResponse message. + * Verifies a ListNotificationChannelDescriptorsRequest 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 ListNotificationChannelsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListNotificationChannelsResponse + * @returns ListNotificationChannelDescriptorsRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelsResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelDescriptorsRequest; /** - * Creates a plain object from a ListNotificationChannelsResponse message. Also converts values to other types if specified. - * @param message ListNotificationChannelsResponse + * Creates a plain object from a ListNotificationChannelDescriptorsRequest message. Also converts values to other types if specified. + * @param message ListNotificationChannelDescriptorsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListNotificationChannelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListNotificationChannelDescriptorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListNotificationChannelsResponse to JSON. + * Converts this ListNotificationChannelDescriptorsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetNotificationChannelRequest. */ - interface IGetNotificationChannelRequest { + /** Properties of a ListNotificationChannelDescriptorsResponse. */ + interface IListNotificationChannelDescriptorsResponse { - /** GetNotificationChannelRequest name */ - name?: (string|null); + /** ListNotificationChannelDescriptorsResponse channelDescriptors */ + channelDescriptors?: (google.monitoring.v3.INotificationChannelDescriptor[]|null); + + /** ListNotificationChannelDescriptorsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetNotificationChannelRequest. */ - class GetNotificationChannelRequest implements IGetNotificationChannelRequest { + /** Represents a ListNotificationChannelDescriptorsResponse. */ + class ListNotificationChannelDescriptorsResponse implements IListNotificationChannelDescriptorsResponse { /** - * Constructs a new GetNotificationChannelRequest. + * Constructs a new ListNotificationChannelDescriptorsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetNotificationChannelRequest); + constructor(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsResponse); - /** GetNotificationChannelRequest name. */ - public name: string; + /** ListNotificationChannelDescriptorsResponse channelDescriptors. */ + public channelDescriptors: google.monitoring.v3.INotificationChannelDescriptor[]; + + /** ListNotificationChannelDescriptorsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetNotificationChannelRequest instance using the specified properties. + * Creates a new ListNotificationChannelDescriptorsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetNotificationChannelRequest instance + * @returns ListNotificationChannelDescriptorsResponse instance */ - public static create(properties?: google.monitoring.v3.IGetNotificationChannelRequest): google.monitoring.v3.GetNotificationChannelRequest; + public static create(properties?: google.monitoring.v3.IListNotificationChannelDescriptorsResponse): google.monitoring.v3.ListNotificationChannelDescriptorsResponse; /** - * Encodes the specified GetNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. - * @param message GetNotificationChannelRequest message or plain object to encode + * Encodes the specified ListNotificationChannelDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. + * @param message ListNotificationChannelDescriptorsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListNotificationChannelDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. - * @param message GetNotificationChannelRequest message or plain object to encode + * Encodes the specified ListNotificationChannelDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. + * @param message ListNotificationChannelDescriptorsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelDescriptorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetNotificationChannelRequest message from the specified reader or buffer. + * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetNotificationChannelRequest + * @returns ListNotificationChannelDescriptorsResponse * @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.monitoring.v3.GetNotificationChannelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListNotificationChannelDescriptorsResponse; /** - * Decodes a GetNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetNotificationChannelRequest + * @returns ListNotificationChannelDescriptorsResponse * @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.monitoring.v3.GetNotificationChannelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListNotificationChannelDescriptorsResponse; /** - * Verifies a GetNotificationChannelRequest message. + * Verifies a ListNotificationChannelDescriptorsResponse 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 GetNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetNotificationChannelRequest + * @returns ListNotificationChannelDescriptorsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelDescriptorsResponse; /** - * Creates a plain object from a GetNotificationChannelRequest message. Also converts values to other types if specified. - * @param message GetNotificationChannelRequest + * Creates a plain object from a ListNotificationChannelDescriptorsResponse message. Also converts values to other types if specified. + * @param message ListNotificationChannelDescriptorsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListNotificationChannelDescriptorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetNotificationChannelRequest to JSON. + * Converts this ListNotificationChannelDescriptorsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateNotificationChannelRequest. */ - interface IUpdateNotificationChannelRequest { - - /** UpdateNotificationChannelRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a GetNotificationChannelDescriptorRequest. */ + interface IGetNotificationChannelDescriptorRequest { - /** UpdateNotificationChannelRequest notificationChannel */ - notificationChannel?: (google.monitoring.v3.INotificationChannel|null); + /** GetNotificationChannelDescriptorRequest name */ + name?: (string|null); } - /** Represents an UpdateNotificationChannelRequest. */ - class UpdateNotificationChannelRequest implements IUpdateNotificationChannelRequest { + /** Represents a GetNotificationChannelDescriptorRequest. */ + class GetNotificationChannelDescriptorRequest implements IGetNotificationChannelDescriptorRequest { /** - * Constructs a new UpdateNotificationChannelRequest. + * Constructs a new GetNotificationChannelDescriptorRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IUpdateNotificationChannelRequest); - - /** UpdateNotificationChannelRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.monitoring.v3.IGetNotificationChannelDescriptorRequest); - /** UpdateNotificationChannelRequest notificationChannel. */ - public notificationChannel?: (google.monitoring.v3.INotificationChannel|null); + /** GetNotificationChannelDescriptorRequest name. */ + public name: string; /** - * Creates a new UpdateNotificationChannelRequest instance using the specified properties. + * Creates a new GetNotificationChannelDescriptorRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateNotificationChannelRequest instance + * @returns GetNotificationChannelDescriptorRequest instance */ - public static create(properties?: google.monitoring.v3.IUpdateNotificationChannelRequest): google.monitoring.v3.UpdateNotificationChannelRequest; + public static create(properties?: google.monitoring.v3.IGetNotificationChannelDescriptorRequest): google.monitoring.v3.GetNotificationChannelDescriptorRequest; /** - * Encodes the specified UpdateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. - * @param message UpdateNotificationChannelRequest message or plain object to encode + * Encodes the specified GetNotificationChannelDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. + * @param message GetNotificationChannelDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IUpdateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetNotificationChannelDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. - * @param message UpdateNotificationChannelRequest message or plain object to encode + * Encodes the specified GetNotificationChannelDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. + * @param message GetNotificationChannelDescriptorRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IUpdateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelDescriptorRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer. + * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateNotificationChannelRequest + * @returns GetNotificationChannelDescriptorRequest * @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.monitoring.v3.UpdateNotificationChannelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetNotificationChannelDescriptorRequest; /** - * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateNotificationChannelRequest + * @returns GetNotificationChannelDescriptorRequest * @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.monitoring.v3.UpdateNotificationChannelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetNotificationChannelDescriptorRequest; /** - * Verifies an UpdateNotificationChannelRequest message. + * Verifies a GetNotificationChannelDescriptorRequest 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 UpdateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationChannelDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateNotificationChannelRequest + * @returns GetNotificationChannelDescriptorRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateNotificationChannelRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelDescriptorRequest; /** - * Creates a plain object from an UpdateNotificationChannelRequest message. Also converts values to other types if specified. - * @param message UpdateNotificationChannelRequest + * Creates a plain object from a GetNotificationChannelDescriptorRequest message. Also converts values to other types if specified. + * @param message GetNotificationChannelDescriptorRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.UpdateNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetNotificationChannelDescriptorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateNotificationChannelRequest to JSON. + * Converts this GetNotificationChannelDescriptorRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteNotificationChannelRequest. */ - interface IDeleteNotificationChannelRequest { + /** Properties of a CreateNotificationChannelRequest. */ + interface ICreateNotificationChannelRequest { - /** DeleteNotificationChannelRequest name */ + /** CreateNotificationChannelRequest name */ name?: (string|null); - /** DeleteNotificationChannelRequest force */ - force?: (boolean|null); + /** CreateNotificationChannelRequest notificationChannel */ + notificationChannel?: (google.monitoring.v3.INotificationChannel|null); } - /** Represents a DeleteNotificationChannelRequest. */ - class DeleteNotificationChannelRequest implements IDeleteNotificationChannelRequest { + /** Represents a CreateNotificationChannelRequest. */ + class CreateNotificationChannelRequest implements ICreateNotificationChannelRequest { /** - * Constructs a new DeleteNotificationChannelRequest. + * Constructs a new CreateNotificationChannelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IDeleteNotificationChannelRequest); + constructor(properties?: google.monitoring.v3.ICreateNotificationChannelRequest); - /** DeleteNotificationChannelRequest name. */ + /** CreateNotificationChannelRequest name. */ public name: string; - /** DeleteNotificationChannelRequest force. */ - public force: boolean; + /** CreateNotificationChannelRequest notificationChannel. */ + public notificationChannel?: (google.monitoring.v3.INotificationChannel|null); /** - * Creates a new DeleteNotificationChannelRequest instance using the specified properties. + * Creates a new CreateNotificationChannelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteNotificationChannelRequest instance + * @returns CreateNotificationChannelRequest instance */ - public static create(properties?: google.monitoring.v3.IDeleteNotificationChannelRequest): google.monitoring.v3.DeleteNotificationChannelRequest; + public static create(properties?: google.monitoring.v3.ICreateNotificationChannelRequest): google.monitoring.v3.CreateNotificationChannelRequest; /** - * Encodes the specified DeleteNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. - * @param message DeleteNotificationChannelRequest message or plain object to encode + * Encodes the specified CreateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. + * @param message CreateNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IDeleteNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ICreateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. - * @param message DeleteNotificationChannelRequest message or plain object to encode + * Encodes the specified CreateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. + * @param message CreateNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ICreateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer. + * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteNotificationChannelRequest + * @returns CreateNotificationChannelRequest * @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.monitoring.v3.DeleteNotificationChannelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateNotificationChannelRequest; /** - * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteNotificationChannelRequest + * @returns CreateNotificationChannelRequest * @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.monitoring.v3.DeleteNotificationChannelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateNotificationChannelRequest; /** - * Verifies a DeleteNotificationChannelRequest message. + * Verifies a CreateNotificationChannelRequest 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 DeleteNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteNotificationChannelRequest + * @returns CreateNotificationChannelRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteNotificationChannelRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateNotificationChannelRequest; /** - * Creates a plain object from a DeleteNotificationChannelRequest message. Also converts values to other types if specified. - * @param message DeleteNotificationChannelRequest + * Creates a plain object from a CreateNotificationChannelRequest message. Also converts values to other types if specified. + * @param message CreateNotificationChannelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.DeleteNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.CreateNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteNotificationChannelRequest to JSON. + * Converts this CreateNotificationChannelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SendNotificationChannelVerificationCodeRequest. */ - interface ISendNotificationChannelVerificationCodeRequest { + /** Properties of a ListNotificationChannelsRequest. */ + interface IListNotificationChannelsRequest { - /** SendNotificationChannelVerificationCodeRequest name */ + /** ListNotificationChannelsRequest name */ name?: (string|null); + + /** ListNotificationChannelsRequest filter */ + filter?: (string|null); + + /** ListNotificationChannelsRequest orderBy */ + orderBy?: (string|null); + + /** ListNotificationChannelsRequest pageSize */ + pageSize?: (number|null); + + /** ListNotificationChannelsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a SendNotificationChannelVerificationCodeRequest. */ - class SendNotificationChannelVerificationCodeRequest implements ISendNotificationChannelVerificationCodeRequest { + /** Represents a ListNotificationChannelsRequest. */ + class ListNotificationChannelsRequest implements IListNotificationChannelsRequest { /** - * Constructs a new SendNotificationChannelVerificationCodeRequest. + * Constructs a new ListNotificationChannelsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest); + constructor(properties?: google.monitoring.v3.IListNotificationChannelsRequest); - /** SendNotificationChannelVerificationCodeRequest name. */ + /** ListNotificationChannelsRequest name. */ public name: string; + /** ListNotificationChannelsRequest filter. */ + public filter: string; + + /** ListNotificationChannelsRequest orderBy. */ + public orderBy: string; + + /** ListNotificationChannelsRequest pageSize. */ + public pageSize: number; + + /** ListNotificationChannelsRequest pageToken. */ + public pageToken: string; + /** - * Creates a new SendNotificationChannelVerificationCodeRequest instance using the specified properties. + * Creates a new ListNotificationChannelsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SendNotificationChannelVerificationCodeRequest instance + * @returns ListNotificationChannelsRequest instance */ - public static create(properties?: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest): google.monitoring.v3.SendNotificationChannelVerificationCodeRequest; + public static create(properties?: google.monitoring.v3.IListNotificationChannelsRequest): google.monitoring.v3.ListNotificationChannelsRequest; /** - * Encodes the specified SendNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. - * @param message SendNotificationChannelVerificationCodeRequest message or plain object to encode + * Encodes the specified ListNotificationChannelsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. + * @param message ListNotificationChannelsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListNotificationChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SendNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. - * @param message SendNotificationChannelVerificationCodeRequest message or plain object to encode + * Encodes the specified ListNotificationChannelsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. + * @param message ListNotificationChannelsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer. + * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SendNotificationChannelVerificationCodeRequest + * @returns ListNotificationChannelsRequest * @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.monitoring.v3.SendNotificationChannelVerificationCodeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListNotificationChannelsRequest; /** - * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SendNotificationChannelVerificationCodeRequest + * @returns ListNotificationChannelsRequest * @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.monitoring.v3.SendNotificationChannelVerificationCodeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListNotificationChannelsRequest; /** - * Verifies a SendNotificationChannelVerificationCodeRequest message. + * Verifies a ListNotificationChannelsRequest 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 SendNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SendNotificationChannelVerificationCodeRequest + * @returns ListNotificationChannelsRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.SendNotificationChannelVerificationCodeRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelsRequest; /** - * Creates a plain object from a SendNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. - * @param message SendNotificationChannelVerificationCodeRequest + * Creates a plain object from a ListNotificationChannelsRequest message. Also converts values to other types if specified. + * @param message ListNotificationChannelsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.SendNotificationChannelVerificationCodeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListNotificationChannelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SendNotificationChannelVerificationCodeRequest to JSON. + * Converts this ListNotificationChannelsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetNotificationChannelVerificationCodeRequest. */ - interface IGetNotificationChannelVerificationCodeRequest { + /** Properties of a ListNotificationChannelsResponse. */ + interface IListNotificationChannelsResponse { - /** GetNotificationChannelVerificationCodeRequest name */ - name?: (string|null); + /** ListNotificationChannelsResponse notificationChannels */ + notificationChannels?: (google.monitoring.v3.INotificationChannel[]|null); - /** GetNotificationChannelVerificationCodeRequest expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); + /** ListNotificationChannelsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetNotificationChannelVerificationCodeRequest. */ - class GetNotificationChannelVerificationCodeRequest implements IGetNotificationChannelVerificationCodeRequest { + /** Represents a ListNotificationChannelsResponse. */ + class ListNotificationChannelsResponse implements IListNotificationChannelsResponse { /** - * Constructs a new GetNotificationChannelVerificationCodeRequest. + * Constructs a new ListNotificationChannelsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest); + constructor(properties?: google.monitoring.v3.IListNotificationChannelsResponse); - /** GetNotificationChannelVerificationCodeRequest name. */ - public name: string; + /** ListNotificationChannelsResponse notificationChannels. */ + public notificationChannels: google.monitoring.v3.INotificationChannel[]; - /** GetNotificationChannelVerificationCodeRequest expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + /** ListNotificationChannelsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetNotificationChannelVerificationCodeRequest instance using the specified properties. + * Creates a new ListNotificationChannelsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetNotificationChannelVerificationCodeRequest instance + * @returns ListNotificationChannelsResponse instance */ - public static create(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest): google.monitoring.v3.GetNotificationChannelVerificationCodeRequest; + public static create(properties?: google.monitoring.v3.IListNotificationChannelsResponse): google.monitoring.v3.ListNotificationChannelsResponse; /** - * Encodes the specified GetNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. - * @param message GetNotificationChannelVerificationCodeRequest message or plain object to encode + * Encodes the specified ListNotificationChannelsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. + * @param message ListNotificationChannelsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListNotificationChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. - * @param message GetNotificationChannelVerificationCodeRequest message or plain object to encode + * Encodes the specified ListNotificationChannelsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. + * @param message ListNotificationChannelsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListNotificationChannelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer. + * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetNotificationChannelVerificationCodeRequest + * @returns ListNotificationChannelsResponse * @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.monitoring.v3.GetNotificationChannelVerificationCodeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListNotificationChannelsResponse; /** - * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetNotificationChannelVerificationCodeRequest + * @returns ListNotificationChannelsResponse * @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.monitoring.v3.GetNotificationChannelVerificationCodeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListNotificationChannelsResponse; /** - * Verifies a GetNotificationChannelVerificationCodeRequest message. + * Verifies a ListNotificationChannelsResponse 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 GetNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetNotificationChannelVerificationCodeRequest + * @returns ListNotificationChannelsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelVerificationCodeRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListNotificationChannelsResponse; /** - * Creates a plain object from a GetNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. - * @param message GetNotificationChannelVerificationCodeRequest + * Creates a plain object from a ListNotificationChannelsResponse message. Also converts values to other types if specified. + * @param message ListNotificationChannelsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetNotificationChannelVerificationCodeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListNotificationChannelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetNotificationChannelVerificationCodeRequest to JSON. + * Converts this ListNotificationChannelsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetNotificationChannelVerificationCodeResponse. */ - interface IGetNotificationChannelVerificationCodeResponse { - - /** GetNotificationChannelVerificationCodeResponse code */ - code?: (string|null); + /** Properties of a GetNotificationChannelRequest. */ + interface IGetNotificationChannelRequest { - /** GetNotificationChannelVerificationCodeResponse expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); + /** GetNotificationChannelRequest name */ + name?: (string|null); } - /** Represents a GetNotificationChannelVerificationCodeResponse. */ - class GetNotificationChannelVerificationCodeResponse implements IGetNotificationChannelVerificationCodeResponse { + /** Represents a GetNotificationChannelRequest. */ + class GetNotificationChannelRequest implements IGetNotificationChannelRequest { /** - * Constructs a new GetNotificationChannelVerificationCodeResponse. + * Constructs a new GetNotificationChannelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse); - - /** GetNotificationChannelVerificationCodeResponse code. */ - public code: string; + constructor(properties?: google.monitoring.v3.IGetNotificationChannelRequest); - /** GetNotificationChannelVerificationCodeResponse expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + /** GetNotificationChannelRequest name. */ + public name: string; /** - * Creates a new GetNotificationChannelVerificationCodeResponse instance using the specified properties. + * Creates a new GetNotificationChannelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetNotificationChannelVerificationCodeResponse instance + * @returns GetNotificationChannelRequest instance */ - public static create(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse): google.monitoring.v3.GetNotificationChannelVerificationCodeResponse; + public static create(properties?: google.monitoring.v3.IGetNotificationChannelRequest): google.monitoring.v3.GetNotificationChannelRequest; /** - * Encodes the specified GetNotificationChannelVerificationCodeResponse message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. - * @param message GetNotificationChannelVerificationCodeResponse message or plain object to encode + * Encodes the specified GetNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. + * @param message GetNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetNotificationChannelVerificationCodeResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. - * @param message GetNotificationChannelVerificationCodeResponse message or plain object to encode + * Encodes the specified GetNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. + * @param message GetNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer. + * Decodes a GetNotificationChannelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetNotificationChannelVerificationCodeResponse + * @returns GetNotificationChannelRequest * @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.monitoring.v3.GetNotificationChannelVerificationCodeResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetNotificationChannelRequest; /** - * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationChannelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetNotificationChannelVerificationCodeResponse + * @returns GetNotificationChannelRequest * @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.monitoring.v3.GetNotificationChannelVerificationCodeResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetNotificationChannelRequest; /** - * Verifies a GetNotificationChannelVerificationCodeResponse message. + * Verifies a GetNotificationChannelRequest 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 GetNotificationChannelVerificationCodeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetNotificationChannelVerificationCodeResponse + * @returns GetNotificationChannelRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelVerificationCodeResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelRequest; /** - * Creates a plain object from a GetNotificationChannelVerificationCodeResponse message. Also converts values to other types if specified. - * @param message GetNotificationChannelVerificationCodeResponse + * Creates a plain object from a GetNotificationChannelRequest message. Also converts values to other types if specified. + * @param message GetNotificationChannelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetNotificationChannelVerificationCodeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetNotificationChannelVerificationCodeResponse to JSON. + * Converts this GetNotificationChannelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VerifyNotificationChannelRequest. */ - interface IVerifyNotificationChannelRequest { + /** Properties of an UpdateNotificationChannelRequest. */ + interface IUpdateNotificationChannelRequest { - /** VerifyNotificationChannelRequest name */ - name?: (string|null); + /** UpdateNotificationChannelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** VerifyNotificationChannelRequest code */ - code?: (string|null); + /** UpdateNotificationChannelRequest notificationChannel */ + notificationChannel?: (google.monitoring.v3.INotificationChannel|null); } - /** Represents a VerifyNotificationChannelRequest. */ - class VerifyNotificationChannelRequest implements IVerifyNotificationChannelRequest { + /** Represents an UpdateNotificationChannelRequest. */ + class UpdateNotificationChannelRequest implements IUpdateNotificationChannelRequest { /** - * Constructs a new VerifyNotificationChannelRequest. + * Constructs a new UpdateNotificationChannelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IVerifyNotificationChannelRequest); + constructor(properties?: google.monitoring.v3.IUpdateNotificationChannelRequest); - /** VerifyNotificationChannelRequest name. */ - public name: string; + /** UpdateNotificationChannelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** VerifyNotificationChannelRequest code. */ - public code: string; + /** UpdateNotificationChannelRequest notificationChannel. */ + public notificationChannel?: (google.monitoring.v3.INotificationChannel|null); /** - * Creates a new VerifyNotificationChannelRequest instance using the specified properties. + * Creates a new UpdateNotificationChannelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns VerifyNotificationChannelRequest instance + * @returns UpdateNotificationChannelRequest instance */ - public static create(properties?: google.monitoring.v3.IVerifyNotificationChannelRequest): google.monitoring.v3.VerifyNotificationChannelRequest; + public static create(properties?: google.monitoring.v3.IUpdateNotificationChannelRequest): google.monitoring.v3.UpdateNotificationChannelRequest; /** - * Encodes the specified VerifyNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. - * @param message VerifyNotificationChannelRequest message or plain object to encode + * Encodes the specified UpdateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. + * @param message UpdateNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IVerifyNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IUpdateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VerifyNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. - * @param message VerifyNotificationChannelRequest message or plain object to encode + * Encodes the specified UpdateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. + * @param message UpdateNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IVerifyNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IUpdateNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer. + * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VerifyNotificationChannelRequest + * @returns UpdateNotificationChannelRequest * @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.monitoring.v3.VerifyNotificationChannelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateNotificationChannelRequest; /** - * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VerifyNotificationChannelRequest + * @returns UpdateNotificationChannelRequest * @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.monitoring.v3.VerifyNotificationChannelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateNotificationChannelRequest; /** - * Verifies a VerifyNotificationChannelRequest message. + * Verifies an UpdateNotificationChannelRequest 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 VerifyNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VerifyNotificationChannelRequest + * @returns UpdateNotificationChannelRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.VerifyNotificationChannelRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateNotificationChannelRequest; /** - * Creates a plain object from a VerifyNotificationChannelRequest message. Also converts values to other types if specified. - * @param message VerifyNotificationChannelRequest + * Creates a plain object from an UpdateNotificationChannelRequest message. Also converts values to other types if specified. + * @param message UpdateNotificationChannelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.VerifyNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.UpdateNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VerifyNotificationChannelRequest to JSON. + * Converts this UpdateNotificationChannelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a NotificationChannelDescriptor. */ - interface INotificationChannelDescriptor { + /** Properties of a DeleteNotificationChannelRequest. */ + interface IDeleteNotificationChannelRequest { - /** NotificationChannelDescriptor name */ + /** DeleteNotificationChannelRequest name */ name?: (string|null); - /** NotificationChannelDescriptor type */ - type?: (string|null); - - /** NotificationChannelDescriptor displayName */ - displayName?: (string|null); - - /** NotificationChannelDescriptor description */ - description?: (string|null); - - /** NotificationChannelDescriptor labels */ - labels?: (google.api.ILabelDescriptor[]|null); - - /** NotificationChannelDescriptor supportedTiers */ - supportedTiers?: (google.monitoring.v3.ServiceTier[]|null); + /** DeleteNotificationChannelRequest force */ + force?: (boolean|null); } - /** Represents a NotificationChannelDescriptor. */ - class NotificationChannelDescriptor implements INotificationChannelDescriptor { + /** Represents a DeleteNotificationChannelRequest. */ + class DeleteNotificationChannelRequest implements IDeleteNotificationChannelRequest { /** - * Constructs a new NotificationChannelDescriptor. + * Constructs a new DeleteNotificationChannelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.INotificationChannelDescriptor); + constructor(properties?: google.monitoring.v3.IDeleteNotificationChannelRequest); - /** NotificationChannelDescriptor name. */ + /** DeleteNotificationChannelRequest name. */ public name: string; - /** NotificationChannelDescriptor type. */ - public type: string; - - /** NotificationChannelDescriptor displayName. */ - public displayName: string; - - /** NotificationChannelDescriptor description. */ - public description: string; - - /** NotificationChannelDescriptor labels. */ - public labels: google.api.ILabelDescriptor[]; - - /** NotificationChannelDescriptor supportedTiers. */ - public supportedTiers: google.monitoring.v3.ServiceTier[]; + /** DeleteNotificationChannelRequest force. */ + public force: boolean; /** - * Creates a new NotificationChannelDescriptor instance using the specified properties. + * Creates a new DeleteNotificationChannelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns NotificationChannelDescriptor instance + * @returns DeleteNotificationChannelRequest instance */ - public static create(properties?: google.monitoring.v3.INotificationChannelDescriptor): google.monitoring.v3.NotificationChannelDescriptor; + public static create(properties?: google.monitoring.v3.IDeleteNotificationChannelRequest): google.monitoring.v3.DeleteNotificationChannelRequest; /** - * Encodes the specified NotificationChannelDescriptor message. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. - * @param message NotificationChannelDescriptor message or plain object to encode + * Encodes the specified DeleteNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. + * @param message DeleteNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.INotificationChannelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IDeleteNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NotificationChannelDescriptor message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. - * @param message NotificationChannelDescriptor message or plain object to encode + * Encodes the specified DeleteNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. + * @param message DeleteNotificationChannelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.INotificationChannelDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IDeleteNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NotificationChannelDescriptor message from the specified reader or buffer. + * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NotificationChannelDescriptor + * @returns DeleteNotificationChannelRequest * @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.monitoring.v3.NotificationChannelDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteNotificationChannelRequest; /** - * Decodes a NotificationChannelDescriptor message from the specified reader or buffer, length delimited. + * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NotificationChannelDescriptor + * @returns DeleteNotificationChannelRequest * @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.monitoring.v3.NotificationChannelDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteNotificationChannelRequest; /** - * Verifies a NotificationChannelDescriptor message. + * Verifies a DeleteNotificationChannelRequest 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 NotificationChannelDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NotificationChannelDescriptor + * @returns DeleteNotificationChannelRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.NotificationChannelDescriptor; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteNotificationChannelRequest; /** - * Creates a plain object from a NotificationChannelDescriptor message. Also converts values to other types if specified. - * @param message NotificationChannelDescriptor + * Creates a plain object from a DeleteNotificationChannelRequest message. Also converts values to other types if specified. + * @param message DeleteNotificationChannelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.NotificationChannelDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NotificationChannelDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a NotificationChannel. */ - interface INotificationChannel { - - /** NotificationChannel type */ - type?: (string|null); - - /** NotificationChannel name */ - name?: (string|null); - - /** NotificationChannel displayName */ - displayName?: (string|null); - - /** NotificationChannel description */ - description?: (string|null); - - /** NotificationChannel labels */ - labels?: ({ [k: string]: string }|null); + public static toObject(message: google.monitoring.v3.DeleteNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** NotificationChannel userLabels */ - userLabels?: ({ [k: string]: string }|null); + /** + * Converts this DeleteNotificationChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** NotificationChannel verificationStatus */ - verificationStatus?: (google.monitoring.v3.NotificationChannel.VerificationStatus|keyof typeof google.monitoring.v3.NotificationChannel.VerificationStatus|null); + /** Properties of a SendNotificationChannelVerificationCodeRequest. */ + interface ISendNotificationChannelVerificationCodeRequest { - /** NotificationChannel enabled */ - enabled?: (google.protobuf.IBoolValue|null); + /** SendNotificationChannelVerificationCodeRequest name */ + name?: (string|null); } - /** Represents a NotificationChannel. */ - class NotificationChannel implements INotificationChannel { + /** Represents a SendNotificationChannelVerificationCodeRequest. */ + class SendNotificationChannelVerificationCodeRequest implements ISendNotificationChannelVerificationCodeRequest { /** - * Constructs a new NotificationChannel. + * Constructs a new SendNotificationChannelVerificationCodeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.INotificationChannel); - - /** NotificationChannel type. */ - public type: string; + constructor(properties?: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest); - /** NotificationChannel name. */ + /** SendNotificationChannelVerificationCodeRequest name. */ public name: string; - /** NotificationChannel displayName. */ - public displayName: string; - - /** NotificationChannel description. */ - public description: string; - - /** NotificationChannel labels. */ - public labels: { [k: string]: string }; - - /** NotificationChannel userLabels. */ - public userLabels: { [k: string]: string }; - - /** NotificationChannel verificationStatus. */ - public verificationStatus: (google.monitoring.v3.NotificationChannel.VerificationStatus|keyof typeof google.monitoring.v3.NotificationChannel.VerificationStatus); - - /** NotificationChannel enabled. */ - public enabled?: (google.protobuf.IBoolValue|null); - /** - * Creates a new NotificationChannel instance using the specified properties. + * Creates a new SendNotificationChannelVerificationCodeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns NotificationChannel instance + * @returns SendNotificationChannelVerificationCodeRequest instance */ - public static create(properties?: google.monitoring.v3.INotificationChannel): google.monitoring.v3.NotificationChannel; + public static create(properties?: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest): google.monitoring.v3.SendNotificationChannelVerificationCodeRequest; /** - * Encodes the specified NotificationChannel message. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. - * @param message NotificationChannel message or plain object to encode + * Encodes the specified SendNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. + * @param message SendNotificationChannelVerificationCodeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.INotificationChannel, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NotificationChannel message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. - * @param message NotificationChannel message or plain object to encode + * Encodes the specified SendNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. + * @param message SendNotificationChannelVerificationCodeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.INotificationChannel, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NotificationChannel message from the specified reader or buffer. + * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NotificationChannel + * @returns SendNotificationChannelVerificationCodeRequest * @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.monitoring.v3.NotificationChannel; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.SendNotificationChannelVerificationCodeRequest; /** - * Decodes a NotificationChannel message from the specified reader or buffer, length delimited. + * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NotificationChannel + * @returns SendNotificationChannelVerificationCodeRequest * @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.monitoring.v3.NotificationChannel; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.SendNotificationChannelVerificationCodeRequest; /** - * Verifies a NotificationChannel message. + * Verifies a SendNotificationChannelVerificationCodeRequest 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 NotificationChannel message from a plain object. Also converts values to their respective internal types. + * Creates a SendNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NotificationChannel + * @returns SendNotificationChannelVerificationCodeRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.NotificationChannel; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.SendNotificationChannelVerificationCodeRequest; /** - * Creates a plain object from a NotificationChannel message. Also converts values to other types if specified. - * @param message NotificationChannel + * Creates a plain object from a SendNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. + * @param message SendNotificationChannelVerificationCodeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.NotificationChannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.SendNotificationChannelVerificationCodeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NotificationChannel to JSON. + * Converts this SendNotificationChannelVerificationCodeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace NotificationChannel { + /** Properties of a GetNotificationChannelVerificationCodeRequest. */ + interface IGetNotificationChannelVerificationCodeRequest { - /** VerificationStatus enum. */ - enum VerificationStatus { - VERIFICATION_STATUS_UNSPECIFIED = 0, - UNVERIFIED = 1, - VERIFIED = 2 - } + /** GetNotificationChannelVerificationCodeRequest name */ + name?: (string|null); + + /** GetNotificationChannelVerificationCodeRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); } - /** Represents a ServiceMonitoringService */ - class ServiceMonitoringService extends $protobuf.rpc.Service { + /** Represents a GetNotificationChannelVerificationCodeRequest. */ + class GetNotificationChannelVerificationCodeRequest implements IGetNotificationChannelVerificationCodeRequest { /** - * Constructs a new ServiceMonitoringService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new GetNotificationChannelVerificationCodeRequest. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest); - /** - * Creates new ServiceMonitoringService 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): ServiceMonitoringService; + /** GetNotificationChannelVerificationCodeRequest name. */ + public name: string; - /** - * Calls CreateService. - * @param request CreateServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Service - */ - public createService(request: google.monitoring.v3.ICreateServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.CreateServiceCallback): void; + /** GetNotificationChannelVerificationCodeRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); /** - * Calls CreateService. - * @param request CreateServiceRequest message or plain object - * @returns Promise + * Creates a new GetNotificationChannelVerificationCodeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNotificationChannelVerificationCodeRequest instance */ - public createService(request: google.monitoring.v3.ICreateServiceRequest): Promise; + public static create(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest): google.monitoring.v3.GetNotificationChannelVerificationCodeRequest; /** - * Calls GetService. - * @param request GetServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Service + * Encodes the specified GetNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. + * @param message GetNotificationChannelVerificationCodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getService(request: google.monitoring.v3.IGetServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.GetServiceCallback): void; + public static encode(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetService. - * @param request GetServiceRequest message or plain object - * @returns Promise + * Encodes the specified GetNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. + * @param message GetNotificationChannelVerificationCodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getService(request: google.monitoring.v3.IGetServiceRequest): Promise; + public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListServices. - * @param request ListServicesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListServicesResponse + * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNotificationChannelVerificationCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listServices(request: google.monitoring.v3.IListServicesRequest, callback: google.monitoring.v3.ServiceMonitoringService.ListServicesCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetNotificationChannelVerificationCodeRequest; /** - * Calls ListServices. - * @param request ListServicesRequest message or plain object - * @returns Promise + * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNotificationChannelVerificationCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listServices(request: google.monitoring.v3.IListServicesRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetNotificationChannelVerificationCodeRequest; /** - * Calls UpdateService. - * @param request UpdateServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Service + * Verifies a GetNotificationChannelVerificationCodeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateService(request: google.monitoring.v3.IUpdateServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.UpdateServiceCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls UpdateService. - * @param request UpdateServiceRequest message or plain object - * @returns Promise + * Creates a GetNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNotificationChannelVerificationCodeRequest */ - public updateService(request: google.monitoring.v3.IUpdateServiceRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelVerificationCodeRequest; /** - * Calls DeleteService. - * @param request DeleteServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a plain object from a GetNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. + * @param message GetNotificationChannelVerificationCodeRequest + * @param [options] Conversion options + * @returns Plain object */ - public deleteService(request: google.monitoring.v3.IDeleteServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.DeleteServiceCallback): void; + public static toObject(message: google.monitoring.v3.GetNotificationChannelVerificationCodeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteService. - * @param request DeleteServiceRequest message or plain object - * @returns Promise + * Converts this GetNotificationChannelVerificationCodeRequest to JSON. + * @returns JSON object */ - public deleteService(request: google.monitoring.v3.IDeleteServiceRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNotificationChannelVerificationCodeResponse. */ + interface IGetNotificationChannelVerificationCodeResponse { + + /** GetNotificationChannelVerificationCodeResponse code */ + code?: (string|null); + + /** GetNotificationChannelVerificationCodeResponse expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GetNotificationChannelVerificationCodeResponse. */ + class GetNotificationChannelVerificationCodeResponse implements IGetNotificationChannelVerificationCodeResponse { /** - * Calls CreateServiceLevelObjective. - * @param request CreateServiceLevelObjectiveRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + * Constructs a new GetNotificationChannelVerificationCodeResponse. + * @param [properties] Properties to set */ - public createServiceLevelObjective(request: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjectiveCallback): void; + constructor(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse); + + /** GetNotificationChannelVerificationCodeResponse code. */ + public code: string; + + /** GetNotificationChannelVerificationCodeResponse expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); /** - * Calls CreateServiceLevelObjective. - * @param request CreateServiceLevelObjectiveRequest message or plain object - * @returns Promise + * Creates a new GetNotificationChannelVerificationCodeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNotificationChannelVerificationCodeResponse instance */ - public createServiceLevelObjective(request: google.monitoring.v3.ICreateServiceLevelObjectiveRequest): Promise; + public static create(properties?: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse): google.monitoring.v3.GetNotificationChannelVerificationCodeResponse; /** - * Calls GetServiceLevelObjective. - * @param request GetServiceLevelObjectiveRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + * Encodes the specified GetNotificationChannelVerificationCodeResponse message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. + * @param message GetNotificationChannelVerificationCodeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getServiceLevelObjective(request: google.monitoring.v3.IGetServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjectiveCallback): void; + public static encode(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetServiceLevelObjective. - * @param request GetServiceLevelObjectiveRequest message or plain object - * @returns Promise + * Encodes the specified GetNotificationChannelVerificationCodeResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. + * @param message GetNotificationChannelVerificationCodeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getServiceLevelObjective(request: google.monitoring.v3.IGetServiceLevelObjectiveRequest): Promise; + public static encodeDelimited(message: google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListServiceLevelObjectives. - * @param request ListServiceLevelObjectivesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListServiceLevelObjectivesResponse + * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNotificationChannelVerificationCodeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listServiceLevelObjectives(request: google.monitoring.v3.IListServiceLevelObjectivesRequest, callback: google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectivesCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetNotificationChannelVerificationCodeResponse; /** - * Calls ListServiceLevelObjectives. - * @param request ListServiceLevelObjectivesRequest message or plain object - * @returns Promise + * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNotificationChannelVerificationCodeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listServiceLevelObjectives(request: google.monitoring.v3.IListServiceLevelObjectivesRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetNotificationChannelVerificationCodeResponse; /** - * Calls UpdateServiceLevelObjective. - * @param request UpdateServiceLevelObjectiveRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + * Verifies a GetNotificationChannelVerificationCodeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateServiceLevelObjective(request: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjectiveCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls UpdateServiceLevelObjective. - * @param request UpdateServiceLevelObjectiveRequest message or plain object - * @returns Promise + * Creates a GetNotificationChannelVerificationCodeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNotificationChannelVerificationCodeResponse */ - public updateServiceLevelObjective(request: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetNotificationChannelVerificationCodeResponse; /** - * Calls DeleteServiceLevelObjective. - * @param request DeleteServiceLevelObjectiveRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a plain object from a GetNotificationChannelVerificationCodeResponse message. Also converts values to other types if specified. + * @param message GetNotificationChannelVerificationCodeResponse + * @param [options] Conversion options + * @returns Plain object */ - public deleteServiceLevelObjective(request: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjectiveCallback): void; + public static toObject(message: google.monitoring.v3.GetNotificationChannelVerificationCodeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteServiceLevelObjective. - * @param request DeleteServiceLevelObjectiveRequest message or plain object - * @returns Promise + * Converts this GetNotificationChannelVerificationCodeResponse to JSON. + * @returns JSON object */ - public deleteServiceLevelObjective(request: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace ServiceMonitoringService { + /** Properties of a VerifyNotificationChannelRequest. */ + interface IVerifyNotificationChannelRequest { + + /** VerifyNotificationChannelRequest name */ + name?: (string|null); + + /** VerifyNotificationChannelRequest code */ + code?: (string|null); + } + + /** Represents a VerifyNotificationChannelRequest. */ + class VerifyNotificationChannelRequest implements IVerifyNotificationChannelRequest { /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createService}. - * @param error Error, if any - * @param [response] Service + * Constructs a new VerifyNotificationChannelRequest. + * @param [properties] Properties to set */ - type CreateServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; + constructor(properties?: google.monitoring.v3.IVerifyNotificationChannelRequest); + + /** VerifyNotificationChannelRequest name. */ + public name: string; + + /** VerifyNotificationChannelRequest code. */ + public code: string; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getService}. - * @param error Error, if any - * @param [response] Service + * Creates a new VerifyNotificationChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifyNotificationChannelRequest instance */ - type GetServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; + public static create(properties?: google.monitoring.v3.IVerifyNotificationChannelRequest): google.monitoring.v3.VerifyNotificationChannelRequest; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServices}. - * @param error Error, if any - * @param [response] ListServicesResponse + * Encodes the specified VerifyNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. + * @param message VerifyNotificationChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListServicesCallback = (error: (Error|null), response?: google.monitoring.v3.ListServicesResponse) => void; + public static encode(message: google.monitoring.v3.IVerifyNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateService}. - * @param error Error, if any - * @param [response] Service + * Encodes the specified VerifyNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. + * @param message VerifyNotificationChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; + public static encodeDelimited(message: google.monitoring.v3.IVerifyNotificationChannelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteService}. - * @param error Error, if any - * @param [response] Empty + * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifyNotificationChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteServiceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.VerifyNotificationChannelRequest; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createServiceLevelObjective}. - * @param error Error, if any - * @param [response] ServiceLevelObjective + * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifyNotificationChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.VerifyNotificationChannelRequest; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getServiceLevelObjective}. - * @param error Error, if any - * @param [response] ServiceLevelObjective + * Verifies a VerifyNotificationChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServiceLevelObjectives}. - * @param error Error, if any - * @param [response] ListServiceLevelObjectivesResponse + * Creates a VerifyNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifyNotificationChannelRequest */ - type ListServiceLevelObjectivesCallback = (error: (Error|null), response?: google.monitoring.v3.ListServiceLevelObjectivesResponse) => void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.VerifyNotificationChannelRequest; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateServiceLevelObjective}. - * @param error Error, if any - * @param [response] ServiceLevelObjective + * Creates a plain object from a VerifyNotificationChannelRequest message. Also converts values to other types if specified. + * @param message VerifyNotificationChannelRequest + * @param [options] Conversion options + * @returns Plain object */ - type UpdateServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; + public static toObject(message: google.monitoring.v3.VerifyNotificationChannelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteServiceLevelObjective}. - * @param error Error, if any - * @param [response] Empty + * Converts this VerifyNotificationChannelRequest to JSON. + * @returns JSON object */ - type DeleteServiceLevelObjectiveCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a CreateServiceRequest. */ - interface ICreateServiceRequest { + /** Properties of a Service. */ + interface IService { - /** CreateServiceRequest parent */ - parent?: (string|null); + /** Service name */ + name?: (string|null); - /** CreateServiceRequest serviceId */ - serviceId?: (string|null); + /** Service displayName */ + displayName?: (string|null); - /** CreateServiceRequest service */ - service?: (google.monitoring.v3.IService|null); + /** Service custom */ + custom?: (google.monitoring.v3.Service.ICustom|null); + + /** Service appEngine */ + appEngine?: (google.monitoring.v3.Service.IAppEngine|null); + + /** Service cloudEndpoints */ + cloudEndpoints?: (google.monitoring.v3.Service.ICloudEndpoints|null); + + /** Service clusterIstio */ + clusterIstio?: (google.monitoring.v3.Service.IClusterIstio|null); + + /** Service telemetry */ + telemetry?: (google.monitoring.v3.Service.ITelemetry|null); } - /** Represents a CreateServiceRequest. */ - class CreateServiceRequest implements ICreateServiceRequest { + /** Represents a Service. */ + class Service implements IService { /** - * Constructs a new CreateServiceRequest. + * Constructs a new Service. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ICreateServiceRequest); + constructor(properties?: google.monitoring.v3.IService); - /** CreateServiceRequest parent. */ - public parent: string; + /** Service name. */ + public name: string; - /** CreateServiceRequest serviceId. */ - public serviceId: string; + /** Service displayName. */ + public displayName: string; - /** CreateServiceRequest service. */ - public service?: (google.monitoring.v3.IService|null); + /** Service custom. */ + public custom?: (google.monitoring.v3.Service.ICustom|null); + + /** Service appEngine. */ + public appEngine?: (google.monitoring.v3.Service.IAppEngine|null); + + /** Service cloudEndpoints. */ + public cloudEndpoints?: (google.monitoring.v3.Service.ICloudEndpoints|null); + + /** Service clusterIstio. */ + public clusterIstio?: (google.monitoring.v3.Service.IClusterIstio|null); + + /** Service telemetry. */ + public telemetry?: (google.monitoring.v3.Service.ITelemetry|null); + + /** Service identifier. */ + public identifier?: ("custom"|"appEngine"|"cloudEndpoints"|"clusterIstio"); /** - * Creates a new CreateServiceRequest instance using the specified properties. + * Creates a new Service instance using the specified properties. * @param [properties] Properties to set - * @returns CreateServiceRequest instance + * @returns Service instance */ - public static create(properties?: google.monitoring.v3.ICreateServiceRequest): google.monitoring.v3.CreateServiceRequest; + public static create(properties?: google.monitoring.v3.IService): google.monitoring.v3.Service; /** - * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. - * @param message CreateServiceRequest message or plain object to encode + * Encodes the specified Service message. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * @param message Service message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IService, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. - * @param message CreateServiceRequest message or plain object to encode + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * @param message Service message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IService, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateServiceRequest message from the specified reader or buffer. + * Decodes a Service message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateServiceRequest + * @returns Service * @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.monitoring.v3.CreateServiceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Service; /** - * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * Decodes a Service message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateServiceRequest + * @returns Service * @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.monitoring.v3.CreateServiceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Service; /** - * Verifies a CreateServiceRequest message. + * Verifies a Service 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 CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Service message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateServiceRequest + * @returns Service */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateServiceRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service; /** - * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. - * @param message CreateServiceRequest + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @param message Service * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateServiceRequest to JSON. + * Converts this Service to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetServiceRequest. */ - interface IGetServiceRequest { + namespace Service { - /** GetServiceRequest name */ - name?: (string|null); - } + /** Properties of a Custom. */ + interface ICustom { + } - /** Represents a GetServiceRequest. */ - class GetServiceRequest implements IGetServiceRequest { + /** Represents a Custom. */ + class Custom implements ICustom { - /** - * Constructs a new GetServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IGetServiceRequest); + /** + * Constructs a new Custom. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.ICustom); - /** GetServiceRequest name. */ - public name: string; + /** + * Creates a new Custom instance using the specified properties. + * @param [properties] Properties to set + * @returns Custom instance + */ + public static create(properties?: google.monitoring.v3.Service.ICustom): google.monitoring.v3.Service.Custom; - /** - * Creates a new GetServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetServiceRequest instance - */ - public static create(properties?: google.monitoring.v3.IGetServiceRequest): google.monitoring.v3.GetServiceRequest; + /** + * Encodes the specified Custom message. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @param message Custom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.ICustom, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. - * @param message GetServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Custom message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @param message Custom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.ICustom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Custom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Custom + * @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.monitoring.v3.Service.Custom; + + /** + * Decodes a Custom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Custom + * @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.monitoring.v3.Service.Custom; + + /** + * Verifies a Custom 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 Custom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Custom + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.Custom; + + /** + * Creates a plain object from a Custom message. Also converts values to other types if specified. + * @param message Custom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.Custom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Custom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AppEngine. */ + interface IAppEngine { + + /** AppEngine moduleId */ + moduleId?: (string|null); + } + + /** Represents an AppEngine. */ + class AppEngine implements IAppEngine { + + /** + * Constructs a new AppEngine. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.IAppEngine); + + /** AppEngine moduleId. */ + public moduleId: string; + + /** + * Creates a new AppEngine instance using the specified properties. + * @param [properties] Properties to set + * @returns AppEngine instance + */ + public static create(properties?: google.monitoring.v3.Service.IAppEngine): google.monitoring.v3.Service.AppEngine; + + /** + * Encodes the specified AppEngine message. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @param message AppEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.IAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppEngine message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @param message AppEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.IAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppEngine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppEngine + * @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.monitoring.v3.Service.AppEngine; + + /** + * Decodes an AppEngine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppEngine + * @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.monitoring.v3.Service.AppEngine; + + /** + * Verifies an AppEngine 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 AppEngine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppEngine + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.AppEngine; + + /** + * Creates a plain object from an AppEngine message. Also converts values to other types if specified. + * @param message AppEngine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.AppEngine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppEngine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CloudEndpoints. */ + interface ICloudEndpoints { + + /** CloudEndpoints service */ + service?: (string|null); + } + + /** Represents a CloudEndpoints. */ + class CloudEndpoints implements ICloudEndpoints { + + /** + * Constructs a new CloudEndpoints. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.ICloudEndpoints); + + /** CloudEndpoints service. */ + public service: string; + + /** + * Creates a new CloudEndpoints instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudEndpoints instance + */ + public static create(properties?: google.monitoring.v3.Service.ICloudEndpoints): google.monitoring.v3.Service.CloudEndpoints; + + /** + * Encodes the specified CloudEndpoints message. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @param message CloudEndpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.ICloudEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudEndpoints message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @param message CloudEndpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.ICloudEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. - * @param message GetServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a CloudEndpoints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudEndpoints + * @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.monitoring.v3.Service.CloudEndpoints; - /** - * Decodes a GetServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetServiceRequest - * @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.monitoring.v3.GetServiceRequest; + /** + * Decodes a CloudEndpoints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudEndpoints + * @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.monitoring.v3.Service.CloudEndpoints; - /** - * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetServiceRequest - * @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.monitoring.v3.GetServiceRequest; + /** + * Verifies a CloudEndpoints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a GetServiceRequest 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 CloudEndpoints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudEndpoints + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.CloudEndpoints; - /** - * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetServiceRequest; + /** + * Creates a plain object from a CloudEndpoints message. Also converts values to other types if specified. + * @param message CloudEndpoints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.CloudEndpoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. - * @param message GetServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this CloudEndpoints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this GetServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a ClusterIstio. */ + interface IClusterIstio { - /** Properties of a ListServicesRequest. */ - interface IListServicesRequest { + /** ClusterIstio location */ + location?: (string|null); - /** ListServicesRequest parent */ - parent?: (string|null); + /** ClusterIstio clusterName */ + clusterName?: (string|null); - /** ListServicesRequest filter */ - filter?: (string|null); + /** ClusterIstio serviceNamespace */ + serviceNamespace?: (string|null); - /** ListServicesRequest pageSize */ - pageSize?: (number|null); + /** ClusterIstio serviceName */ + serviceName?: (string|null); + } - /** ListServicesRequest pageToken */ - pageToken?: (string|null); - } + /** Represents a ClusterIstio. */ + class ClusterIstio implements IClusterIstio { - /** Represents a ListServicesRequest. */ - class ListServicesRequest implements IListServicesRequest { + /** + * Constructs a new ClusterIstio. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.IClusterIstio); - /** - * Constructs a new ListServicesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListServicesRequest); + /** ClusterIstio location. */ + public location: string; - /** ListServicesRequest parent. */ - public parent: string; + /** ClusterIstio clusterName. */ + public clusterName: string; - /** ListServicesRequest filter. */ - public filter: string; + /** ClusterIstio serviceNamespace. */ + public serviceNamespace: string; - /** ListServicesRequest pageSize. */ - public pageSize: number; + /** ClusterIstio serviceName. */ + public serviceName: string; - /** ListServicesRequest pageToken. */ - public pageToken: string; + /** + * Creates a new ClusterIstio instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterIstio instance + */ + public static create(properties?: google.monitoring.v3.Service.IClusterIstio): google.monitoring.v3.Service.ClusterIstio; - /** - * Creates a new ListServicesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListServicesRequest instance - */ - public static create(properties?: google.monitoring.v3.IListServicesRequest): google.monitoring.v3.ListServicesRequest; + /** + * Encodes the specified ClusterIstio message. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @param message ClusterIstio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.IClusterIstio, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. - * @param message ListServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ClusterIstio message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @param message ClusterIstio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.IClusterIstio, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. - * @param message ListServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ClusterIstio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterIstio + * @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.monitoring.v3.Service.ClusterIstio; - /** - * Decodes a ListServicesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListServicesRequest - * @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.monitoring.v3.ListServicesRequest; + /** + * Decodes a ClusterIstio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterIstio + * @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.monitoring.v3.Service.ClusterIstio; - /** - * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListServicesRequest - * @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.monitoring.v3.ListServicesRequest; + /** + * Verifies a ClusterIstio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a ListServicesRequest 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 ClusterIstio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterIstio + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.ClusterIstio; - /** - * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListServicesRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServicesRequest; + /** + * Creates a plain object from a ClusterIstio message. Also converts values to other types if specified. + * @param message ClusterIstio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.ClusterIstio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterIstio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. - * @param message ListServicesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a Telemetry. */ + interface ITelemetry { - /** - * Converts this ListServicesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Telemetry resourceName */ + resourceName?: (string|null); + } - /** Properties of a ListServicesResponse. */ - interface IListServicesResponse { + /** Represents a Telemetry. */ + class Telemetry implements ITelemetry { - /** ListServicesResponse services */ - services?: (google.monitoring.v3.IService[]|null); + /** + * Constructs a new Telemetry. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.Service.ITelemetry); - /** ListServicesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** Telemetry resourceName. */ + public resourceName: string; - /** Represents a ListServicesResponse. */ - class ListServicesResponse implements IListServicesResponse { + /** + * Creates a new Telemetry instance using the specified properties. + * @param [properties] Properties to set + * @returns Telemetry instance + */ + public static create(properties?: google.monitoring.v3.Service.ITelemetry): google.monitoring.v3.Service.Telemetry; - /** - * Constructs a new ListServicesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListServicesResponse); + /** + * Encodes the specified Telemetry message. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @param message Telemetry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.Service.ITelemetry, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListServicesResponse services. */ - public services: google.monitoring.v3.IService[]; + /** + * Encodes the specified Telemetry message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @param message Telemetry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.Service.ITelemetry, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListServicesResponse nextPageToken. */ - public nextPageToken: string; + /** + * Decodes a Telemetry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Telemetry + * @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.monitoring.v3.Service.Telemetry; - /** - * Creates a new ListServicesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListServicesResponse instance - */ - public static create(properties?: google.monitoring.v3.IListServicesResponse): google.monitoring.v3.ListServicesResponse; + /** + * Decodes a Telemetry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Telemetry + * @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.monitoring.v3.Service.Telemetry; - /** - * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. - * @param message ListServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a Telemetry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. - * @param message ListServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a Telemetry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Telemetry + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.Telemetry; - /** - * Decodes a ListServicesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListServicesResponse - * @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.monitoring.v3.ListServicesResponse; + /** + * Creates a plain object from a Telemetry message. Also converts values to other types if specified. + * @param message Telemetry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.Service.Telemetry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListServicesResponse - * @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.monitoring.v3.ListServicesResponse; + /** + * Converts this Telemetry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Verifies a ListServicesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a ServiceLevelObjective. */ + interface IServiceLevelObjective { - /** - * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListServicesResponse - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServicesResponse; + /** ServiceLevelObjective name */ + name?: (string|null); - /** - * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. - * @param message ListServicesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ServiceLevelObjective displayName */ + displayName?: (string|null); - /** - * Converts this ListServicesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ServiceLevelObjective serviceLevelIndicator */ + serviceLevelIndicator?: (google.monitoring.v3.IServiceLevelIndicator|null); - /** Properties of an UpdateServiceRequest. */ - interface IUpdateServiceRequest { + /** ServiceLevelObjective goal */ + goal?: (number|null); - /** UpdateServiceRequest service */ - service?: (google.monitoring.v3.IService|null); + /** ServiceLevelObjective rollingPeriod */ + rollingPeriod?: (google.protobuf.IDuration|null); - /** UpdateServiceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ServiceLevelObjective calendarPeriod */ + calendarPeriod?: (google.type.CalendarPeriod|keyof typeof google.type.CalendarPeriod|null); } - /** Represents an UpdateServiceRequest. */ - class UpdateServiceRequest implements IUpdateServiceRequest { + /** Represents a ServiceLevelObjective. */ + class ServiceLevelObjective implements IServiceLevelObjective { /** - * Constructs a new UpdateServiceRequest. + * Constructs a new ServiceLevelObjective. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IUpdateServiceRequest); + constructor(properties?: google.monitoring.v3.IServiceLevelObjective); - /** UpdateServiceRequest service. */ - public service?: (google.monitoring.v3.IService|null); + /** ServiceLevelObjective name. */ + public name: string; - /** UpdateServiceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ServiceLevelObjective displayName. */ + public displayName: string; + + /** ServiceLevelObjective serviceLevelIndicator. */ + public serviceLevelIndicator?: (google.monitoring.v3.IServiceLevelIndicator|null); + + /** ServiceLevelObjective goal. */ + public goal: number; + + /** ServiceLevelObjective rollingPeriod. */ + public rollingPeriod?: (google.protobuf.IDuration|null); + + /** ServiceLevelObjective calendarPeriod. */ + public calendarPeriod: (google.type.CalendarPeriod|keyof typeof google.type.CalendarPeriod); + + /** ServiceLevelObjective period. */ + public period?: ("rollingPeriod"|"calendarPeriod"); /** - * Creates a new UpdateServiceRequest instance using the specified properties. + * Creates a new ServiceLevelObjective instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateServiceRequest instance + * @returns ServiceLevelObjective instance */ - public static create(properties?: google.monitoring.v3.IUpdateServiceRequest): google.monitoring.v3.UpdateServiceRequest; + public static create(properties?: google.monitoring.v3.IServiceLevelObjective): google.monitoring.v3.ServiceLevelObjective; /** - * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. - * @param message UpdateServiceRequest message or plain object to encode + * Encodes the specified ServiceLevelObjective message. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * @param message ServiceLevelObjective message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IServiceLevelObjective, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. - * @param message UpdateServiceRequest message or plain object to encode + * Encodes the specified ServiceLevelObjective message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * @param message ServiceLevelObjective message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IServiceLevelObjective, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * Decodes a ServiceLevelObjective message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateServiceRequest + * @returns ServiceLevelObjective * @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.monitoring.v3.UpdateServiceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ServiceLevelObjective; /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * Decodes a ServiceLevelObjective message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateServiceRequest + * @returns ServiceLevelObjective * @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.monitoring.v3.UpdateServiceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ServiceLevelObjective; /** - * Verifies an UpdateServiceRequest message. + * Verifies a ServiceLevelObjective 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 UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceLevelObjective message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateServiceRequest + * @returns ServiceLevelObjective */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateServiceRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ServiceLevelObjective; /** - * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. - * @param message UpdateServiceRequest + * Creates a plain object from a ServiceLevelObjective message. Also converts values to other types if specified. + * @param message ServiceLevelObjective * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ServiceLevelObjective, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateServiceRequest to JSON. + * Converts this ServiceLevelObjective to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteServiceRequest. */ - interface IDeleteServiceRequest { + namespace ServiceLevelObjective { - /** DeleteServiceRequest name */ - name?: (string|null); + /** View enum. */ + enum View { + VIEW_UNSPECIFIED = 0, + FULL = 2, + EXPLICIT = 1 + } } - /** Represents a DeleteServiceRequest. */ - class DeleteServiceRequest implements IDeleteServiceRequest { + /** Properties of a ServiceLevelIndicator. */ + interface IServiceLevelIndicator { + + /** ServiceLevelIndicator basicSli */ + basicSli?: (google.monitoring.v3.IBasicSli|null); + + /** ServiceLevelIndicator requestBased */ + requestBased?: (google.monitoring.v3.IRequestBasedSli|null); + + /** ServiceLevelIndicator windowsBased */ + windowsBased?: (google.monitoring.v3.IWindowsBasedSli|null); + } + + /** Represents a ServiceLevelIndicator. */ + class ServiceLevelIndicator implements IServiceLevelIndicator { /** - * Constructs a new DeleteServiceRequest. + * Constructs a new ServiceLevelIndicator. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IDeleteServiceRequest); + constructor(properties?: google.monitoring.v3.IServiceLevelIndicator); - /** DeleteServiceRequest name. */ - public name: string; + /** ServiceLevelIndicator basicSli. */ + public basicSli?: (google.monitoring.v3.IBasicSli|null); + + /** ServiceLevelIndicator requestBased. */ + public requestBased?: (google.monitoring.v3.IRequestBasedSli|null); + + /** ServiceLevelIndicator windowsBased. */ + public windowsBased?: (google.monitoring.v3.IWindowsBasedSli|null); + + /** ServiceLevelIndicator type. */ + public type?: ("basicSli"|"requestBased"|"windowsBased"); /** - * Creates a new DeleteServiceRequest instance using the specified properties. + * Creates a new ServiceLevelIndicator instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteServiceRequest instance + * @returns ServiceLevelIndicator instance */ - public static create(properties?: google.monitoring.v3.IDeleteServiceRequest): google.monitoring.v3.DeleteServiceRequest; + public static create(properties?: google.monitoring.v3.IServiceLevelIndicator): google.monitoring.v3.ServiceLevelIndicator; /** - * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. - * @param message DeleteServiceRequest message or plain object to encode + * Encodes the specified ServiceLevelIndicator message. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * @param message ServiceLevelIndicator message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IServiceLevelIndicator, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. - * @param message DeleteServiceRequest message or plain object to encode + * Encodes the specified ServiceLevelIndicator message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * @param message ServiceLevelIndicator message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IServiceLevelIndicator, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * Decodes a ServiceLevelIndicator message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteServiceRequest + * @returns ServiceLevelIndicator * @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.monitoring.v3.DeleteServiceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ServiceLevelIndicator; /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * Decodes a ServiceLevelIndicator message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteServiceRequest + * @returns ServiceLevelIndicator * @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.monitoring.v3.DeleteServiceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ServiceLevelIndicator; /** - * Verifies a DeleteServiceRequest message. + * Verifies a ServiceLevelIndicator 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 DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceLevelIndicator message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteServiceRequest + * @returns ServiceLevelIndicator */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteServiceRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ServiceLevelIndicator; /** - * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. - * @param message DeleteServiceRequest + * Creates a plain object from a ServiceLevelIndicator message. Also converts values to other types if specified. + * @param message ServiceLevelIndicator * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ServiceLevelIndicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteServiceRequest to JSON. + * Converts this ServiceLevelIndicator to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateServiceLevelObjectiveRequest. */ - interface ICreateServiceLevelObjectiveRequest { + /** Properties of a BasicSli. */ + interface IBasicSli { - /** CreateServiceLevelObjectiveRequest parent */ - parent?: (string|null); + /** BasicSli method */ + method?: (string[]|null); - /** CreateServiceLevelObjectiveRequest serviceLevelObjectiveId */ - serviceLevelObjectiveId?: (string|null); + /** BasicSli location */ + location?: (string[]|null); - /** CreateServiceLevelObjectiveRequest serviceLevelObjective */ - serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + /** BasicSli version */ + version?: (string[]|null); + + /** BasicSli availability */ + availability?: (google.monitoring.v3.BasicSli.IAvailabilityCriteria|null); + + /** BasicSli latency */ + latency?: (google.monitoring.v3.BasicSli.ILatencyCriteria|null); } - /** Represents a CreateServiceLevelObjectiveRequest. */ - class CreateServiceLevelObjectiveRequest implements ICreateServiceLevelObjectiveRequest { + /** Represents a BasicSli. */ + class BasicSli implements IBasicSli { /** - * Constructs a new CreateServiceLevelObjectiveRequest. + * Constructs a new BasicSli. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ICreateServiceLevelObjectiveRequest); + constructor(properties?: google.monitoring.v3.IBasicSli); - /** CreateServiceLevelObjectiveRequest parent. */ - public parent: string; + /** BasicSli method. */ + public method: string[]; - /** CreateServiceLevelObjectiveRequest serviceLevelObjectiveId. */ - public serviceLevelObjectiveId: string; + /** BasicSli location. */ + public location: string[]; - /** CreateServiceLevelObjectiveRequest serviceLevelObjective. */ - public serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + /** BasicSli version. */ + public version: string[]; + + /** BasicSli availability. */ + public availability?: (google.monitoring.v3.BasicSli.IAvailabilityCriteria|null); + + /** BasicSli latency. */ + public latency?: (google.monitoring.v3.BasicSli.ILatencyCriteria|null); + + /** BasicSli sliCriteria. */ + public sliCriteria?: ("availability"|"latency"); /** - * Creates a new CreateServiceLevelObjectiveRequest instance using the specified properties. + * Creates a new BasicSli instance using the specified properties. * @param [properties] Properties to set - * @returns CreateServiceLevelObjectiveRequest instance + * @returns BasicSli instance */ - public static create(properties?: google.monitoring.v3.ICreateServiceLevelObjectiveRequest): google.monitoring.v3.CreateServiceLevelObjectiveRequest; + public static create(properties?: google.monitoring.v3.IBasicSli): google.monitoring.v3.BasicSli; /** - * Encodes the specified CreateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. - * @param message CreateServiceLevelObjectiveRequest message or plain object to encode + * Encodes the specified BasicSli message. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @param message BasicSli message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IBasicSli, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. - * @param message CreateServiceLevelObjectiveRequest message or plain object to encode + * Encodes the specified BasicSli message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @param message BasicSli message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IBasicSli, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer. + * Decodes a BasicSli message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateServiceLevelObjectiveRequest + * @returns BasicSli * @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.monitoring.v3.CreateServiceLevelObjectiveRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.BasicSli; /** - * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * Decodes a BasicSli message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateServiceLevelObjectiveRequest + * @returns BasicSli * @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.monitoring.v3.CreateServiceLevelObjectiveRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.BasicSli; /** - * Verifies a CreateServiceLevelObjectiveRequest message. + * Verifies a BasicSli 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 CreateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BasicSli message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateServiceLevelObjectiveRequest + * @returns BasicSli */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateServiceLevelObjectiveRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli; /** - * Creates a plain object from a CreateServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @param message CreateServiceLevelObjectiveRequest + * Creates a plain object from a BasicSli message. Also converts values to other types if specified. + * @param message BasicSli * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.CreateServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.BasicSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateServiceLevelObjectiveRequest to JSON. + * Converts this BasicSli to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetServiceLevelObjectiveRequest. */ - interface IGetServiceLevelObjectiveRequest { + namespace BasicSli { + + /** Properties of an AvailabilityCriteria. */ + interface IAvailabilityCriteria { + } + + /** Represents an AvailabilityCriteria. */ + class AvailabilityCriteria implements IAvailabilityCriteria { + + /** + * Constructs a new AvailabilityCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.BasicSli.IAvailabilityCriteria); + + /** + * Creates a new AvailabilityCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns AvailabilityCriteria instance + */ + public static create(properties?: google.monitoring.v3.BasicSli.IAvailabilityCriteria): google.monitoring.v3.BasicSli.AvailabilityCriteria; + + /** + * Encodes the specified AvailabilityCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @param message AvailabilityCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.BasicSli.IAvailabilityCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvailabilityCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @param message AvailabilityCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.BasicSli.IAvailabilityCriteria, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvailabilityCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvailabilityCriteria + * @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.monitoring.v3.BasicSli.AvailabilityCriteria; + + /** + * Decodes an AvailabilityCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvailabilityCriteria + * @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.monitoring.v3.BasicSli.AvailabilityCriteria; - /** GetServiceLevelObjectiveRequest name */ - name?: (string|null); + /** + * Verifies an AvailabilityCriteria 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); - /** GetServiceLevelObjectiveRequest view */ - view?: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View|null); - } + /** + * Creates an AvailabilityCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvailabilityCriteria + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli.AvailabilityCriteria; - /** Represents a GetServiceLevelObjectiveRequest. */ - class GetServiceLevelObjectiveRequest implements IGetServiceLevelObjectiveRequest { + /** + * Creates a plain object from an AvailabilityCriteria message. Also converts values to other types if specified. + * @param message AvailabilityCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.BasicSli.AvailabilityCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new GetServiceLevelObjectiveRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IGetServiceLevelObjectiveRequest); + /** + * Converts this AvailabilityCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** GetServiceLevelObjectiveRequest name. */ - public name: string; + /** Properties of a LatencyCriteria. */ + interface ILatencyCriteria { - /** GetServiceLevelObjectiveRequest view. */ - public view: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View); + /** LatencyCriteria threshold */ + threshold?: (google.protobuf.IDuration|null); + } - /** - * Creates a new GetServiceLevelObjectiveRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetServiceLevelObjectiveRequest instance - */ - public static create(properties?: google.monitoring.v3.IGetServiceLevelObjectiveRequest): google.monitoring.v3.GetServiceLevelObjectiveRequest; + /** Represents a LatencyCriteria. */ + class LatencyCriteria implements ILatencyCriteria { - /** - * Encodes the specified GetServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. - * @param message GetServiceLevelObjectiveRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IGetServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new LatencyCriteria. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.BasicSli.ILatencyCriteria); - /** - * Encodes the specified GetServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. - * @param message GetServiceLevelObjectiveRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IGetServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** LatencyCriteria threshold. */ + public threshold?: (google.protobuf.IDuration|null); - /** - * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetServiceLevelObjectiveRequest - * @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.monitoring.v3.GetServiceLevelObjectiveRequest; + /** + * Creates a new LatencyCriteria instance using the specified properties. + * @param [properties] Properties to set + * @returns LatencyCriteria instance + */ + public static create(properties?: google.monitoring.v3.BasicSli.ILatencyCriteria): google.monitoring.v3.BasicSli.LatencyCriteria; - /** - * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetServiceLevelObjectiveRequest - * @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.monitoring.v3.GetServiceLevelObjectiveRequest; + /** + * Encodes the specified LatencyCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * @param message LatencyCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.BasicSli.ILatencyCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a GetServiceLevelObjectiveRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified LatencyCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * @param message LatencyCriteria message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.BasicSli.ILatencyCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a GetServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetServiceLevelObjectiveRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetServiceLevelObjectiveRequest; + /** + * Decodes a LatencyCriteria message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatencyCriteria + * @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.monitoring.v3.BasicSli.LatencyCriteria; - /** - * Creates a plain object from a GetServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @param message GetServiceLevelObjectiveRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.GetServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a LatencyCriteria message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatencyCriteria + * @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.monitoring.v3.BasicSli.LatencyCriteria; - /** - * Converts this GetServiceLevelObjectiveRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a LatencyCriteria message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a ListServiceLevelObjectivesRequest. */ - interface IListServiceLevelObjectivesRequest { + /** + * Creates a LatencyCriteria message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatencyCriteria + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli.LatencyCriteria; - /** ListServiceLevelObjectivesRequest parent */ - parent?: (string|null); + /** + * Creates a plain object from a LatencyCriteria message. Also converts values to other types if specified. + * @param message LatencyCriteria + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.BasicSli.LatencyCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListServiceLevelObjectivesRequest filter */ - filter?: (string|null); + /** + * Converts this LatencyCriteria to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** ListServiceLevelObjectivesRequest pageSize */ - pageSize?: (number|null); + /** Properties of a Range. */ + interface IRange { - /** ListServiceLevelObjectivesRequest pageToken */ - pageToken?: (string|null); + /** Range min */ + min?: (number|null); - /** ListServiceLevelObjectivesRequest view */ - view?: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View|null); + /** Range max */ + max?: (number|null); } - /** Represents a ListServiceLevelObjectivesRequest. */ - class ListServiceLevelObjectivesRequest implements IListServiceLevelObjectivesRequest { + /** Represents a Range. */ + class Range implements IRange { /** - * Constructs a new ListServiceLevelObjectivesRequest. + * Constructs a new Range. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListServiceLevelObjectivesRequest); - - /** ListServiceLevelObjectivesRequest parent. */ - public parent: string; - - /** ListServiceLevelObjectivesRequest filter. */ - public filter: string; - - /** ListServiceLevelObjectivesRequest pageSize. */ - public pageSize: number; + constructor(properties?: google.monitoring.v3.IRange); - /** ListServiceLevelObjectivesRequest pageToken. */ - public pageToken: string; + /** Range min. */ + public min: number; - /** ListServiceLevelObjectivesRequest view. */ - public view: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View); + /** Range max. */ + public max: number; /** - * Creates a new ListServiceLevelObjectivesRequest instance using the specified properties. + * Creates a new Range instance using the specified properties. * @param [properties] Properties to set - * @returns ListServiceLevelObjectivesRequest instance + * @returns Range instance */ - public static create(properties?: google.monitoring.v3.IListServiceLevelObjectivesRequest): google.monitoring.v3.ListServiceLevelObjectivesRequest; + public static create(properties?: google.monitoring.v3.IRange): google.monitoring.v3.Range; /** - * Encodes the specified ListServiceLevelObjectivesRequest message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. - * @param message ListServiceLevelObjectivesRequest message or plain object to encode + * Encodes the specified Range message. Does not implicitly {@link google.monitoring.v3.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.monitoring.v3.IListServiceLevelObjectivesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListServiceLevelObjectivesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. - * @param message ListServiceLevelObjectivesRequest message or plain object to encode + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.monitoring.v3.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.monitoring.v3.IListServiceLevelObjectivesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer. + * 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 ListServiceLevelObjectivesRequest + * @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.monitoring.v3.ListServiceLevelObjectivesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.Range; /** - * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer, length delimited. + * Decodes a Range message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListServiceLevelObjectivesRequest + * @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.monitoring.v3.ListServiceLevelObjectivesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.Range; /** - * Verifies a ListServiceLevelObjectivesRequest message. + * 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 ListServiceLevelObjectivesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Range message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListServiceLevelObjectivesRequest + * @returns Range */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServiceLevelObjectivesRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Range; /** - * Creates a plain object from a ListServiceLevelObjectivesRequest message. Also converts values to other types if specified. - * @param message ListServiceLevelObjectivesRequest + * 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.monitoring.v3.ListServiceLevelObjectivesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListServiceLevelObjectivesRequest to JSON. + * Converts this Range to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListServiceLevelObjectivesResponse. */ - interface IListServiceLevelObjectivesResponse { + /** Properties of a RequestBasedSli. */ + interface IRequestBasedSli { - /** ListServiceLevelObjectivesResponse serviceLevelObjectives */ - serviceLevelObjectives?: (google.monitoring.v3.IServiceLevelObjective[]|null); + /** RequestBasedSli goodTotalRatio */ + goodTotalRatio?: (google.monitoring.v3.ITimeSeriesRatio|null); - /** ListServiceLevelObjectivesResponse nextPageToken */ - nextPageToken?: (string|null); + /** RequestBasedSli distributionCut */ + distributionCut?: (google.monitoring.v3.IDistributionCut|null); } - /** Represents a ListServiceLevelObjectivesResponse. */ - class ListServiceLevelObjectivesResponse implements IListServiceLevelObjectivesResponse { + /** Represents a RequestBasedSli. */ + class RequestBasedSli implements IRequestBasedSli { /** - * Constructs a new ListServiceLevelObjectivesResponse. + * Constructs a new RequestBasedSli. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListServiceLevelObjectivesResponse); + constructor(properties?: google.monitoring.v3.IRequestBasedSli); - /** ListServiceLevelObjectivesResponse serviceLevelObjectives. */ - public serviceLevelObjectives: google.monitoring.v3.IServiceLevelObjective[]; + /** RequestBasedSli goodTotalRatio. */ + public goodTotalRatio?: (google.monitoring.v3.ITimeSeriesRatio|null); - /** ListServiceLevelObjectivesResponse nextPageToken. */ - public nextPageToken: string; + /** RequestBasedSli distributionCut. */ + public distributionCut?: (google.monitoring.v3.IDistributionCut|null); + + /** RequestBasedSli method. */ + public method?: ("goodTotalRatio"|"distributionCut"); /** - * Creates a new ListServiceLevelObjectivesResponse instance using the specified properties. + * Creates a new RequestBasedSli instance using the specified properties. * @param [properties] Properties to set - * @returns ListServiceLevelObjectivesResponse instance + * @returns RequestBasedSli instance */ - public static create(properties?: google.monitoring.v3.IListServiceLevelObjectivesResponse): google.monitoring.v3.ListServiceLevelObjectivesResponse; + public static create(properties?: google.monitoring.v3.IRequestBasedSli): google.monitoring.v3.RequestBasedSli; /** - * Encodes the specified ListServiceLevelObjectivesResponse message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. - * @param message ListServiceLevelObjectivesResponse message or plain object to encode + * Encodes the specified RequestBasedSli message. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * @param message RequestBasedSli message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListServiceLevelObjectivesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IRequestBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListServiceLevelObjectivesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. - * @param message ListServiceLevelObjectivesResponse message or plain object to encode + * Encodes the specified RequestBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * @param message RequestBasedSli message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListServiceLevelObjectivesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IRequestBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer. + * Decodes a RequestBasedSli message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListServiceLevelObjectivesResponse + * @returns RequestBasedSli * @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.monitoring.v3.ListServiceLevelObjectivesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.RequestBasedSli; /** - * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer, length delimited. + * Decodes a RequestBasedSli message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListServiceLevelObjectivesResponse + * @returns RequestBasedSli * @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.monitoring.v3.ListServiceLevelObjectivesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.RequestBasedSli; /** - * Verifies a ListServiceLevelObjectivesResponse message. + * Verifies a RequestBasedSli 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 ListServiceLevelObjectivesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RequestBasedSli message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListServiceLevelObjectivesResponse + * @returns RequestBasedSli */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServiceLevelObjectivesResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.RequestBasedSli; /** - * Creates a plain object from a ListServiceLevelObjectivesResponse message. Also converts values to other types if specified. - * @param message ListServiceLevelObjectivesResponse + * Creates a plain object from a RequestBasedSli message. Also converts values to other types if specified. + * @param message RequestBasedSli * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListServiceLevelObjectivesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.RequestBasedSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListServiceLevelObjectivesResponse to JSON. + * Converts this RequestBasedSli to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateServiceLevelObjectiveRequest. */ - interface IUpdateServiceLevelObjectiveRequest { + /** Properties of a TimeSeriesRatio. */ + interface ITimeSeriesRatio { - /** UpdateServiceLevelObjectiveRequest serviceLevelObjective */ - serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + /** TimeSeriesRatio goodServiceFilter */ + goodServiceFilter?: (string|null); - /** UpdateServiceLevelObjectiveRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** TimeSeriesRatio badServiceFilter */ + badServiceFilter?: (string|null); + + /** TimeSeriesRatio totalServiceFilter */ + totalServiceFilter?: (string|null); } - /** Represents an UpdateServiceLevelObjectiveRequest. */ - class UpdateServiceLevelObjectiveRequest implements IUpdateServiceLevelObjectiveRequest { + /** Represents a TimeSeriesRatio. */ + class TimeSeriesRatio implements ITimeSeriesRatio { /** - * Constructs a new UpdateServiceLevelObjectiveRequest. + * Constructs a new TimeSeriesRatio. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest); + constructor(properties?: google.monitoring.v3.ITimeSeriesRatio); - /** UpdateServiceLevelObjectiveRequest serviceLevelObjective. */ - public serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + /** TimeSeriesRatio goodServiceFilter. */ + public goodServiceFilter: string; - /** UpdateServiceLevelObjectiveRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** TimeSeriesRatio badServiceFilter. */ + public badServiceFilter: string; + + /** TimeSeriesRatio totalServiceFilter. */ + public totalServiceFilter: string; /** - * Creates a new UpdateServiceLevelObjectiveRequest instance using the specified properties. + * Creates a new TimeSeriesRatio instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateServiceLevelObjectiveRequest instance + * @returns TimeSeriesRatio instance */ - public static create(properties?: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; + public static create(properties?: google.monitoring.v3.ITimeSeriesRatio): google.monitoring.v3.TimeSeriesRatio; /** - * Encodes the specified UpdateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. - * @param message UpdateServiceLevelObjectiveRequest message or plain object to encode + * Encodes the specified TimeSeriesRatio message. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * @param message TimeSeriesRatio message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ITimeSeriesRatio, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. - * @param message UpdateServiceLevelObjectiveRequest message or plain object to encode + * Encodes the specified TimeSeriesRatio message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * @param message TimeSeriesRatio message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ITimeSeriesRatio, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer. + * Decodes a TimeSeriesRatio message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateServiceLevelObjectiveRequest + * @returns TimeSeriesRatio * @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.monitoring.v3.UpdateServiceLevelObjectiveRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.TimeSeriesRatio; /** - * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeSeriesRatio message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateServiceLevelObjectiveRequest + * @returns TimeSeriesRatio * @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.monitoring.v3.UpdateServiceLevelObjectiveRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.TimeSeriesRatio; /** - * Verifies an UpdateServiceLevelObjectiveRequest message. + * Verifies a TimeSeriesRatio 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 UpdateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeSeriesRatio message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateServiceLevelObjectiveRequest + * @returns TimeSeriesRatio */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeSeriesRatio; /** - * Creates a plain object from an UpdateServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @param message UpdateServiceLevelObjectiveRequest + * Creates a plain object from a TimeSeriesRatio message. Also converts values to other types if specified. + * @param message TimeSeriesRatio * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.UpdateServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.TimeSeriesRatio, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateServiceLevelObjectiveRequest to JSON. + * Converts this TimeSeriesRatio to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteServiceLevelObjectiveRequest. */ - interface IDeleteServiceLevelObjectiveRequest { + /** Properties of a DistributionCut. */ + interface IDistributionCut { - /** DeleteServiceLevelObjectiveRequest name */ - name?: (string|null); + /** DistributionCut distributionFilter */ + distributionFilter?: (string|null); + + /** DistributionCut range */ + range?: (google.monitoring.v3.IRange|null); } - /** Represents a DeleteServiceLevelObjectiveRequest. */ - class DeleteServiceLevelObjectiveRequest implements IDeleteServiceLevelObjectiveRequest { + /** Represents a DistributionCut. */ + class DistributionCut implements IDistributionCut { /** - * Constructs a new DeleteServiceLevelObjectiveRequest. + * Constructs a new DistributionCut. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest); + constructor(properties?: google.monitoring.v3.IDistributionCut); - /** DeleteServiceLevelObjectiveRequest name. */ - public name: string; + /** DistributionCut distributionFilter. */ + public distributionFilter: string; + + /** DistributionCut range. */ + public range?: (google.monitoring.v3.IRange|null); /** - * Creates a new DeleteServiceLevelObjectiveRequest instance using the specified properties. + * Creates a new DistributionCut instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteServiceLevelObjectiveRequest instance + * @returns DistributionCut instance */ - public static create(properties?: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; + public static create(properties?: google.monitoring.v3.IDistributionCut): google.monitoring.v3.DistributionCut; /** - * Encodes the specified DeleteServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. - * @param message DeleteServiceLevelObjectiveRequest message or plain object to encode + * Encodes the specified DistributionCut message. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @param message DistributionCut message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IDistributionCut, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. - * @param message DeleteServiceLevelObjectiveRequest message or plain object to encode + * Encodes the specified DistributionCut message, length delimited. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @param message DistributionCut message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IDistributionCut, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer. + * Decodes a DistributionCut message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteServiceLevelObjectiveRequest + * @returns DistributionCut * @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.monitoring.v3.DeleteServiceLevelObjectiveRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DistributionCut; /** - * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * Decodes a DistributionCut message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteServiceLevelObjectiveRequest + * @returns DistributionCut * @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.monitoring.v3.DeleteServiceLevelObjectiveRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DistributionCut; /** - * Verifies a DeleteServiceLevelObjectiveRequest message. + * Verifies a DistributionCut 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 DeleteServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DistributionCut message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteServiceLevelObjectiveRequest + * @returns DistributionCut */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DistributionCut; /** - * Creates a plain object from a DeleteServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @param message DeleteServiceLevelObjectiveRequest + * Creates a plain object from a DistributionCut message. Also converts values to other types if specified. + * @param message DistributionCut * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.DeleteServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.DistributionCut, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteServiceLevelObjectiveRequest to JSON. + * Converts this DistributionCut to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Service. */ - interface IService { - - /** Service name */ - name?: (string|null); - - /** Service displayName */ - displayName?: (string|null); + /** Properties of a WindowsBasedSli. */ + interface IWindowsBasedSli { - /** Service custom */ - custom?: (google.monitoring.v3.Service.ICustom|null); + /** WindowsBasedSli goodBadMetricFilter */ + goodBadMetricFilter?: (string|null); - /** Service appEngine */ - appEngine?: (google.monitoring.v3.Service.IAppEngine|null); + /** WindowsBasedSli goodTotalRatioThreshold */ + goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); - /** Service cloudEndpoints */ - cloudEndpoints?: (google.monitoring.v3.Service.ICloudEndpoints|null); + /** WindowsBasedSli metricMeanInRange */ + metricMeanInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); - /** Service clusterIstio */ - clusterIstio?: (google.monitoring.v3.Service.IClusterIstio|null); + /** WindowsBasedSli metricSumInRange */ + metricSumInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); - /** Service telemetry */ - telemetry?: (google.monitoring.v3.Service.ITelemetry|null); + /** WindowsBasedSli windowPeriod */ + windowPeriod?: (google.protobuf.IDuration|null); } - /** Represents a Service. */ - class Service implements IService { + /** Represents a WindowsBasedSli. */ + class WindowsBasedSli implements IWindowsBasedSli { /** - * Constructs a new Service. + * Constructs a new WindowsBasedSli. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IService); - - /** Service name. */ - public name: string; - - /** Service displayName. */ - public displayName: string; + constructor(properties?: google.monitoring.v3.IWindowsBasedSli); - /** Service custom. */ - public custom?: (google.monitoring.v3.Service.ICustom|null); + /** WindowsBasedSli goodBadMetricFilter. */ + public goodBadMetricFilter: string; - /** Service appEngine. */ - public appEngine?: (google.monitoring.v3.Service.IAppEngine|null); + /** WindowsBasedSli goodTotalRatioThreshold. */ + public goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); - /** Service cloudEndpoints. */ - public cloudEndpoints?: (google.monitoring.v3.Service.ICloudEndpoints|null); + /** WindowsBasedSli metricMeanInRange. */ + public metricMeanInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); - /** Service clusterIstio. */ - public clusterIstio?: (google.monitoring.v3.Service.IClusterIstio|null); + /** WindowsBasedSli metricSumInRange. */ + public metricSumInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); - /** Service telemetry. */ - public telemetry?: (google.monitoring.v3.Service.ITelemetry|null); + /** WindowsBasedSli windowPeriod. */ + public windowPeriod?: (google.protobuf.IDuration|null); - /** Service identifier. */ - public identifier?: ("custom"|"appEngine"|"cloudEndpoints"|"clusterIstio"); + /** WindowsBasedSli windowCriterion. */ + public windowCriterion?: ("goodBadMetricFilter"|"goodTotalRatioThreshold"|"metricMeanInRange"|"metricSumInRange"); /** - * Creates a new Service instance using the specified properties. + * Creates a new WindowsBasedSli instance using the specified properties. * @param [properties] Properties to set - * @returns Service instance + * @returns WindowsBasedSli instance */ - public static create(properties?: google.monitoring.v3.IService): google.monitoring.v3.Service; + public static create(properties?: google.monitoring.v3.IWindowsBasedSli): google.monitoring.v3.WindowsBasedSli; /** - * Encodes the specified Service message. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. - * @param message Service message or plain object to encode + * Encodes the specified WindowsBasedSli message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * @param message WindowsBasedSli message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IService, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IWindowsBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. - * @param message Service message or plain object to encode + * Encodes the specified WindowsBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * @param message WindowsBasedSli message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IService, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IWindowsBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Service message from the specified reader or buffer. + * Decodes a WindowsBasedSli message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Service + * @returns WindowsBasedSli * @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.monitoring.v3.Service; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.WindowsBasedSli; /** - * Decodes a Service message from the specified reader or buffer, length delimited. + * Decodes a WindowsBasedSli message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Service + * @returns WindowsBasedSli * @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.monitoring.v3.Service; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.WindowsBasedSli; /** - * Verifies a Service message. + * Verifies a WindowsBasedSli 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 Service message from a plain object. Also converts values to their respective internal types. + * Creates a WindowsBasedSli message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Service + * @returns WindowsBasedSli */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli; /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @param message Service + * Creates a plain object from a WindowsBasedSli message. Also converts values to other types if specified. + * @param message WindowsBasedSli * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.WindowsBasedSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Service to JSON. + * Converts this WindowsBasedSli to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Service { - - /** Properties of a Custom. */ - interface ICustom { - } - - /** Represents a Custom. */ - class Custom implements ICustom { - - /** - * Constructs a new Custom. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.Service.ICustom); - - /** - * Creates a new Custom instance using the specified properties. - * @param [properties] Properties to set - * @returns Custom instance - */ - public static create(properties?: google.monitoring.v3.Service.ICustom): google.monitoring.v3.Service.Custom; - - /** - * Encodes the specified Custom message. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. - * @param message Custom message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.Service.ICustom, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Custom message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. - * @param message Custom message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.Service.ICustom, writer?: $protobuf.Writer): $protobuf.Writer; + namespace WindowsBasedSli { - /** - * Decodes a Custom message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Custom - * @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.monitoring.v3.Service.Custom; + /** Properties of a PerformanceThreshold. */ + interface IPerformanceThreshold { - /** - * Decodes a Custom message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Custom - * @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.monitoring.v3.Service.Custom; + /** PerformanceThreshold performance */ + performance?: (google.monitoring.v3.IRequestBasedSli|null); - /** - * Verifies a Custom 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); + /** PerformanceThreshold basicSliPerformance */ + basicSliPerformance?: (google.monitoring.v3.IBasicSli|null); - /** - * Creates a Custom message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Custom - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.Custom; + /** PerformanceThreshold threshold */ + threshold?: (number|null); + } - /** - * Creates a plain object from a Custom message. Also converts values to other types if specified. - * @param message Custom - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.Service.Custom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a PerformanceThreshold. */ + class PerformanceThreshold implements IPerformanceThreshold { /** - * Converts this Custom to JSON. - * @returns JSON object + * Constructs a new PerformanceThreshold. + * @param [properties] Properties to set */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AppEngine. */ - interface IAppEngine { + constructor(properties?: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold); - /** AppEngine moduleId */ - moduleId?: (string|null); - } + /** PerformanceThreshold performance. */ + public performance?: (google.monitoring.v3.IRequestBasedSli|null); - /** Represents an AppEngine. */ - class AppEngine implements IAppEngine { + /** PerformanceThreshold basicSliPerformance. */ + public basicSliPerformance?: (google.monitoring.v3.IBasicSli|null); - /** - * Constructs a new AppEngine. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.Service.IAppEngine); + /** PerformanceThreshold threshold. */ + public threshold: number; - /** AppEngine moduleId. */ - public moduleId: string; + /** PerformanceThreshold type. */ + public type?: ("performance"|"basicSliPerformance"); /** - * Creates a new AppEngine instance using the specified properties. + * Creates a new PerformanceThreshold instance using the specified properties. * @param [properties] Properties to set - * @returns AppEngine instance + * @returns PerformanceThreshold instance */ - public static create(properties?: google.monitoring.v3.Service.IAppEngine): google.monitoring.v3.Service.AppEngine; + public static create(properties?: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; /** - * Encodes the specified AppEngine message. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. - * @param message AppEngine message or plain object to encode + * Encodes the specified PerformanceThreshold message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. + * @param message PerformanceThreshold message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.Service.IAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppEngine message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. - * @param message AppEngine message or plain object to encode + * Encodes the specified PerformanceThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. + * @param message PerformanceThreshold message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.Service.IAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppEngine message from the specified reader or buffer. + * Decodes a PerformanceThreshold message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppEngine + * @returns PerformanceThreshold * @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.monitoring.v3.Service.AppEngine; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; /** - * Decodes an AppEngine message from the specified reader or buffer, length delimited. + * Decodes a PerformanceThreshold message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppEngine + * @returns PerformanceThreshold * @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.monitoring.v3.Service.AppEngine; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; /** - * Verifies an AppEngine message. + * Verifies a PerformanceThreshold 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 AppEngine message from a plain object. Also converts values to their respective internal types. + * Creates a PerformanceThreshold message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppEngine + * @returns PerformanceThreshold */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.AppEngine; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; /** - * Creates a plain object from an AppEngine message. Also converts values to other types if specified. - * @param message AppEngine + * Creates a plain object from a PerformanceThreshold message. Also converts values to other types if specified. + * @param message PerformanceThreshold * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Service.AppEngine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.WindowsBasedSli.PerformanceThreshold, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppEngine to JSON. + * Converts this PerformanceThreshold to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CloudEndpoints. */ - interface ICloudEndpoints { + /** Properties of a MetricRange. */ + interface IMetricRange { - /** CloudEndpoints service */ - service?: (string|null); + /** MetricRange timeSeries */ + timeSeries?: (string|null); + + /** MetricRange range */ + range?: (google.monitoring.v3.IRange|null); } - /** Represents a CloudEndpoints. */ - class CloudEndpoints implements ICloudEndpoints { + /** Represents a MetricRange. */ + class MetricRange implements IMetricRange { /** - * Constructs a new CloudEndpoints. + * Constructs a new MetricRange. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.Service.ICloudEndpoints); + constructor(properties?: google.monitoring.v3.WindowsBasedSli.IMetricRange); - /** CloudEndpoints service. */ - public service: string; + /** MetricRange timeSeries. */ + public timeSeries: string; + + /** MetricRange range. */ + public range?: (google.monitoring.v3.IRange|null); /** - * Creates a new CloudEndpoints instance using the specified properties. + * Creates a new MetricRange instance using the specified properties. * @param [properties] Properties to set - * @returns CloudEndpoints instance + * @returns MetricRange instance */ - public static create(properties?: google.monitoring.v3.Service.ICloudEndpoints): google.monitoring.v3.Service.CloudEndpoints; + public static create(properties?: google.monitoring.v3.WindowsBasedSli.IMetricRange): google.monitoring.v3.WindowsBasedSli.MetricRange; /** - * Encodes the specified CloudEndpoints message. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. - * @param message CloudEndpoints message or plain object to encode + * Encodes the specified MetricRange message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. + * @param message MetricRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.Service.ICloudEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.WindowsBasedSli.IMetricRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CloudEndpoints message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. - * @param message CloudEndpoints message or plain object to encode + * Encodes the specified MetricRange message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. + * @param message MetricRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.Service.ICloudEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.WindowsBasedSli.IMetricRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CloudEndpoints message from the specified reader or buffer. + * Decodes a MetricRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CloudEndpoints + * @returns MetricRange * @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.monitoring.v3.Service.CloudEndpoints; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.WindowsBasedSli.MetricRange; /** - * Decodes a CloudEndpoints message from the specified reader or buffer, length delimited. + * Decodes a MetricRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CloudEndpoints + * @returns MetricRange * @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.monitoring.v3.Service.CloudEndpoints; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.WindowsBasedSli.MetricRange; /** - * Verifies a CloudEndpoints message. + * Verifies a MetricRange 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 CloudEndpoints message from a plain object. Also converts values to their respective internal types. + * Creates a MetricRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CloudEndpoints + * @returns MetricRange */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.CloudEndpoints; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli.MetricRange; /** - * Creates a plain object from a CloudEndpoints message. Also converts values to other types if specified. - * @param message CloudEndpoints + * Creates a plain object from a MetricRange message. Also converts values to other types if specified. + * @param message MetricRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Service.CloudEndpoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.WindowsBasedSli.MetricRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CloudEndpoints to JSON. + * Converts this MetricRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a ClusterIstio. */ - interface IClusterIstio { + /** Represents a ServiceMonitoringService */ + class ServiceMonitoringService extends $protobuf.rpc.Service { - /** ClusterIstio location */ - location?: (string|null); + /** + * Constructs a new ServiceMonitoringService 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); - /** ClusterIstio clusterName */ - clusterName?: (string|null); + /** + * Creates new ServiceMonitoringService 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): ServiceMonitoringService; - /** ClusterIstio serviceNamespace */ - serviceNamespace?: (string|null); + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public createService(request: google.monitoring.v3.ICreateServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.CreateServiceCallback): void; - /** ClusterIstio serviceName */ - serviceName?: (string|null); - } + /** + * Calls CreateService. + * @param request CreateServiceRequest message or plain object + * @returns Promise + */ + public createService(request: google.monitoring.v3.ICreateServiceRequest): Promise; - /** Represents a ClusterIstio. */ - class ClusterIstio implements IClusterIstio { + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public getService(request: google.monitoring.v3.IGetServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.GetServiceCallback): void; - /** - * Constructs a new ClusterIstio. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.Service.IClusterIstio); + /** + * Calls GetService. + * @param request GetServiceRequest message or plain object + * @returns Promise + */ + public getService(request: google.monitoring.v3.IGetServiceRequest): Promise; - /** ClusterIstio location. */ - public location: string; + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServicesResponse + */ + public listServices(request: google.monitoring.v3.IListServicesRequest, callback: google.monitoring.v3.ServiceMonitoringService.ListServicesCallback): void; - /** ClusterIstio clusterName. */ - public clusterName: string; + /** + * Calls ListServices. + * @param request ListServicesRequest message or plain object + * @returns Promise + */ + public listServices(request: google.monitoring.v3.IListServicesRequest): Promise; - /** ClusterIstio serviceNamespace. */ - public serviceNamespace: string; + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Service + */ + public updateService(request: google.monitoring.v3.IUpdateServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.UpdateServiceCallback): void; - /** ClusterIstio serviceName. */ - public serviceName: string; + /** + * Calls UpdateService. + * @param request UpdateServiceRequest message or plain object + * @returns Promise + */ + public updateService(request: google.monitoring.v3.IUpdateServiceRequest): Promise; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteService(request: google.monitoring.v3.IDeleteServiceRequest, callback: google.monitoring.v3.ServiceMonitoringService.DeleteServiceCallback): void; + + /** + * Calls DeleteService. + * @param request DeleteServiceRequest message or plain object + * @returns Promise + */ + public deleteService(request: google.monitoring.v3.IDeleteServiceRequest): Promise; + + /** + * Calls CreateServiceLevelObjective. + * @param request CreateServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + */ + public createServiceLevelObjective(request: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjectiveCallback): void; + + /** + * Calls CreateServiceLevelObjective. + * @param request CreateServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public createServiceLevelObjective(request: google.monitoring.v3.ICreateServiceLevelObjectiveRequest): Promise; + + /** + * Calls GetServiceLevelObjective. + * @param request GetServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + */ + public getServiceLevelObjective(request: google.monitoring.v3.IGetServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjectiveCallback): void; + + /** + * Calls GetServiceLevelObjective. + * @param request GetServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public getServiceLevelObjective(request: google.monitoring.v3.IGetServiceLevelObjectiveRequest): Promise; + + /** + * Calls ListServiceLevelObjectives. + * @param request ListServiceLevelObjectivesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServiceLevelObjectivesResponse + */ + public listServiceLevelObjectives(request: google.monitoring.v3.IListServiceLevelObjectivesRequest, callback: google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectivesCallback): void; + + /** + * Calls ListServiceLevelObjectives. + * @param request ListServiceLevelObjectivesRequest message or plain object + * @returns Promise + */ + public listServiceLevelObjectives(request: google.monitoring.v3.IListServiceLevelObjectivesRequest): Promise; + + /** + * Calls UpdateServiceLevelObjective. + * @param request UpdateServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceLevelObjective + */ + public updateServiceLevelObjective(request: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjectiveCallback): void; + + /** + * Calls UpdateServiceLevelObjective. + * @param request UpdateServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public updateServiceLevelObjective(request: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest): Promise; + + /** + * Calls DeleteServiceLevelObjective. + * @param request DeleteServiceLevelObjectiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteServiceLevelObjective(request: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, callback: google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjectiveCallback): void; + + /** + * Calls DeleteServiceLevelObjective. + * @param request DeleteServiceLevelObjectiveRequest message or plain object + * @returns Promise + */ + public deleteServiceLevelObjective(request: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest): Promise; + } - /** - * Creates a new ClusterIstio instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterIstio instance - */ - public static create(properties?: google.monitoring.v3.Service.IClusterIstio): google.monitoring.v3.Service.ClusterIstio; + namespace ServiceMonitoringService { - /** - * Encodes the specified ClusterIstio message. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. - * @param message ClusterIstio message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.Service.IClusterIstio, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createService}. + * @param error Error, if any + * @param [response] Service + */ + type CreateServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; - /** - * Encodes the specified ClusterIstio message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. - * @param message ClusterIstio message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.Service.IClusterIstio, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getService}. + * @param error Error, if any + * @param [response] Service + */ + type GetServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; - /** - * Decodes a ClusterIstio message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterIstio - * @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.monitoring.v3.Service.ClusterIstio; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServices}. + * @param error Error, if any + * @param [response] ListServicesResponse + */ + type ListServicesCallback = (error: (Error|null), response?: google.monitoring.v3.ListServicesResponse) => void; - /** - * Decodes a ClusterIstio message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterIstio - * @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.monitoring.v3.Service.ClusterIstio; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateService}. + * @param error Error, if any + * @param [response] Service + */ + type UpdateServiceCallback = (error: (Error|null), response?: google.monitoring.v3.Service) => void; - /** - * Verifies a ClusterIstio 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); + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteService}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteServiceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** - * Creates a ClusterIstio message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterIstio - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.ClusterIstio; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createServiceLevelObjective}. + * @param error Error, if any + * @param [response] ServiceLevelObjective + */ + type CreateServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; - /** - * Creates a plain object from a ClusterIstio message. Also converts values to other types if specified. - * @param message ClusterIstio - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.Service.ClusterIstio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getServiceLevelObjective}. + * @param error Error, if any + * @param [response] ServiceLevelObjective + */ + type GetServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; - /** - * Converts this ClusterIstio to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServiceLevelObjectives}. + * @param error Error, if any + * @param [response] ListServiceLevelObjectivesResponse + */ + type ListServiceLevelObjectivesCallback = (error: (Error|null), response?: google.monitoring.v3.ListServiceLevelObjectivesResponse) => void; - /** Properties of a Telemetry. */ - interface ITelemetry { + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateServiceLevelObjective}. + * @param error Error, if any + * @param [response] ServiceLevelObjective + */ + type UpdateServiceLevelObjectiveCallback = (error: (Error|null), response?: google.monitoring.v3.ServiceLevelObjective) => void; - /** Telemetry resourceName */ - resourceName?: (string|null); - } + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteServiceLevelObjective}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteServiceLevelObjectiveCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } - /** Represents a Telemetry. */ - class Telemetry implements ITelemetry { + /** Properties of a CreateServiceRequest. */ + interface ICreateServiceRequest { - /** - * Constructs a new Telemetry. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.Service.ITelemetry); + /** CreateServiceRequest parent */ + parent?: (string|null); - /** Telemetry resourceName. */ - public resourceName: string; + /** CreateServiceRequest serviceId */ + serviceId?: (string|null); - /** - * Creates a new Telemetry instance using the specified properties. - * @param [properties] Properties to set - * @returns Telemetry instance - */ - public static create(properties?: google.monitoring.v3.Service.ITelemetry): google.monitoring.v3.Service.Telemetry; + /** CreateServiceRequest service */ + service?: (google.monitoring.v3.IService|null); + } - /** - * Encodes the specified Telemetry message. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. - * @param message Telemetry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.Service.ITelemetry, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a CreateServiceRequest. */ + class CreateServiceRequest implements ICreateServiceRequest { - /** - * Encodes the specified Telemetry message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. - * @param message Telemetry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.Service.ITelemetry, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new CreateServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ICreateServiceRequest); - /** - * Decodes a Telemetry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Telemetry - * @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.monitoring.v3.Service.Telemetry; + /** CreateServiceRequest parent. */ + public parent: string; - /** - * Decodes a Telemetry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Telemetry - * @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.monitoring.v3.Service.Telemetry; + /** CreateServiceRequest serviceId. */ + public serviceId: string; - /** - * Verifies a Telemetry 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); + /** CreateServiceRequest service. */ + public service?: (google.monitoring.v3.IService|null); - /** - * Creates a Telemetry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Telemetry - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Service.Telemetry; + /** + * Creates a new CreateServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceRequest instance + */ + public static create(properties?: google.monitoring.v3.ICreateServiceRequest): google.monitoring.v3.CreateServiceRequest; - /** - * Creates a plain object from a Telemetry message. Also converts values to other types if specified. - * @param message Telemetry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.Service.Telemetry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Telemetry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * @param message CreateServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.ICreateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ServiceLevelObjective. */ - interface IServiceLevelObjective { + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceRequest + * @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.monitoring.v3.CreateServiceRequest; - /** ServiceLevelObjective name */ - name?: (string|null); + /** + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceRequest + * @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.monitoring.v3.CreateServiceRequest; - /** ServiceLevelObjective displayName */ - displayName?: (string|null); + /** + * Verifies a CreateServiceRequest 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); - /** ServiceLevelObjective serviceLevelIndicator */ - serviceLevelIndicator?: (google.monitoring.v3.IServiceLevelIndicator|null); + /** + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateServiceRequest; - /** ServiceLevelObjective goal */ - goal?: (number|null); + /** + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * @param message CreateServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.CreateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ServiceLevelObjective rollingPeriod */ - rollingPeriod?: (google.protobuf.IDuration|null); + /** + * Converts this CreateServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ServiceLevelObjective calendarPeriod */ - calendarPeriod?: (google.type.CalendarPeriod|keyof typeof google.type.CalendarPeriod|null); + /** Properties of a GetServiceRequest. */ + interface IGetServiceRequest { + + /** GetServiceRequest name */ + name?: (string|null); } - /** Represents a ServiceLevelObjective. */ - class ServiceLevelObjective implements IServiceLevelObjective { + /** Represents a GetServiceRequest. */ + class GetServiceRequest implements IGetServiceRequest { /** - * Constructs a new ServiceLevelObjective. + * Constructs a new GetServiceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IServiceLevelObjective); + constructor(properties?: google.monitoring.v3.IGetServiceRequest); - /** ServiceLevelObjective name. */ + /** GetServiceRequest name. */ public name: string; - /** ServiceLevelObjective displayName. */ - public displayName: string; - - /** ServiceLevelObjective serviceLevelIndicator. */ - public serviceLevelIndicator?: (google.monitoring.v3.IServiceLevelIndicator|null); - - /** ServiceLevelObjective goal. */ - public goal: number; - - /** ServiceLevelObjective rollingPeriod. */ - public rollingPeriod?: (google.protobuf.IDuration|null); - - /** ServiceLevelObjective calendarPeriod. */ - public calendarPeriod: (google.type.CalendarPeriod|keyof typeof google.type.CalendarPeriod); - - /** ServiceLevelObjective period. */ - public period?: ("rollingPeriod"|"calendarPeriod"); - /** - * Creates a new ServiceLevelObjective instance using the specified properties. + * Creates a new GetServiceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceLevelObjective instance + * @returns GetServiceRequest instance */ - public static create(properties?: google.monitoring.v3.IServiceLevelObjective): google.monitoring.v3.ServiceLevelObjective; + public static create(properties?: google.monitoring.v3.IGetServiceRequest): google.monitoring.v3.GetServiceRequest; /** - * Encodes the specified ServiceLevelObjective message. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. - * @param message ServiceLevelObjective message or plain object to encode + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IServiceLevelObjective, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServiceLevelObjective message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. - * @param message ServiceLevelObjective message or plain object to encode + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * @param message GetServiceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IServiceLevelObjective, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceLevelObjective message from the specified reader or buffer. + * Decodes a GetServiceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceLevelObjective + * @returns GetServiceRequest * @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.monitoring.v3.ServiceLevelObjective; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetServiceRequest; /** - * Decodes a ServiceLevelObjective message from the specified reader or buffer, length delimited. + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceLevelObjective + * @returns GetServiceRequest * @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.monitoring.v3.ServiceLevelObjective; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetServiceRequest; /** - * Verifies a ServiceLevelObjective message. + * Verifies a GetServiceRequest 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 ServiceLevelObjective message from a plain object. Also converts values to their respective internal types. + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceLevelObjective + * @returns GetServiceRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ServiceLevelObjective; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetServiceRequest; /** - * Creates a plain object from a ServiceLevelObjective message. Also converts values to other types if specified. - * @param message ServiceLevelObjective + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * @param message GetServiceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ServiceLevelObjective, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceLevelObjective to JSON. + * Converts this GetServiceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ServiceLevelObjective { - - /** View enum. */ - enum View { - VIEW_UNSPECIFIED = 0, - FULL = 2, - EXPLICIT = 1 - } - } + /** Properties of a ListServicesRequest. */ + interface IListServicesRequest { - /** Properties of a ServiceLevelIndicator. */ - interface IServiceLevelIndicator { + /** ListServicesRequest parent */ + parent?: (string|null); - /** ServiceLevelIndicator basicSli */ - basicSli?: (google.monitoring.v3.IBasicSli|null); + /** ListServicesRequest filter */ + filter?: (string|null); - /** ServiceLevelIndicator requestBased */ - requestBased?: (google.monitoring.v3.IRequestBasedSli|null); + /** ListServicesRequest pageSize */ + pageSize?: (number|null); - /** ServiceLevelIndicator windowsBased */ - windowsBased?: (google.monitoring.v3.IWindowsBasedSli|null); + /** ListServicesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a ServiceLevelIndicator. */ - class ServiceLevelIndicator implements IServiceLevelIndicator { + /** Represents a ListServicesRequest. */ + class ListServicesRequest implements IListServicesRequest { /** - * Constructs a new ServiceLevelIndicator. + * Constructs a new ListServicesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IServiceLevelIndicator); + constructor(properties?: google.monitoring.v3.IListServicesRequest); - /** ServiceLevelIndicator basicSli. */ - public basicSli?: (google.monitoring.v3.IBasicSli|null); + /** ListServicesRequest parent. */ + public parent: string; - /** ServiceLevelIndicator requestBased. */ - public requestBased?: (google.monitoring.v3.IRequestBasedSli|null); + /** ListServicesRequest filter. */ + public filter: string; - /** ServiceLevelIndicator windowsBased. */ - public windowsBased?: (google.monitoring.v3.IWindowsBasedSli|null); + /** ListServicesRequest pageSize. */ + public pageSize: number; - /** ServiceLevelIndicator type. */ - public type?: ("basicSli"|"requestBased"|"windowsBased"); + /** ListServicesRequest pageToken. */ + public pageToken: string; /** - * Creates a new ServiceLevelIndicator instance using the specified properties. + * Creates a new ListServicesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceLevelIndicator instance + * @returns ListServicesRequest instance */ - public static create(properties?: google.monitoring.v3.IServiceLevelIndicator): google.monitoring.v3.ServiceLevelIndicator; + public static create(properties?: google.monitoring.v3.IListServicesRequest): google.monitoring.v3.ListServicesRequest; /** - * Encodes the specified ServiceLevelIndicator message. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. - * @param message ServiceLevelIndicator message or plain object to encode + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IServiceLevelIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServiceLevelIndicator message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. - * @param message ServiceLevelIndicator message or plain object to encode + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * @param message ListServicesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IServiceLevelIndicator, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceLevelIndicator message from the specified reader or buffer. + * Decodes a ListServicesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceLevelIndicator + * @returns ListServicesRequest * @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.monitoring.v3.ServiceLevelIndicator; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServicesRequest; /** - * Decodes a ServiceLevelIndicator message from the specified reader or buffer, length delimited. + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceLevelIndicator + * @returns ListServicesRequest * @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.monitoring.v3.ServiceLevelIndicator; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServicesRequest; /** - * Verifies a ServiceLevelIndicator message. + * Verifies a ListServicesRequest 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 ServiceLevelIndicator message from a plain object. Also converts values to their respective internal types. + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceLevelIndicator + * @returns ListServicesRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ServiceLevelIndicator; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServicesRequest; /** - * Creates a plain object from a ServiceLevelIndicator message. Also converts values to other types if specified. - * @param message ServiceLevelIndicator + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * @param message ListServicesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ServiceLevelIndicator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceLevelIndicator to JSON. + * Converts this ListServicesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BasicSli. */ - interface IBasicSli { - - /** BasicSli method */ - method?: (string[]|null); - - /** BasicSli location */ - location?: (string[]|null); - - /** BasicSli version */ - version?: (string[]|null); - - /** BasicSli availability */ - availability?: (google.monitoring.v3.BasicSli.IAvailabilityCriteria|null); - - /** BasicSli latency */ - latency?: (google.monitoring.v3.BasicSli.ILatencyCriteria|null); - } - - /** Represents a BasicSli. */ - class BasicSli implements IBasicSli { - - /** - * Constructs a new BasicSli. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IBasicSli); + /** Properties of a ListServicesResponse. */ + interface IListServicesResponse { - /** BasicSli method. */ - public method: string[]; + /** ListServicesResponse services */ + services?: (google.monitoring.v3.IService[]|null); - /** BasicSli location. */ - public location: string[]; + /** ListServicesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** BasicSli version. */ - public version: string[]; + /** Represents a ListServicesResponse. */ + class ListServicesResponse implements IListServicesResponse { - /** BasicSli availability. */ - public availability?: (google.monitoring.v3.BasicSli.IAvailabilityCriteria|null); + /** + * Constructs a new ListServicesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListServicesResponse); - /** BasicSli latency. */ - public latency?: (google.monitoring.v3.BasicSli.ILatencyCriteria|null); + /** ListServicesResponse services. */ + public services: google.monitoring.v3.IService[]; - /** BasicSli sliCriteria. */ - public sliCriteria?: ("availability"|"latency"); + /** ListServicesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new BasicSli instance using the specified properties. + * Creates a new ListServicesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BasicSli instance + * @returns ListServicesResponse instance */ - public static create(properties?: google.monitoring.v3.IBasicSli): google.monitoring.v3.BasicSli; + public static create(properties?: google.monitoring.v3.IListServicesResponse): google.monitoring.v3.ListServicesResponse; /** - * Encodes the specified BasicSli message. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. - * @param message BasicSli message or plain object to encode + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IBasicSli, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BasicSli message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. - * @param message BasicSli message or plain object to encode + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @param message ListServicesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IBasicSli, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BasicSli message from the specified reader or buffer. + * Decodes a ListServicesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BasicSli + * @returns ListServicesResponse * @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.monitoring.v3.BasicSli; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServicesResponse; /** - * Decodes a BasicSli message from the specified reader or buffer, length delimited. + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BasicSli + * @returns ListServicesResponse * @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.monitoring.v3.BasicSli; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServicesResponse; /** - * Verifies a BasicSli message. + * Verifies a ListServicesResponse 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 BasicSli message from a plain object. Also converts values to their respective internal types. + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BasicSli + * @returns ListServicesResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServicesResponse; /** - * Creates a plain object from a BasicSli message. Also converts values to other types if specified. - * @param message BasicSli + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @param message ListServicesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.BasicSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BasicSli to JSON. + * Converts this ListServicesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BasicSli { - - /** Properties of an AvailabilityCriteria. */ - interface IAvailabilityCriteria { - } - - /** Represents an AvailabilityCriteria. */ - class AvailabilityCriteria implements IAvailabilityCriteria { - - /** - * Constructs a new AvailabilityCriteria. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.BasicSli.IAvailabilityCriteria); - - /** - * Creates a new AvailabilityCriteria instance using the specified properties. - * @param [properties] Properties to set - * @returns AvailabilityCriteria instance - */ - public static create(properties?: google.monitoring.v3.BasicSli.IAvailabilityCriteria): google.monitoring.v3.BasicSli.AvailabilityCriteria; - - /** - * Encodes the specified AvailabilityCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. - * @param message AvailabilityCriteria message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.BasicSli.IAvailabilityCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AvailabilityCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. - * @param message AvailabilityCriteria message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.BasicSli.IAvailabilityCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AvailabilityCriteria message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AvailabilityCriteria - * @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.monitoring.v3.BasicSli.AvailabilityCriteria; - - /** - * Decodes an AvailabilityCriteria message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AvailabilityCriteria - * @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.monitoring.v3.BasicSli.AvailabilityCriteria; - - /** - * Verifies an AvailabilityCriteria 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 AvailabilityCriteria message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AvailabilityCriteria - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli.AvailabilityCriteria; - - /** - * Creates a plain object from an AvailabilityCriteria message. Also converts values to other types if specified. - * @param message AvailabilityCriteria - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.BasicSli.AvailabilityCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AvailabilityCriteria to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a LatencyCriteria. */ - interface ILatencyCriteria { - - /** LatencyCriteria threshold */ - threshold?: (google.protobuf.IDuration|null); - } - - /** Represents a LatencyCriteria. */ - class LatencyCriteria implements ILatencyCriteria { - - /** - * Constructs a new LatencyCriteria. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.BasicSli.ILatencyCriteria); - - /** LatencyCriteria threshold. */ - public threshold?: (google.protobuf.IDuration|null); - - /** - * Creates a new LatencyCriteria instance using the specified properties. - * @param [properties] Properties to set - * @returns LatencyCriteria instance - */ - public static create(properties?: google.monitoring.v3.BasicSli.ILatencyCriteria): google.monitoring.v3.BasicSli.LatencyCriteria; - - /** - * Encodes the specified LatencyCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. - * @param message LatencyCriteria message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.BasicSli.ILatencyCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LatencyCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. - * @param message LatencyCriteria message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.BasicSli.ILatencyCriteria, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LatencyCriteria message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LatencyCriteria - * @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.monitoring.v3.BasicSli.LatencyCriteria; - - /** - * Decodes a LatencyCriteria message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LatencyCriteria - * @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.monitoring.v3.BasicSli.LatencyCriteria; - - /** - * Verifies a LatencyCriteria 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 LatencyCriteria message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatencyCriteria - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.BasicSli.LatencyCriteria; - - /** - * Creates a plain object from a LatencyCriteria message. Also converts values to other types if specified. - * @param message LatencyCriteria - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.BasicSli.LatencyCriteria, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatencyCriteria to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a Range. */ - interface IRange { - - /** Range min */ - min?: (number|null); + /** Properties of an UpdateServiceRequest. */ + interface IUpdateServiceRequest { - /** Range max */ - max?: (number|null); + /** UpdateServiceRequest service */ + service?: (google.monitoring.v3.IService|null); + + /** UpdateServiceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a Range. */ - class Range implements IRange { + /** Represents an UpdateServiceRequest. */ + class UpdateServiceRequest implements IUpdateServiceRequest { /** - * Constructs a new Range. + * Constructs a new UpdateServiceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IRange); + constructor(properties?: google.monitoring.v3.IUpdateServiceRequest); - /** Range min. */ - public min: number; + /** UpdateServiceRequest service. */ + public service?: (google.monitoring.v3.IService|null); - /** Range max. */ - public max: number; + /** UpdateServiceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new Range instance using the specified properties. + * Creates a new UpdateServiceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Range instance + * @returns UpdateServiceRequest instance */ - public static create(properties?: google.monitoring.v3.IRange): google.monitoring.v3.Range; + public static create(properties?: google.monitoring.v3.IUpdateServiceRequest): google.monitoring.v3.UpdateServiceRequest; /** - * Encodes the specified Range message. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. - * @param message Range message or plain object to encode + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. - * @param message Range message or plain object to encode + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * @param message UpdateServiceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IUpdateServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Range message from the specified reader or buffer. + * Decodes an UpdateServiceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Range + * @returns UpdateServiceRequest * @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.monitoring.v3.Range; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateServiceRequest; /** - * Decodes a Range message from the specified reader or buffer, length delimited. + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Range + * @returns UpdateServiceRequest * @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.monitoring.v3.Range; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateServiceRequest; /** - * Verifies a Range message. + * Verifies an UpdateServiceRequest 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. + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Range + * @returns UpdateServiceRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.Range; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateServiceRequest; /** - * Creates a plain object from a Range message. Also converts values to other types if specified. - * @param message Range + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * @param message UpdateServiceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.Range, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.UpdateServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Range to JSON. + * Converts this UpdateServiceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RequestBasedSli. */ - interface IRequestBasedSli { - - /** RequestBasedSli goodTotalRatio */ - goodTotalRatio?: (google.monitoring.v3.ITimeSeriesRatio|null); + /** Properties of a DeleteServiceRequest. */ + interface IDeleteServiceRequest { - /** RequestBasedSli distributionCut */ - distributionCut?: (google.monitoring.v3.IDistributionCut|null); + /** DeleteServiceRequest name */ + name?: (string|null); } - /** Represents a RequestBasedSli. */ - class RequestBasedSli implements IRequestBasedSli { + /** Represents a DeleteServiceRequest. */ + class DeleteServiceRequest implements IDeleteServiceRequest { /** - * Constructs a new RequestBasedSli. + * Constructs a new DeleteServiceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IRequestBasedSli); - - /** RequestBasedSli goodTotalRatio. */ - public goodTotalRatio?: (google.monitoring.v3.ITimeSeriesRatio|null); - - /** RequestBasedSli distributionCut. */ - public distributionCut?: (google.monitoring.v3.IDistributionCut|null); + constructor(properties?: google.monitoring.v3.IDeleteServiceRequest); - /** RequestBasedSli method. */ - public method?: ("goodTotalRatio"|"distributionCut"); + /** DeleteServiceRequest name. */ + public name: string; /** - * Creates a new RequestBasedSli instance using the specified properties. + * Creates a new DeleteServiceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RequestBasedSli instance + * @returns DeleteServiceRequest instance */ - public static create(properties?: google.monitoring.v3.IRequestBasedSli): google.monitoring.v3.RequestBasedSli; + public static create(properties?: google.monitoring.v3.IDeleteServiceRequest): google.monitoring.v3.DeleteServiceRequest; /** - * Encodes the specified RequestBasedSli message. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. - * @param message RequestBasedSli message or plain object to encode + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IRequestBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RequestBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. - * @param message RequestBasedSli message or plain object to encode + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @param message DeleteServiceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IRequestBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IDeleteServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RequestBasedSli message from the specified reader or buffer. + * Decodes a DeleteServiceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RequestBasedSli + * @returns DeleteServiceRequest * @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.monitoring.v3.RequestBasedSli; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteServiceRequest; /** - * Decodes a RequestBasedSli message from the specified reader or buffer, length delimited. + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RequestBasedSli + * @returns DeleteServiceRequest * @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.monitoring.v3.RequestBasedSli; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteServiceRequest; /** - * Verifies a RequestBasedSli message. + * Verifies a DeleteServiceRequest 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 RequestBasedSli message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RequestBasedSli + * @returns DeleteServiceRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.RequestBasedSli; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteServiceRequest; /** - * Creates a plain object from a RequestBasedSli message. Also converts values to other types if specified. - * @param message RequestBasedSli + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @param message DeleteServiceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.RequestBasedSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.DeleteServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RequestBasedSli to JSON. + * Converts this DeleteServiceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TimeSeriesRatio. */ - interface ITimeSeriesRatio { + /** Properties of a CreateServiceLevelObjectiveRequest. */ + interface ICreateServiceLevelObjectiveRequest { - /** TimeSeriesRatio goodServiceFilter */ - goodServiceFilter?: (string|null); + /** CreateServiceLevelObjectiveRequest parent */ + parent?: (string|null); - /** TimeSeriesRatio badServiceFilter */ - badServiceFilter?: (string|null); + /** CreateServiceLevelObjectiveRequest serviceLevelObjectiveId */ + serviceLevelObjectiveId?: (string|null); - /** TimeSeriesRatio totalServiceFilter */ - totalServiceFilter?: (string|null); + /** CreateServiceLevelObjectiveRequest serviceLevelObjective */ + serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); } - /** Represents a TimeSeriesRatio. */ - class TimeSeriesRatio implements ITimeSeriesRatio { + /** Represents a CreateServiceLevelObjectiveRequest. */ + class CreateServiceLevelObjectiveRequest implements ICreateServiceLevelObjectiveRequest { /** - * Constructs a new TimeSeriesRatio. + * Constructs a new CreateServiceLevelObjectiveRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.ITimeSeriesRatio); + constructor(properties?: google.monitoring.v3.ICreateServiceLevelObjectiveRequest); - /** TimeSeriesRatio goodServiceFilter. */ - public goodServiceFilter: string; + /** CreateServiceLevelObjectiveRequest parent. */ + public parent: string; - /** TimeSeriesRatio badServiceFilter. */ - public badServiceFilter: string; + /** CreateServiceLevelObjectiveRequest serviceLevelObjectiveId. */ + public serviceLevelObjectiveId: string; - /** TimeSeriesRatio totalServiceFilter. */ - public totalServiceFilter: string; + /** CreateServiceLevelObjectiveRequest serviceLevelObjective. */ + public serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); /** - * Creates a new TimeSeriesRatio instance using the specified properties. + * Creates a new CreateServiceLevelObjectiveRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeSeriesRatio instance + * @returns CreateServiceLevelObjectiveRequest instance */ - public static create(properties?: google.monitoring.v3.ITimeSeriesRatio): google.monitoring.v3.TimeSeriesRatio; + public static create(properties?: google.monitoring.v3.ICreateServiceLevelObjectiveRequest): google.monitoring.v3.CreateServiceLevelObjectiveRequest; /** - * Encodes the specified TimeSeriesRatio message. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. - * @param message TimeSeriesRatio message or plain object to encode + * Encodes the specified CreateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message CreateServiceLevelObjectiveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.ITimeSeriesRatio, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeSeriesRatio message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. - * @param message TimeSeriesRatio message or plain object to encode + * Encodes the specified CreateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message CreateServiceLevelObjectiveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.ITimeSeriesRatio, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ICreateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeSeriesRatio message from the specified reader or buffer. + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeSeriesRatio + * @returns CreateServiceLevelObjectiveRequest * @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.monitoring.v3.TimeSeriesRatio; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.CreateServiceLevelObjectiveRequest; /** - * Decodes a TimeSeriesRatio message from the specified reader or buffer, length delimited. + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeSeriesRatio + * @returns CreateServiceLevelObjectiveRequest * @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.monitoring.v3.TimeSeriesRatio; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.CreateServiceLevelObjectiveRequest; /** - * Verifies a TimeSeriesRatio message. + * Verifies a CreateServiceLevelObjectiveRequest 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 TimeSeriesRatio message from a plain object. Also converts values to their respective internal types. + * Creates a CreateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeSeriesRatio + * @returns CreateServiceLevelObjectiveRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.TimeSeriesRatio; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateServiceLevelObjectiveRequest; /** - * Creates a plain object from a TimeSeriesRatio message. Also converts values to other types if specified. - * @param message TimeSeriesRatio + * Creates a plain object from a CreateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message CreateServiceLevelObjectiveRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.TimeSeriesRatio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.CreateServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeSeriesRatio to JSON. + * Converts this CreateServiceLevelObjectiveRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DistributionCut. */ - interface IDistributionCut { + /** Properties of a GetServiceLevelObjectiveRequest. */ + interface IGetServiceLevelObjectiveRequest { - /** DistributionCut distributionFilter */ - distributionFilter?: (string|null); + /** GetServiceLevelObjectiveRequest name */ + name?: (string|null); - /** DistributionCut range */ - range?: (google.monitoring.v3.IRange|null); + /** GetServiceLevelObjectiveRequest view */ + view?: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View|null); } - /** Represents a DistributionCut. */ - class DistributionCut implements IDistributionCut { + /** Represents a GetServiceLevelObjectiveRequest. */ + class GetServiceLevelObjectiveRequest implements IGetServiceLevelObjectiveRequest { /** - * Constructs a new DistributionCut. + * Constructs a new GetServiceLevelObjectiveRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IDistributionCut); + constructor(properties?: google.monitoring.v3.IGetServiceLevelObjectiveRequest); - /** DistributionCut distributionFilter. */ - public distributionFilter: string; + /** GetServiceLevelObjectiveRequest name. */ + public name: string; - /** DistributionCut range. */ - public range?: (google.monitoring.v3.IRange|null); + /** GetServiceLevelObjectiveRequest view. */ + public view: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View); /** - * Creates a new DistributionCut instance using the specified properties. + * Creates a new GetServiceLevelObjectiveRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DistributionCut instance + * @returns GetServiceLevelObjectiveRequest instance */ - public static create(properties?: google.monitoring.v3.IDistributionCut): google.monitoring.v3.DistributionCut; + public static create(properties?: google.monitoring.v3.IGetServiceLevelObjectiveRequest): google.monitoring.v3.GetServiceLevelObjectiveRequest; /** - * Encodes the specified DistributionCut message. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. - * @param message DistributionCut message or plain object to encode + * Encodes the specified GetServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. + * @param message GetServiceLevelObjectiveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IDistributionCut, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IGetServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DistributionCut message, length delimited. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. - * @param message DistributionCut message or plain object to encode + * Encodes the specified GetServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. + * @param message GetServiceLevelObjectiveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IDistributionCut, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IGetServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DistributionCut message from the specified reader or buffer. + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DistributionCut + * @returns GetServiceLevelObjectiveRequest * @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.monitoring.v3.DistributionCut; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.GetServiceLevelObjectiveRequest; /** - * Decodes a DistributionCut message from the specified reader or buffer, length delimited. + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DistributionCut + * @returns GetServiceLevelObjectiveRequest * @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.monitoring.v3.DistributionCut; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.GetServiceLevelObjectiveRequest; /** - * Verifies a DistributionCut message. + * Verifies a GetServiceLevelObjectiveRequest 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 DistributionCut message from a plain object. Also converts values to their respective internal types. + * Creates a GetServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DistributionCut + * @returns GetServiceLevelObjectiveRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DistributionCut; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetServiceLevelObjectiveRequest; /** - * Creates a plain object from a DistributionCut message. Also converts values to other types if specified. - * @param message DistributionCut + * Creates a plain object from a GetServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message GetServiceLevelObjectiveRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.DistributionCut, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.GetServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DistributionCut to JSON. + * Converts this GetServiceLevelObjectiveRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a WindowsBasedSli. */ - interface IWindowsBasedSli { + /** Properties of a ListServiceLevelObjectivesRequest. */ + interface IListServiceLevelObjectivesRequest { - /** WindowsBasedSli goodBadMetricFilter */ - goodBadMetricFilter?: (string|null); + /** ListServiceLevelObjectivesRequest parent */ + parent?: (string|null); - /** WindowsBasedSli goodTotalRatioThreshold */ - goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); + /** ListServiceLevelObjectivesRequest filter */ + filter?: (string|null); - /** WindowsBasedSli metricMeanInRange */ - metricMeanInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + /** ListServiceLevelObjectivesRequest pageSize */ + pageSize?: (number|null); - /** WindowsBasedSli metricSumInRange */ - metricSumInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + /** ListServiceLevelObjectivesRequest pageToken */ + pageToken?: (string|null); - /** WindowsBasedSli windowPeriod */ - windowPeriod?: (google.protobuf.IDuration|null); + /** ListServiceLevelObjectivesRequest view */ + view?: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View|null); } - /** Represents a WindowsBasedSli. */ - class WindowsBasedSli implements IWindowsBasedSli { + /** Represents a ListServiceLevelObjectivesRequest. */ + class ListServiceLevelObjectivesRequest implements IListServiceLevelObjectivesRequest { /** - * Constructs a new WindowsBasedSli. + * Constructs a new ListServiceLevelObjectivesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IWindowsBasedSli); - - /** WindowsBasedSli goodBadMetricFilter. */ - public goodBadMetricFilter: string; + constructor(properties?: google.monitoring.v3.IListServiceLevelObjectivesRequest); - /** WindowsBasedSli goodTotalRatioThreshold. */ - public goodTotalRatioThreshold?: (google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null); + /** ListServiceLevelObjectivesRequest parent. */ + public parent: string; - /** WindowsBasedSli metricMeanInRange. */ - public metricMeanInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + /** ListServiceLevelObjectivesRequest filter. */ + public filter: string; - /** WindowsBasedSli metricSumInRange. */ - public metricSumInRange?: (google.monitoring.v3.WindowsBasedSli.IMetricRange|null); + /** ListServiceLevelObjectivesRequest pageSize. */ + public pageSize: number; - /** WindowsBasedSli windowPeriod. */ - public windowPeriod?: (google.protobuf.IDuration|null); + /** ListServiceLevelObjectivesRequest pageToken. */ + public pageToken: string; - /** WindowsBasedSli windowCriterion. */ - public windowCriterion?: ("goodBadMetricFilter"|"goodTotalRatioThreshold"|"metricMeanInRange"|"metricSumInRange"); + /** ListServiceLevelObjectivesRequest view. */ + public view: (google.monitoring.v3.ServiceLevelObjective.View|keyof typeof google.monitoring.v3.ServiceLevelObjective.View); /** - * Creates a new WindowsBasedSli instance using the specified properties. + * Creates a new ListServiceLevelObjectivesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WindowsBasedSli instance + * @returns ListServiceLevelObjectivesRequest instance */ - public static create(properties?: google.monitoring.v3.IWindowsBasedSli): google.monitoring.v3.WindowsBasedSli; + public static create(properties?: google.monitoring.v3.IListServiceLevelObjectivesRequest): google.monitoring.v3.ListServiceLevelObjectivesRequest; /** - * Encodes the specified WindowsBasedSli message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. - * @param message WindowsBasedSli message or plain object to encode + * Encodes the specified ListServiceLevelObjectivesRequest message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. + * @param message ListServiceLevelObjectivesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IWindowsBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListServiceLevelObjectivesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WindowsBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. - * @param message WindowsBasedSli message or plain object to encode + * Encodes the specified ListServiceLevelObjectivesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. + * @param message ListServiceLevelObjectivesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IWindowsBasedSli, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListServiceLevelObjectivesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WindowsBasedSli message from the specified reader or buffer. + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WindowsBasedSli + * @returns ListServiceLevelObjectivesRequest * @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.monitoring.v3.WindowsBasedSli; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListServiceLevelObjectivesRequest; /** - * Decodes a WindowsBasedSli message from the specified reader or buffer, length delimited. + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WindowsBasedSli + * @returns ListServiceLevelObjectivesRequest * @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.monitoring.v3.WindowsBasedSli; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListServiceLevelObjectivesRequest; /** - * Verifies a WindowsBasedSli message. + * Verifies a ListServiceLevelObjectivesRequest 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 WindowsBasedSli message from a plain object. Also converts values to their respective internal types. + * Creates a ListServiceLevelObjectivesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WindowsBasedSli + * @returns ListServiceLevelObjectivesRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServiceLevelObjectivesRequest; /** - * Creates a plain object from a WindowsBasedSli message. Also converts values to other types if specified. - * @param message WindowsBasedSli + * Creates a plain object from a ListServiceLevelObjectivesRequest message. Also converts values to other types if specified. + * @param message ListServiceLevelObjectivesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.WindowsBasedSli, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListServiceLevelObjectivesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WindowsBasedSli to JSON. + * Converts this ListServiceLevelObjectivesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace WindowsBasedSli { - - /** Properties of a PerformanceThreshold. */ - interface IPerformanceThreshold { - - /** PerformanceThreshold performance */ - performance?: (google.monitoring.v3.IRequestBasedSli|null); - - /** PerformanceThreshold basicSliPerformance */ - basicSliPerformance?: (google.monitoring.v3.IBasicSli|null); - - /** PerformanceThreshold threshold */ - threshold?: (number|null); - } - - /** Represents a PerformanceThreshold. */ - class PerformanceThreshold implements IPerformanceThreshold { - - /** - * Constructs a new PerformanceThreshold. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold); - - /** PerformanceThreshold performance. */ - public performance?: (google.monitoring.v3.IRequestBasedSli|null); - - /** PerformanceThreshold basicSliPerformance. */ - public basicSliPerformance?: (google.monitoring.v3.IBasicSli|null); - - /** PerformanceThreshold threshold. */ - public threshold: number; - - /** PerformanceThreshold type. */ - public type?: ("performance"|"basicSliPerformance"); - - /** - * Creates a new PerformanceThreshold instance using the specified properties. - * @param [properties] Properties to set - * @returns PerformanceThreshold instance - */ - public static create(properties?: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; - - /** - * Encodes the specified PerformanceThreshold message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. - * @param message PerformanceThreshold message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PerformanceThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. - * @param message PerformanceThreshold message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PerformanceThreshold message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PerformanceThreshold - * @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.monitoring.v3.WindowsBasedSli.PerformanceThreshold; - - /** - * Decodes a PerformanceThreshold message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PerformanceThreshold - * @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.monitoring.v3.WindowsBasedSli.PerformanceThreshold; + /** Properties of a ListServiceLevelObjectivesResponse. */ + interface IListServiceLevelObjectivesResponse { - /** - * Verifies a PerformanceThreshold 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); + /** ListServiceLevelObjectivesResponse serviceLevelObjectives */ + serviceLevelObjectives?: (google.monitoring.v3.IServiceLevelObjective[]|null); - /** - * Creates a PerformanceThreshold message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PerformanceThreshold - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli.PerformanceThreshold; + /** ListServiceLevelObjectivesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Creates a plain object from a PerformanceThreshold message. Also converts values to other types if specified. - * @param message PerformanceThreshold - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.WindowsBasedSli.PerformanceThreshold, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a ListServiceLevelObjectivesResponse. */ + class ListServiceLevelObjectivesResponse implements IListServiceLevelObjectivesResponse { - /** - * Converts this PerformanceThreshold to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new ListServiceLevelObjectivesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListServiceLevelObjectivesResponse); - /** Properties of a MetricRange. */ - interface IMetricRange { + /** ListServiceLevelObjectivesResponse serviceLevelObjectives. */ + public serviceLevelObjectives: google.monitoring.v3.IServiceLevelObjective[]; - /** MetricRange timeSeries */ - timeSeries?: (string|null); + /** ListServiceLevelObjectivesResponse nextPageToken. */ + public nextPageToken: string; - /** MetricRange range */ - range?: (google.monitoring.v3.IRange|null); - } + /** + * Creates a new ListServiceLevelObjectivesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceLevelObjectivesResponse instance + */ + public static create(properties?: google.monitoring.v3.IListServiceLevelObjectivesResponse): google.monitoring.v3.ListServiceLevelObjectivesResponse; - /** Represents a MetricRange. */ - class MetricRange implements IMetricRange { + /** + * Encodes the specified ListServiceLevelObjectivesResponse message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. + * @param message ListServiceLevelObjectivesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListServiceLevelObjectivesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new MetricRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.WindowsBasedSli.IMetricRange); + /** + * Encodes the specified ListServiceLevelObjectivesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. + * @param message ListServiceLevelObjectivesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListServiceLevelObjectivesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** MetricRange timeSeries. */ - public timeSeries: string; + /** + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceLevelObjectivesResponse + * @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.monitoring.v3.ListServiceLevelObjectivesResponse; - /** MetricRange range. */ - public range?: (google.monitoring.v3.IRange|null); + /** + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceLevelObjectivesResponse + * @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.monitoring.v3.ListServiceLevelObjectivesResponse; - /** - * Creates a new MetricRange instance using the specified properties. - * @param [properties] Properties to set - * @returns MetricRange instance - */ - public static create(properties?: google.monitoring.v3.WindowsBasedSli.IMetricRange): google.monitoring.v3.WindowsBasedSli.MetricRange; + /** + * Verifies a ListServiceLevelObjectivesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified MetricRange message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. - * @param message MetricRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.WindowsBasedSli.IMetricRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ListServiceLevelObjectivesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceLevelObjectivesResponse + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListServiceLevelObjectivesResponse; - /** - * Encodes the specified MetricRange message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. - * @param message MetricRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.WindowsBasedSli.IMetricRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ListServiceLevelObjectivesResponse message. Also converts values to other types if specified. + * @param message ListServiceLevelObjectivesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListServiceLevelObjectivesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a MetricRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetricRange - * @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.monitoring.v3.WindowsBasedSli.MetricRange; + /** + * Converts this ListServiceLevelObjectivesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a MetricRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetricRange - * @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.monitoring.v3.WindowsBasedSli.MetricRange; + /** Properties of an UpdateServiceLevelObjectiveRequest. */ + interface IUpdateServiceLevelObjectiveRequest { - /** - * Verifies a MetricRange 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); + /** UpdateServiceLevelObjectiveRequest serviceLevelObjective */ + serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); - /** - * Creates a MetricRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetricRange - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.WindowsBasedSli.MetricRange; + /** UpdateServiceLevelObjectiveRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Creates a plain object from a MetricRange message. Also converts values to other types if specified. - * @param message MetricRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.WindowsBasedSli.MetricRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an UpdateServiceLevelObjectiveRequest. */ + class UpdateServiceLevelObjectiveRequest implements IUpdateServiceLevelObjectiveRequest { - /** - * Converts this MetricRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Constructs a new UpdateServiceLevelObjectiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest); - /** Represents an UptimeCheckService */ - class UptimeCheckService extends $protobuf.rpc.Service { + /** UpdateServiceLevelObjectiveRequest serviceLevelObjective. */ + public serviceLevelObjective?: (google.monitoring.v3.IServiceLevelObjective|null); + + /** UpdateServiceLevelObjectiveRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Constructs a new UptimeCheckService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Creates a new UpdateServiceLevelObjectiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServiceLevelObjectiveRequest instance */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public static create(properties?: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; /** - * Creates new UptimeCheckService 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. + * Encodes the specified UpdateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message UpdateServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): UptimeCheckService; + public static encode(message: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListUptimeCheckConfigs. - * @param request ListUptimeCheckConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListUptimeCheckConfigsResponse + * Encodes the specified UpdateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. + * @param message UpdateServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listUptimeCheckConfigs(request: google.monitoring.v3.IListUptimeCheckConfigsRequest, callback: google.monitoring.v3.UptimeCheckService.ListUptimeCheckConfigsCallback): void; + public static encodeDelimited(message: google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListUptimeCheckConfigs. - * @param request ListUptimeCheckConfigsRequest message or plain object - * @returns Promise + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listUptimeCheckConfigs(request: google.monitoring.v3.IListUptimeCheckConfigsRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; /** - * Calls GetUptimeCheckConfig. - * @param request GetUptimeCheckConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UptimeCheckConfig + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getUptimeCheckConfig(request: google.monitoring.v3.IGetUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.GetUptimeCheckConfigCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; /** - * Calls GetUptimeCheckConfig. - * @param request GetUptimeCheckConfigRequest message or plain object - * @returns Promise + * Verifies an UpdateServiceLevelObjectiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getUptimeCheckConfig(request: google.monitoring.v3.IGetUptimeCheckConfigRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateUptimeCheckConfig. - * @param request CreateUptimeCheckConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UptimeCheckConfig + * Creates an UpdateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServiceLevelObjectiveRequest */ - public createUptimeCheckConfig(request: google.monitoring.v3.ICreateUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.CreateUptimeCheckConfigCallback): void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateServiceLevelObjectiveRequest; /** - * Calls CreateUptimeCheckConfig. - * @param request CreateUptimeCheckConfigRequest message or plain object - * @returns Promise + * Creates a plain object from an UpdateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message UpdateServiceLevelObjectiveRequest + * @param [options] Conversion options + * @returns Plain object */ - public createUptimeCheckConfig(request: google.monitoring.v3.ICreateUptimeCheckConfigRequest): Promise; + public static toObject(message: google.monitoring.v3.UpdateServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateUptimeCheckConfig. - * @param request UpdateUptimeCheckConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UptimeCheckConfig + * Converts this UpdateServiceLevelObjectiveRequest to JSON. + * @returns JSON object */ - public updateUptimeCheckConfig(request: google.monitoring.v3.IUpdateUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.UpdateUptimeCheckConfigCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteServiceLevelObjectiveRequest. */ + interface IDeleteServiceLevelObjectiveRequest { + + /** DeleteServiceLevelObjectiveRequest name */ + name?: (string|null); + } - /** - * Calls UpdateUptimeCheckConfig. - * @param request UpdateUptimeCheckConfigRequest message or plain object - * @returns Promise - */ - public updateUptimeCheckConfig(request: google.monitoring.v3.IUpdateUptimeCheckConfigRequest): Promise; + /** Represents a DeleteServiceLevelObjectiveRequest. */ + class DeleteServiceLevelObjectiveRequest implements IDeleteServiceLevelObjectiveRequest { /** - * Calls DeleteUptimeCheckConfig. - * @param request DeleteUptimeCheckConfigRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Constructs a new DeleteServiceLevelObjectiveRequest. + * @param [properties] Properties to set */ - public deleteUptimeCheckConfig(request: google.monitoring.v3.IDeleteUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.DeleteUptimeCheckConfigCallback): void; + constructor(properties?: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest); + + /** DeleteServiceLevelObjectiveRequest name. */ + public name: string; /** - * Calls DeleteUptimeCheckConfig. - * @param request DeleteUptimeCheckConfigRequest message or plain object - * @returns Promise + * Creates a new DeleteServiceLevelObjectiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceLevelObjectiveRequest instance */ - public deleteUptimeCheckConfig(request: google.monitoring.v3.IDeleteUptimeCheckConfigRequest): Promise; + public static create(properties?: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; /** - * Calls ListUptimeCheckIps. - * @param request ListUptimeCheckIpsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListUptimeCheckIpsResponse + * Encodes the specified DeleteServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * @param message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listUptimeCheckIps(request: google.monitoring.v3.IListUptimeCheckIpsRequest, callback: google.monitoring.v3.UptimeCheckService.ListUptimeCheckIpsCallback): void; + public static encode(message: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListUptimeCheckIps. - * @param request ListUptimeCheckIpsRequest message or plain object - * @returns Promise + * Encodes the specified DeleteServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * @param message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listUptimeCheckIps(request: google.monitoring.v3.IListUptimeCheckIpsRequest): Promise; - } - - namespace UptimeCheckService { + public static encodeDelimited(message: google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckConfigs}. - * @param error Error, if any - * @param [response] ListUptimeCheckConfigsResponse + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListUptimeCheckConfigsCallback = (error: (Error|null), response?: google.monitoring.v3.ListUptimeCheckConfigsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#getUptimeCheckConfig}. - * @param error Error, if any - * @param [response] UptimeCheckConfig + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceLevelObjectiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetUptimeCheckConfigCallback = (error: (Error|null), response?: google.monitoring.v3.UptimeCheckConfig) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#createUptimeCheckConfig}. - * @param error Error, if any - * @param [response] UptimeCheckConfig + * Verifies a DeleteServiceLevelObjectiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type CreateUptimeCheckConfigCallback = (error: (Error|null), response?: google.monitoring.v3.UptimeCheckConfig) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#updateUptimeCheckConfig}. - * @param error Error, if any - * @param [response] UptimeCheckConfig + * Creates a DeleteServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceLevelObjectiveRequest */ - type UpdateUptimeCheckConfigCallback = (error: (Error|null), response?: google.monitoring.v3.UptimeCheckConfig) => void; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteServiceLevelObjectiveRequest; /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#deleteUptimeCheckConfig}. - * @param error Error, if any - * @param [response] Empty + * Creates a plain object from a DeleteServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * @param message DeleteServiceLevelObjectiveRequest + * @param [options] Conversion options + * @returns Plain object */ - type DeleteUptimeCheckConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static toObject(message: google.monitoring.v3.DeleteServiceLevelObjectiveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckIps}. - * @param error Error, if any - * @param [response] ListUptimeCheckIpsResponse + * Converts this DeleteServiceLevelObjectiveRequest to JSON. + * @returns JSON object */ - type ListUptimeCheckIpsCallback = (error: (Error|null), response?: google.monitoring.v3.ListUptimeCheckIpsResponse) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a ListUptimeCheckConfigsRequest. */ - interface IListUptimeCheckConfigsRequest { - - /** ListUptimeCheckConfigsRequest parent */ - parent?: (string|null); - - /** ListUptimeCheckConfigsRequest pageSize */ - pageSize?: (number|null); + /** Properties of a SpanContext. */ + interface ISpanContext { - /** ListUptimeCheckConfigsRequest pageToken */ - pageToken?: (string|null); + /** SpanContext spanName */ + spanName?: (string|null); } - /** Represents a ListUptimeCheckConfigsRequest. */ - class ListUptimeCheckConfigsRequest implements IListUptimeCheckConfigsRequest { + /** Represents a SpanContext. */ + class SpanContext implements ISpanContext { /** - * Constructs a new ListUptimeCheckConfigsRequest. + * Constructs a new SpanContext. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListUptimeCheckConfigsRequest); - - /** ListUptimeCheckConfigsRequest parent. */ - public parent: string; + constructor(properties?: google.monitoring.v3.ISpanContext); - /** ListUptimeCheckConfigsRequest pageSize. */ - public pageSize: number; - - /** ListUptimeCheckConfigsRequest pageToken. */ - public pageToken: string; + /** SpanContext spanName. */ + public spanName: string; /** - * Creates a new ListUptimeCheckConfigsRequest instance using the specified properties. + * Creates a new SpanContext instance using the specified properties. * @param [properties] Properties to set - * @returns ListUptimeCheckConfigsRequest instance + * @returns SpanContext instance */ - public static create(properties?: google.monitoring.v3.IListUptimeCheckConfigsRequest): google.monitoring.v3.ListUptimeCheckConfigsRequest; + public static create(properties?: google.monitoring.v3.ISpanContext): google.monitoring.v3.SpanContext; /** - * Encodes the specified ListUptimeCheckConfigsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. - * @param message ListUptimeCheckConfigsRequest message or plain object to encode + * Encodes the specified SpanContext message. Does not implicitly {@link google.monitoring.v3.SpanContext.verify|verify} messages. + * @param message SpanContext message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListUptimeCheckConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.ISpanContext, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListUptimeCheckConfigsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. - * @param message ListUptimeCheckConfigsRequest message or plain object to encode + * Encodes the specified SpanContext message, length delimited. Does not implicitly {@link google.monitoring.v3.SpanContext.verify|verify} messages. + * @param message SpanContext message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.ISpanContext, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer. + * Decodes a SpanContext message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListUptimeCheckConfigsRequest + * @returns SpanContext * @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.monitoring.v3.ListUptimeCheckConfigsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.SpanContext; /** - * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer, length delimited. + * Decodes a SpanContext message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListUptimeCheckConfigsRequest + * @returns SpanContext * @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.monitoring.v3.ListUptimeCheckConfigsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.SpanContext; /** - * Verifies a ListUptimeCheckConfigsRequest message. + * Verifies a SpanContext 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 ListUptimeCheckConfigsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SpanContext message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListUptimeCheckConfigsRequest + * @returns SpanContext */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckConfigsRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.SpanContext; /** - * Creates a plain object from a ListUptimeCheckConfigsRequest message. Also converts values to other types if specified. - * @param message ListUptimeCheckConfigsRequest + * Creates a plain object from a SpanContext message. Also converts values to other types if specified. + * @param message SpanContext * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListUptimeCheckConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.SpanContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListUptimeCheckConfigsRequest to JSON. + * Converts this SpanContext to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListUptimeCheckConfigsResponse. */ - interface IListUptimeCheckConfigsResponse { + /** UptimeCheckRegion enum. */ + enum UptimeCheckRegion { + REGION_UNSPECIFIED = 0, + USA = 1, + EUROPE = 2, + SOUTH_AMERICA = 3, + ASIA_PACIFIC = 4 + } - /** ListUptimeCheckConfigsResponse uptimeCheckConfigs */ - uptimeCheckConfigs?: (google.monitoring.v3.IUptimeCheckConfig[]|null); + /** Properties of an InternalChecker. */ + interface IInternalChecker { - /** ListUptimeCheckConfigsResponse nextPageToken */ - nextPageToken?: (string|null); + /** InternalChecker name */ + name?: (string|null); - /** ListUptimeCheckConfigsResponse totalSize */ - totalSize?: (number|null); + /** InternalChecker displayName */ + displayName?: (string|null); + + /** InternalChecker network */ + network?: (string|null); + + /** InternalChecker gcpZone */ + gcpZone?: (string|null); + + /** InternalChecker peerProjectId */ + peerProjectId?: (string|null); + + /** InternalChecker state */ + state?: (google.monitoring.v3.InternalChecker.State|keyof typeof google.monitoring.v3.InternalChecker.State|null); } - /** Represents a ListUptimeCheckConfigsResponse. */ - class ListUptimeCheckConfigsResponse implements IListUptimeCheckConfigsResponse { + /** Represents an InternalChecker. */ + class InternalChecker implements IInternalChecker { /** - * Constructs a new ListUptimeCheckConfigsResponse. + * Constructs a new InternalChecker. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IListUptimeCheckConfigsResponse); + constructor(properties?: google.monitoring.v3.IInternalChecker); - /** ListUptimeCheckConfigsResponse uptimeCheckConfigs. */ - public uptimeCheckConfigs: google.monitoring.v3.IUptimeCheckConfig[]; + /** InternalChecker name. */ + public name: string; - /** ListUptimeCheckConfigsResponse nextPageToken. */ - public nextPageToken: string; + /** InternalChecker displayName. */ + public displayName: string; - /** ListUptimeCheckConfigsResponse totalSize. */ - public totalSize: number; + /** InternalChecker network. */ + public network: string; + + /** InternalChecker gcpZone. */ + public gcpZone: string; + + /** InternalChecker peerProjectId. */ + public peerProjectId: string; + + /** InternalChecker state. */ + public state: (google.monitoring.v3.InternalChecker.State|keyof typeof google.monitoring.v3.InternalChecker.State); /** - * Creates a new ListUptimeCheckConfigsResponse instance using the specified properties. + * Creates a new InternalChecker instance using the specified properties. * @param [properties] Properties to set - * @returns ListUptimeCheckConfigsResponse instance + * @returns InternalChecker instance */ - public static create(properties?: google.monitoring.v3.IListUptimeCheckConfigsResponse): google.monitoring.v3.ListUptimeCheckConfigsResponse; + public static create(properties?: google.monitoring.v3.IInternalChecker): google.monitoring.v3.InternalChecker; /** - * Encodes the specified ListUptimeCheckConfigsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. - * @param message ListUptimeCheckConfigsResponse message or plain object to encode + * Encodes the specified InternalChecker message. Does not implicitly {@link google.monitoring.v3.InternalChecker.verify|verify} messages. + * @param message InternalChecker message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IListUptimeCheckConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IInternalChecker, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListUptimeCheckConfigsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. - * @param message ListUptimeCheckConfigsResponse message or plain object to encode + * Encodes the specified InternalChecker message, length delimited. Does not implicitly {@link google.monitoring.v3.InternalChecker.verify|verify} messages. + * @param message InternalChecker message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IInternalChecker, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer. + * Decodes an InternalChecker message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListUptimeCheckConfigsResponse + * @returns InternalChecker * @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.monitoring.v3.ListUptimeCheckConfigsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.InternalChecker; /** - * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer, length delimited. + * Decodes an InternalChecker message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListUptimeCheckConfigsResponse + * @returns InternalChecker * @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.monitoring.v3.ListUptimeCheckConfigsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.InternalChecker; /** - * Verifies a ListUptimeCheckConfigsResponse message. + * Verifies an InternalChecker 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 ListUptimeCheckConfigsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an InternalChecker message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListUptimeCheckConfigsResponse + * @returns InternalChecker */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckConfigsResponse; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.InternalChecker; /** - * Creates a plain object from a ListUptimeCheckConfigsResponse message. Also converts values to other types if specified. - * @param message ListUptimeCheckConfigsResponse + * Creates a plain object from an InternalChecker message. Also converts values to other types if specified. + * @param message InternalChecker * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.ListUptimeCheckConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.InternalChecker, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListUptimeCheckConfigsResponse to JSON. + * Converts this InternalChecker to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetUptimeCheckConfigRequest. */ - interface IGetUptimeCheckConfigRequest { + namespace InternalChecker { - /** GetUptimeCheckConfigRequest name */ + /** State enum. */ + enum State { + UNSPECIFIED = 0, + CREATING = 1, + RUNNING = 2 + } + } + + /** Properties of an UptimeCheckConfig. */ + interface IUptimeCheckConfig { + + /** UptimeCheckConfig name */ name?: (string|null); + + /** UptimeCheckConfig displayName */ + displayName?: (string|null); + + /** UptimeCheckConfig monitoredResource */ + monitoredResource?: (google.api.IMonitoredResource|null); + + /** UptimeCheckConfig resourceGroup */ + resourceGroup?: (google.monitoring.v3.UptimeCheckConfig.IResourceGroup|null); + + /** UptimeCheckConfig httpCheck */ + httpCheck?: (google.monitoring.v3.UptimeCheckConfig.IHttpCheck|null); + + /** UptimeCheckConfig tcpCheck */ + tcpCheck?: (google.monitoring.v3.UptimeCheckConfig.ITcpCheck|null); + + /** UptimeCheckConfig period */ + period?: (google.protobuf.IDuration|null); + + /** UptimeCheckConfig timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** UptimeCheckConfig contentMatchers */ + contentMatchers?: (google.monitoring.v3.UptimeCheckConfig.IContentMatcher[]|null); + + /** UptimeCheckConfig selectedRegions */ + selectedRegions?: (google.monitoring.v3.UptimeCheckRegion[]|null); + + /** UptimeCheckConfig isInternal */ + isInternal?: (boolean|null); + + /** UptimeCheckConfig internalCheckers */ + internalCheckers?: (google.monitoring.v3.IInternalChecker[]|null); } - /** Represents a GetUptimeCheckConfigRequest. */ - class GetUptimeCheckConfigRequest implements IGetUptimeCheckConfigRequest { + /** Represents an UptimeCheckConfig. */ + class UptimeCheckConfig implements IUptimeCheckConfig { /** - * Constructs a new GetUptimeCheckConfigRequest. + * Constructs a new UptimeCheckConfig. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IGetUptimeCheckConfigRequest); + constructor(properties?: google.monitoring.v3.IUptimeCheckConfig); - /** GetUptimeCheckConfigRequest name. */ + /** UptimeCheckConfig name. */ public name: string; + /** UptimeCheckConfig displayName. */ + public displayName: string; + + /** UptimeCheckConfig monitoredResource. */ + public monitoredResource?: (google.api.IMonitoredResource|null); + + /** UptimeCheckConfig resourceGroup. */ + public resourceGroup?: (google.monitoring.v3.UptimeCheckConfig.IResourceGroup|null); + + /** UptimeCheckConfig httpCheck. */ + public httpCheck?: (google.monitoring.v3.UptimeCheckConfig.IHttpCheck|null); + + /** UptimeCheckConfig tcpCheck. */ + public tcpCheck?: (google.monitoring.v3.UptimeCheckConfig.ITcpCheck|null); + + /** UptimeCheckConfig period. */ + public period?: (google.protobuf.IDuration|null); + + /** UptimeCheckConfig timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** UptimeCheckConfig contentMatchers. */ + public contentMatchers: google.monitoring.v3.UptimeCheckConfig.IContentMatcher[]; + + /** UptimeCheckConfig selectedRegions. */ + public selectedRegions: google.monitoring.v3.UptimeCheckRegion[]; + + /** UptimeCheckConfig isInternal. */ + public isInternal: boolean; + + /** UptimeCheckConfig internalCheckers. */ + public internalCheckers: google.monitoring.v3.IInternalChecker[]; + + /** UptimeCheckConfig resource. */ + public resource?: ("monitoredResource"|"resourceGroup"); + + /** UptimeCheckConfig checkRequestType. */ + public checkRequestType?: ("httpCheck"|"tcpCheck"); + /** - * Creates a new GetUptimeCheckConfigRequest instance using the specified properties. + * Creates a new UptimeCheckConfig instance using the specified properties. * @param [properties] Properties to set - * @returns GetUptimeCheckConfigRequest instance + * @returns UptimeCheckConfig instance */ - public static create(properties?: google.monitoring.v3.IGetUptimeCheckConfigRequest): google.monitoring.v3.GetUptimeCheckConfigRequest; + public static create(properties?: google.monitoring.v3.IUptimeCheckConfig): google.monitoring.v3.UptimeCheckConfig; /** - * Encodes the specified GetUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. - * @param message GetUptimeCheckConfigRequest message or plain object to encode + * Encodes the specified UptimeCheckConfig message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.verify|verify} messages. + * @param message UptimeCheckConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IGetUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IUptimeCheckConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. - * @param message GetUptimeCheckConfigRequest message or plain object to encode + * Encodes the specified UptimeCheckConfig message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.verify|verify} messages. + * @param message UptimeCheckConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IGetUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IUptimeCheckConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer. + * Decodes an UptimeCheckConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetUptimeCheckConfigRequest + * @returns UptimeCheckConfig * @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.monitoring.v3.GetUptimeCheckConfigRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UptimeCheckConfig; /** - * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * Decodes an UptimeCheckConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetUptimeCheckConfigRequest + * @returns UptimeCheckConfig * @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.monitoring.v3.GetUptimeCheckConfigRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UptimeCheckConfig; /** - * Verifies a GetUptimeCheckConfigRequest message. + * Verifies an UptimeCheckConfig 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 GetUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UptimeCheckConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetUptimeCheckConfigRequest + * @returns UptimeCheckConfig */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetUptimeCheckConfigRequest; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig; /** - * Creates a plain object from a GetUptimeCheckConfigRequest message. Also converts values to other types if specified. - * @param message GetUptimeCheckConfigRequest + * Creates a plain object from an UptimeCheckConfig message. Also converts values to other types if specified. + * @param message UptimeCheckConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.GetUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.UptimeCheckConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetUptimeCheckConfigRequest to JSON. + * Converts this UptimeCheckConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateUptimeCheckConfigRequest. */ - interface ICreateUptimeCheckConfigRequest { + namespace UptimeCheckConfig { - /** CreateUptimeCheckConfigRequest parent */ - parent?: (string|null); + /** Properties of a ResourceGroup. */ + interface IResourceGroup { - /** CreateUptimeCheckConfigRequest uptimeCheckConfig */ - uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); - } + /** ResourceGroup groupId */ + groupId?: (string|null); - /** Represents a CreateUptimeCheckConfigRequest. */ - class CreateUptimeCheckConfigRequest implements ICreateUptimeCheckConfigRequest { + /** ResourceGroup resourceType */ + resourceType?: (google.monitoring.v3.GroupResourceType|keyof typeof google.monitoring.v3.GroupResourceType|null); + } - /** - * Constructs a new CreateUptimeCheckConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.ICreateUptimeCheckConfigRequest); + /** Represents a ResourceGroup. */ + class ResourceGroup implements IResourceGroup { - /** CreateUptimeCheckConfigRequest parent. */ - public parent: string; + /** + * Constructs a new ResourceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.UptimeCheckConfig.IResourceGroup); - /** CreateUptimeCheckConfigRequest uptimeCheckConfig. */ - public uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); + /** ResourceGroup groupId. */ + public groupId: string; - /** - * Creates a new CreateUptimeCheckConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateUptimeCheckConfigRequest instance - */ - public static create(properties?: google.monitoring.v3.ICreateUptimeCheckConfigRequest): google.monitoring.v3.CreateUptimeCheckConfigRequest; + /** ResourceGroup resourceType. */ + public resourceType: (google.monitoring.v3.GroupResourceType|keyof typeof google.monitoring.v3.GroupResourceType); - /** - * Encodes the specified CreateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. - * @param message CreateUptimeCheckConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.ICreateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ResourceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceGroup instance + */ + public static create(properties?: google.monitoring.v3.UptimeCheckConfig.IResourceGroup): google.monitoring.v3.UptimeCheckConfig.ResourceGroup; - /** - * Encodes the specified CreateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. - * @param message CreateUptimeCheckConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.ICreateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ResourceGroup message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ResourceGroup.verify|verify} messages. + * @param message ResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.UptimeCheckConfig.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceGroup message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ResourceGroup.verify|verify} messages. + * @param message ResourceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceGroup + * @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.monitoring.v3.UptimeCheckConfig.ResourceGroup; + + /** + * Decodes a ResourceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceGroup + * @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.monitoring.v3.UptimeCheckConfig.ResourceGroup; + + /** + * Verifies a ResourceGroup 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 ResourceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceGroup + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.ResourceGroup; - /** - * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateUptimeCheckConfigRequest - * @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.monitoring.v3.CreateUptimeCheckConfigRequest; + /** + * Creates a plain object from a ResourceGroup message. Also converts values to other types if specified. + * @param message ResourceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UptimeCheckConfig.ResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateUptimeCheckConfigRequest - * @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.monitoring.v3.CreateUptimeCheckConfigRequest; + /** + * Converts this ResourceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a CreateUptimeCheckConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a HttpCheck. */ + interface IHttpCheck { - /** - * Creates a CreateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateUptimeCheckConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateUptimeCheckConfigRequest; + /** HttpCheck useSsl */ + useSsl?: (boolean|null); - /** - * Creates a plain object from a CreateUptimeCheckConfigRequest message. Also converts values to other types if specified. - * @param message CreateUptimeCheckConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.CreateUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** HttpCheck path */ + path?: (string|null); - /** - * Converts this CreateUptimeCheckConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** HttpCheck port */ + port?: (number|null); - /** Properties of an UpdateUptimeCheckConfigRequest. */ - interface IUpdateUptimeCheckConfigRequest { + /** HttpCheck authInfo */ + authInfo?: (google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication|null); - /** UpdateUptimeCheckConfigRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** HttpCheck maskHeaders */ + maskHeaders?: (boolean|null); - /** UpdateUptimeCheckConfigRequest uptimeCheckConfig */ - uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); - } + /** HttpCheck headers */ + headers?: ({ [k: string]: string }|null); - /** Represents an UpdateUptimeCheckConfigRequest. */ - class UpdateUptimeCheckConfigRequest implements IUpdateUptimeCheckConfigRequest { + /** HttpCheck validateSsl */ + validateSsl?: (boolean|null); + } - /** - * Constructs a new UpdateUptimeCheckConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IUpdateUptimeCheckConfigRequest); + /** Represents a HttpCheck. */ + class HttpCheck implements IHttpCheck { - /** UpdateUptimeCheckConfigRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Constructs a new HttpCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.UptimeCheckConfig.IHttpCheck); - /** UpdateUptimeCheckConfigRequest uptimeCheckConfig. */ - public uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); + /** HttpCheck useSsl. */ + public useSsl: boolean; - /** - * Creates a new UpdateUptimeCheckConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateUptimeCheckConfigRequest instance - */ - public static create(properties?: google.monitoring.v3.IUpdateUptimeCheckConfigRequest): google.monitoring.v3.UpdateUptimeCheckConfigRequest; + /** HttpCheck path. */ + public path: string; - /** - * Encodes the specified UpdateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. - * @param message UpdateUptimeCheckConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IUpdateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpCheck port. */ + public port: number; - /** - * Encodes the specified UpdateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. - * @param message UpdateUptimeCheckConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IUpdateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpCheck authInfo. */ + public authInfo?: (google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication|null); - /** - * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateUptimeCheckConfigRequest - * @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.monitoring.v3.UpdateUptimeCheckConfigRequest; + /** HttpCheck maskHeaders. */ + public maskHeaders: boolean; - /** - * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateUptimeCheckConfigRequest - * @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.monitoring.v3.UpdateUptimeCheckConfigRequest; + /** HttpCheck headers. */ + public headers: { [k: string]: string }; - /** - * Verifies an UpdateUptimeCheckConfigRequest 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); + /** HttpCheck validateSsl. */ + public validateSsl: boolean; - /** - * Creates an UpdateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateUptimeCheckConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateUptimeCheckConfigRequest; + /** + * Creates a new HttpCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpCheck instance + */ + public static create(properties?: google.monitoring.v3.UptimeCheckConfig.IHttpCheck): google.monitoring.v3.UptimeCheckConfig.HttpCheck; - /** - * Creates a plain object from an UpdateUptimeCheckConfigRequest message. Also converts values to other types if specified. - * @param message UpdateUptimeCheckConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UpdateUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified HttpCheck message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.verify|verify} messages. + * @param message HttpCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.UptimeCheckConfig.IHttpCheck, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this UpdateUptimeCheckConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified HttpCheck message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.verify|verify} messages. + * @param message HttpCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.IHttpCheck, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a DeleteUptimeCheckConfigRequest. */ - interface IDeleteUptimeCheckConfigRequest { + /** + * Decodes a HttpCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpCheck + * @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.monitoring.v3.UptimeCheckConfig.HttpCheck; - /** DeleteUptimeCheckConfigRequest name */ - name?: (string|null); - } + /** + * Decodes a HttpCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpCheck + * @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.monitoring.v3.UptimeCheckConfig.HttpCheck; - /** Represents a DeleteUptimeCheckConfigRequest. */ - class DeleteUptimeCheckConfigRequest implements IDeleteUptimeCheckConfigRequest { + /** + * Verifies a HttpCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new DeleteUptimeCheckConfigRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IDeleteUptimeCheckConfigRequest); + /** + * Creates a HttpCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpCheck + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.HttpCheck; - /** DeleteUptimeCheckConfigRequest name. */ - public name: string; + /** + * Creates a plain object from a HttpCheck message. Also converts values to other types if specified. + * @param message HttpCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new DeleteUptimeCheckConfigRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteUptimeCheckConfigRequest instance - */ - public static create(properties?: google.monitoring.v3.IDeleteUptimeCheckConfigRequest): google.monitoring.v3.DeleteUptimeCheckConfigRequest; + /** + * Converts this HttpCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HttpCheck { - /** - * Encodes the specified DeleteUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. - * @param message DeleteUptimeCheckConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IDeleteUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a BasicAuthentication. */ + interface IBasicAuthentication { - /** - * Encodes the specified DeleteUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. - * @param message DeleteUptimeCheckConfigRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IDeleteUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** BasicAuthentication username */ + username?: (string|null); - /** - * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteUptimeCheckConfigRequest - * @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.monitoring.v3.DeleteUptimeCheckConfigRequest; + /** BasicAuthentication password */ + password?: (string|null); + } - /** - * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteUptimeCheckConfigRequest - * @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.monitoring.v3.DeleteUptimeCheckConfigRequest; + /** Represents a BasicAuthentication. */ + class BasicAuthentication implements IBasicAuthentication { - /** - * Verifies a DeleteUptimeCheckConfigRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new BasicAuthentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication); - /** - * Creates a DeleteUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteUptimeCheckConfigRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteUptimeCheckConfigRequest; + /** BasicAuthentication username. */ + public username: string; - /** - * Creates a plain object from a DeleteUptimeCheckConfigRequest message. Also converts values to other types if specified. - * @param message DeleteUptimeCheckConfigRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.DeleteUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BasicAuthentication password. */ + public password: string; - /** - * Converts this DeleteUptimeCheckConfigRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new BasicAuthentication instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicAuthentication instance + */ + public static create(properties?: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication): google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; - /** Properties of a ListUptimeCheckIpsRequest. */ - interface IListUptimeCheckIpsRequest { + /** + * Encodes the specified BasicAuthentication message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication.verify|verify} messages. + * @param message BasicAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListUptimeCheckIpsRequest pageSize */ - pageSize?: (number|null); + /** + * Encodes the specified BasicAuthentication message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication.verify|verify} messages. + * @param message BasicAuthentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListUptimeCheckIpsRequest pageToken */ - pageToken?: (string|null); - } + /** + * Decodes a BasicAuthentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicAuthentication + * @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.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; - /** Represents a ListUptimeCheckIpsRequest. */ - class ListUptimeCheckIpsRequest implements IListUptimeCheckIpsRequest { + /** + * Decodes a BasicAuthentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicAuthentication + * @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.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; - /** - * Constructs a new ListUptimeCheckIpsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListUptimeCheckIpsRequest); + /** + * Verifies a BasicAuthentication 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); - /** ListUptimeCheckIpsRequest pageSize. */ - public pageSize: number; + /** + * Creates a BasicAuthentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicAuthentication + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; - /** ListUptimeCheckIpsRequest pageToken. */ - public pageToken: string; + /** + * Creates a plain object from a BasicAuthentication message. Also converts values to other types if specified. + * @param message BasicAuthentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new ListUptimeCheckIpsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUptimeCheckIpsRequest instance - */ - public static create(properties?: google.monitoring.v3.IListUptimeCheckIpsRequest): google.monitoring.v3.ListUptimeCheckIpsRequest; + /** + * Converts this BasicAuthentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Encodes the specified ListUptimeCheckIpsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. - * @param message ListUptimeCheckIpsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListUptimeCheckIpsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a TcpCheck. */ + interface ITcpCheck { - /** - * Encodes the specified ListUptimeCheckIpsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. - * @param message ListUptimeCheckIpsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckIpsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** TcpCheck port */ + port?: (number|null); + } - /** - * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUptimeCheckIpsRequest - * @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.monitoring.v3.ListUptimeCheckIpsRequest; + /** Represents a TcpCheck. */ + class TcpCheck implements ITcpCheck { - /** - * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUptimeCheckIpsRequest - * @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.monitoring.v3.ListUptimeCheckIpsRequest; + /** + * Constructs a new TcpCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.UptimeCheckConfig.ITcpCheck); - /** - * Verifies a ListUptimeCheckIpsRequest 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); + /** TcpCheck port. */ + public port: number; - /** - * Creates a ListUptimeCheckIpsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUptimeCheckIpsRequest - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckIpsRequest; + /** + * Creates a new TcpCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns TcpCheck instance + */ + public static create(properties?: google.monitoring.v3.UptimeCheckConfig.ITcpCheck): google.monitoring.v3.UptimeCheckConfig.TcpCheck; - /** - * Creates a plain object from a ListUptimeCheckIpsRequest message. Also converts values to other types if specified. - * @param message ListUptimeCheckIpsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListUptimeCheckIpsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified TcpCheck message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.TcpCheck.verify|verify} messages. + * @param message TcpCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.UptimeCheckConfig.ITcpCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TcpCheck message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.TcpCheck.verify|verify} messages. + * @param message TcpCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.ITcpCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TcpCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TcpCheck + * @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.monitoring.v3.UptimeCheckConfig.TcpCheck; - /** - * Converts this ListUptimeCheckIpsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a TcpCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TcpCheck + * @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.monitoring.v3.UptimeCheckConfig.TcpCheck; - /** Properties of a ListUptimeCheckIpsResponse. */ - interface IListUptimeCheckIpsResponse { + /** + * Verifies a TcpCheck 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); - /** ListUptimeCheckIpsResponse uptimeCheckIps */ - uptimeCheckIps?: (google.monitoring.v3.IUptimeCheckIp[]|null); + /** + * Creates a TcpCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TcpCheck + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.TcpCheck; - /** ListUptimeCheckIpsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * Creates a plain object from a TcpCheck message. Also converts values to other types if specified. + * @param message TcpCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UptimeCheckConfig.TcpCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a ListUptimeCheckIpsResponse. */ - class ListUptimeCheckIpsResponse implements IListUptimeCheckIpsResponse { + /** + * Converts this TcpCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ListUptimeCheckIpsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IListUptimeCheckIpsResponse); + /** Properties of a ContentMatcher. */ + interface IContentMatcher { - /** ListUptimeCheckIpsResponse uptimeCheckIps. */ - public uptimeCheckIps: google.monitoring.v3.IUptimeCheckIp[]; + /** ContentMatcher content */ + content?: (string|null); - /** ListUptimeCheckIpsResponse nextPageToken. */ - public nextPageToken: string; + /** ContentMatcher matcher */ + matcher?: (google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption|keyof typeof google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption|null); + } - /** - * Creates a new ListUptimeCheckIpsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUptimeCheckIpsResponse instance - */ - public static create(properties?: google.monitoring.v3.IListUptimeCheckIpsResponse): google.monitoring.v3.ListUptimeCheckIpsResponse; + /** Represents a ContentMatcher. */ + class ContentMatcher implements IContentMatcher { - /** - * Encodes the specified ListUptimeCheckIpsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. - * @param message ListUptimeCheckIpsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.IListUptimeCheckIpsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ContentMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.UptimeCheckConfig.IContentMatcher); - /** - * Encodes the specified ListUptimeCheckIpsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. - * @param message ListUptimeCheckIpsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckIpsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ContentMatcher content. */ + public content: string; - /** - * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUptimeCheckIpsResponse - * @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.monitoring.v3.ListUptimeCheckIpsResponse; + /** ContentMatcher matcher. */ + public matcher: (google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption|keyof typeof google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption); - /** - * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUptimeCheckIpsResponse - * @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.monitoring.v3.ListUptimeCheckIpsResponse; + /** + * Creates a new ContentMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentMatcher instance + */ + public static create(properties?: google.monitoring.v3.UptimeCheckConfig.IContentMatcher): google.monitoring.v3.UptimeCheckConfig.ContentMatcher; - /** - * Verifies a ListUptimeCheckIpsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ContentMatcher message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ContentMatcher.verify|verify} messages. + * @param message ContentMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.UptimeCheckConfig.IContentMatcher, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a ListUptimeCheckIpsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUptimeCheckIpsResponse - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckIpsResponse; + /** + * Encodes the specified ContentMatcher message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ContentMatcher.verify|verify} messages. + * @param message ContentMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.IContentMatcher, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ListUptimeCheckIpsResponse message. Also converts values to other types if specified. - * @param message ListUptimeCheckIpsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.ListUptimeCheckIpsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ContentMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentMatcher + * @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.monitoring.v3.UptimeCheckConfig.ContentMatcher; - /** - * Converts this ListUptimeCheckIpsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ContentMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentMatcher + * @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.monitoring.v3.UptimeCheckConfig.ContentMatcher; - /** Properties of an InternalChecker. */ - interface IInternalChecker { + /** + * Verifies a ContentMatcher 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); - /** InternalChecker name */ - name?: (string|null); + /** + * Creates a ContentMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentMatcher + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.ContentMatcher; - /** InternalChecker displayName */ - displayName?: (string|null); + /** + * Creates a plain object from a ContentMatcher message. Also converts values to other types if specified. + * @param message ContentMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UptimeCheckConfig.ContentMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** InternalChecker network */ - network?: (string|null); + /** + * Converts this ContentMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** InternalChecker gcpZone */ - gcpZone?: (string|null); + namespace ContentMatcher { - /** InternalChecker peerProjectId */ - peerProjectId?: (string|null); + /** ContentMatcherOption enum. */ + enum ContentMatcherOption { + CONTENT_MATCHER_OPTION_UNSPECIFIED = 0, + CONTAINS_STRING = 1, + NOT_CONTAINS_STRING = 2, + MATCHES_REGEX = 3, + NOT_MATCHES_REGEX = 4 + } + } + } - /** InternalChecker state */ - state?: (google.monitoring.v3.InternalChecker.State|keyof typeof google.monitoring.v3.InternalChecker.State|null); + /** GroupResourceType enum. */ + enum GroupResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + INSTANCE = 1, + AWS_ELB_LOAD_BALANCER = 2 } - /** Represents an InternalChecker. */ - class InternalChecker implements IInternalChecker { + /** Properties of an UptimeCheckIp. */ + interface IUptimeCheckIp { - /** - * Constructs a new InternalChecker. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.IInternalChecker); + /** UptimeCheckIp region */ + region?: (google.monitoring.v3.UptimeCheckRegion|keyof typeof google.monitoring.v3.UptimeCheckRegion|null); - /** InternalChecker name. */ - public name: string; + /** UptimeCheckIp location */ + location?: (string|null); - /** InternalChecker displayName. */ - public displayName: string; + /** UptimeCheckIp ipAddress */ + ipAddress?: (string|null); + } - /** InternalChecker network. */ - public network: string; + /** Represents an UptimeCheckIp. */ + class UptimeCheckIp implements IUptimeCheckIp { + + /** + * Constructs a new UptimeCheckIp. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IUptimeCheckIp); - /** InternalChecker gcpZone. */ - public gcpZone: string; + /** UptimeCheckIp region. */ + public region: (google.monitoring.v3.UptimeCheckRegion|keyof typeof google.monitoring.v3.UptimeCheckRegion); - /** InternalChecker peerProjectId. */ - public peerProjectId: string; + /** UptimeCheckIp location. */ + public location: string; - /** InternalChecker state. */ - public state: (google.monitoring.v3.InternalChecker.State|keyof typeof google.monitoring.v3.InternalChecker.State); + /** UptimeCheckIp ipAddress. */ + public ipAddress: string; /** - * Creates a new InternalChecker instance using the specified properties. + * Creates a new UptimeCheckIp instance using the specified properties. * @param [properties] Properties to set - * @returns InternalChecker instance + * @returns UptimeCheckIp instance */ - public static create(properties?: google.monitoring.v3.IInternalChecker): google.monitoring.v3.InternalChecker; + public static create(properties?: google.monitoring.v3.IUptimeCheckIp): google.monitoring.v3.UptimeCheckIp; /** - * Encodes the specified InternalChecker message. Does not implicitly {@link google.monitoring.v3.InternalChecker.verify|verify} messages. - * @param message InternalChecker message or plain object to encode + * Encodes the specified UptimeCheckIp message. Does not implicitly {@link google.monitoring.v3.UptimeCheckIp.verify|verify} messages. + * @param message UptimeCheckIp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IInternalChecker, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IUptimeCheckIp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InternalChecker message, length delimited. Does not implicitly {@link google.monitoring.v3.InternalChecker.verify|verify} messages. - * @param message InternalChecker message or plain object to encode + * Encodes the specified UptimeCheckIp message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckIp.verify|verify} messages. + * @param message UptimeCheckIp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IInternalChecker, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IUptimeCheckIp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InternalChecker message from the specified reader or buffer. + * Decodes an UptimeCheckIp message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InternalChecker + * @returns UptimeCheckIp * @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.monitoring.v3.InternalChecker; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.UptimeCheckIp; /** - * Decodes an InternalChecker message from the specified reader or buffer, length delimited. + * Decodes an UptimeCheckIp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InternalChecker + * @returns UptimeCheckIp * @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.monitoring.v3.InternalChecker; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.UptimeCheckIp; /** - * Verifies an InternalChecker message. + * Verifies an UptimeCheckIp 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 InternalChecker message from a plain object. Also converts values to their respective internal types. + * Creates an UptimeCheckIp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InternalChecker + * @returns UptimeCheckIp */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.InternalChecker; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckIp; /** - * Creates a plain object from an InternalChecker message. Also converts values to other types if specified. - * @param message InternalChecker + * Creates a plain object from an UptimeCheckIp message. Also converts values to other types if specified. + * @param message UptimeCheckIp * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.InternalChecker, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.UptimeCheckIp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InternalChecker to JSON. + * Converts this UptimeCheckIp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace InternalChecker { + /** Represents an UptimeCheckService */ + class UptimeCheckService extends $protobuf.rpc.Service { - /** State enum. */ - enum State { - UNSPECIFIED = 0, - CREATING = 1, - RUNNING = 2 - } - } + /** + * Constructs a new UptimeCheckService 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); - /** Properties of an UptimeCheckConfig. */ - interface IUptimeCheckConfig { + /** + * Creates new UptimeCheckService 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): UptimeCheckService; - /** UptimeCheckConfig name */ - name?: (string|null); + /** + * Calls ListUptimeCheckConfigs. + * @param request ListUptimeCheckConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUptimeCheckConfigsResponse + */ + public listUptimeCheckConfigs(request: google.monitoring.v3.IListUptimeCheckConfigsRequest, callback: google.monitoring.v3.UptimeCheckService.ListUptimeCheckConfigsCallback): void; - /** UptimeCheckConfig displayName */ - displayName?: (string|null); + /** + * Calls ListUptimeCheckConfigs. + * @param request ListUptimeCheckConfigsRequest message or plain object + * @returns Promise + */ + public listUptimeCheckConfigs(request: google.monitoring.v3.IListUptimeCheckConfigsRequest): Promise; - /** UptimeCheckConfig monitoredResource */ - monitoredResource?: (google.api.IMonitoredResource|null); + /** + * Calls GetUptimeCheckConfig. + * @param request GetUptimeCheckConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UptimeCheckConfig + */ + public getUptimeCheckConfig(request: google.monitoring.v3.IGetUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.GetUptimeCheckConfigCallback): void; - /** UptimeCheckConfig resourceGroup */ - resourceGroup?: (google.monitoring.v3.UptimeCheckConfig.IResourceGroup|null); + /** + * Calls GetUptimeCheckConfig. + * @param request GetUptimeCheckConfigRequest message or plain object + * @returns Promise + */ + public getUptimeCheckConfig(request: google.monitoring.v3.IGetUptimeCheckConfigRequest): Promise; - /** UptimeCheckConfig httpCheck */ - httpCheck?: (google.monitoring.v3.UptimeCheckConfig.IHttpCheck|null); + /** + * Calls CreateUptimeCheckConfig. + * @param request CreateUptimeCheckConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UptimeCheckConfig + */ + public createUptimeCheckConfig(request: google.monitoring.v3.ICreateUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.CreateUptimeCheckConfigCallback): void; - /** UptimeCheckConfig tcpCheck */ - tcpCheck?: (google.monitoring.v3.UptimeCheckConfig.ITcpCheck|null); + /** + * Calls CreateUptimeCheckConfig. + * @param request CreateUptimeCheckConfigRequest message or plain object + * @returns Promise + */ + public createUptimeCheckConfig(request: google.monitoring.v3.ICreateUptimeCheckConfigRequest): Promise; - /** UptimeCheckConfig period */ - period?: (google.protobuf.IDuration|null); + /** + * Calls UpdateUptimeCheckConfig. + * @param request UpdateUptimeCheckConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UptimeCheckConfig + */ + public updateUptimeCheckConfig(request: google.monitoring.v3.IUpdateUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.UpdateUptimeCheckConfigCallback): void; - /** UptimeCheckConfig timeout */ - timeout?: (google.protobuf.IDuration|null); + /** + * Calls UpdateUptimeCheckConfig. + * @param request UpdateUptimeCheckConfigRequest message or plain object + * @returns Promise + */ + public updateUptimeCheckConfig(request: google.monitoring.v3.IUpdateUptimeCheckConfigRequest): Promise; - /** UptimeCheckConfig contentMatchers */ - contentMatchers?: (google.monitoring.v3.UptimeCheckConfig.IContentMatcher[]|null); + /** + * Calls DeleteUptimeCheckConfig. + * @param request DeleteUptimeCheckConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUptimeCheckConfig(request: google.monitoring.v3.IDeleteUptimeCheckConfigRequest, callback: google.monitoring.v3.UptimeCheckService.DeleteUptimeCheckConfigCallback): void; - /** UptimeCheckConfig selectedRegions */ - selectedRegions?: (google.monitoring.v3.UptimeCheckRegion[]|null); + /** + * Calls DeleteUptimeCheckConfig. + * @param request DeleteUptimeCheckConfigRequest message or plain object + * @returns Promise + */ + public deleteUptimeCheckConfig(request: google.monitoring.v3.IDeleteUptimeCheckConfigRequest): Promise; - /** UptimeCheckConfig isInternal */ - isInternal?: (boolean|null); + /** + * Calls ListUptimeCheckIps. + * @param request ListUptimeCheckIpsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUptimeCheckIpsResponse + */ + public listUptimeCheckIps(request: google.monitoring.v3.IListUptimeCheckIpsRequest, callback: google.monitoring.v3.UptimeCheckService.ListUptimeCheckIpsCallback): void; - /** UptimeCheckConfig internalCheckers */ - internalCheckers?: (google.monitoring.v3.IInternalChecker[]|null); + /** + * Calls ListUptimeCheckIps. + * @param request ListUptimeCheckIpsRequest message or plain object + * @returns Promise + */ + public listUptimeCheckIps(request: google.monitoring.v3.IListUptimeCheckIpsRequest): Promise; } - /** Represents an UptimeCheckConfig. */ - class UptimeCheckConfig implements IUptimeCheckConfig { + namespace UptimeCheckService { /** - * Constructs a new UptimeCheckConfig. - * @param [properties] Properties to set + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckConfigs}. + * @param error Error, if any + * @param [response] ListUptimeCheckConfigsResponse */ - constructor(properties?: google.monitoring.v3.IUptimeCheckConfig); + type ListUptimeCheckConfigsCallback = (error: (Error|null), response?: google.monitoring.v3.ListUptimeCheckConfigsResponse) => void; - /** UptimeCheckConfig name. */ - public name: string; + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#getUptimeCheckConfig}. + * @param error Error, if any + * @param [response] UptimeCheckConfig + */ + type GetUptimeCheckConfigCallback = (error: (Error|null), response?: google.monitoring.v3.UptimeCheckConfig) => void; - /** UptimeCheckConfig displayName. */ - public displayName: string; + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#createUptimeCheckConfig}. + * @param error Error, if any + * @param [response] UptimeCheckConfig + */ + type CreateUptimeCheckConfigCallback = (error: (Error|null), response?: google.monitoring.v3.UptimeCheckConfig) => void; - /** UptimeCheckConfig monitoredResource. */ - public monitoredResource?: (google.api.IMonitoredResource|null); + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#updateUptimeCheckConfig}. + * @param error Error, if any + * @param [response] UptimeCheckConfig + */ + type UpdateUptimeCheckConfigCallback = (error: (Error|null), response?: google.monitoring.v3.UptimeCheckConfig) => void; - /** UptimeCheckConfig resourceGroup. */ - public resourceGroup?: (google.monitoring.v3.UptimeCheckConfig.IResourceGroup|null); + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#deleteUptimeCheckConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUptimeCheckConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** UptimeCheckConfig httpCheck. */ - public httpCheck?: (google.monitoring.v3.UptimeCheckConfig.IHttpCheck|null); + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckIps}. + * @param error Error, if any + * @param [response] ListUptimeCheckIpsResponse + */ + type ListUptimeCheckIpsCallback = (error: (Error|null), response?: google.monitoring.v3.ListUptimeCheckIpsResponse) => void; + } - /** UptimeCheckConfig tcpCheck. */ - public tcpCheck?: (google.monitoring.v3.UptimeCheckConfig.ITcpCheck|null); + /** Properties of a ListUptimeCheckConfigsRequest. */ + interface IListUptimeCheckConfigsRequest { - /** UptimeCheckConfig period. */ - public period?: (google.protobuf.IDuration|null); + /** ListUptimeCheckConfigsRequest parent */ + parent?: (string|null); - /** UptimeCheckConfig timeout. */ - public timeout?: (google.protobuf.IDuration|null); + /** ListUptimeCheckConfigsRequest pageSize */ + pageSize?: (number|null); - /** UptimeCheckConfig contentMatchers. */ - public contentMatchers: google.monitoring.v3.UptimeCheckConfig.IContentMatcher[]; + /** ListUptimeCheckConfigsRequest pageToken */ + pageToken?: (string|null); + } - /** UptimeCheckConfig selectedRegions. */ - public selectedRegions: google.monitoring.v3.UptimeCheckRegion[]; + /** Represents a ListUptimeCheckConfigsRequest. */ + class ListUptimeCheckConfigsRequest implements IListUptimeCheckConfigsRequest { - /** UptimeCheckConfig isInternal. */ - public isInternal: boolean; + /** + * Constructs a new ListUptimeCheckConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListUptimeCheckConfigsRequest); - /** UptimeCheckConfig internalCheckers. */ - public internalCheckers: google.monitoring.v3.IInternalChecker[]; + /** ListUptimeCheckConfigsRequest parent. */ + public parent: string; - /** UptimeCheckConfig resource. */ - public resource?: ("monitoredResource"|"resourceGroup"); + /** ListUptimeCheckConfigsRequest pageSize. */ + public pageSize: number; - /** UptimeCheckConfig checkRequestType. */ - public checkRequestType?: ("httpCheck"|"tcpCheck"); + /** ListUptimeCheckConfigsRequest pageToken. */ + public pageToken: string; /** - * Creates a new UptimeCheckConfig instance using the specified properties. + * Creates a new ListUptimeCheckConfigsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UptimeCheckConfig instance + * @returns ListUptimeCheckConfigsRequest instance */ - public static create(properties?: google.monitoring.v3.IUptimeCheckConfig): google.monitoring.v3.UptimeCheckConfig; + public static create(properties?: google.monitoring.v3.IListUptimeCheckConfigsRequest): google.monitoring.v3.ListUptimeCheckConfigsRequest; /** - * Encodes the specified UptimeCheckConfig message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.verify|verify} messages. - * @param message UptimeCheckConfig message or plain object to encode + * Encodes the specified ListUptimeCheckConfigsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. + * @param message ListUptimeCheckConfigsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IUptimeCheckConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListUptimeCheckConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UptimeCheckConfig message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.verify|verify} messages. - * @param message UptimeCheckConfig message or plain object to encode + * Encodes the specified ListUptimeCheckConfigsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. + * @param message ListUptimeCheckConfigsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IUptimeCheckConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UptimeCheckConfig message from the specified reader or buffer. + * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UptimeCheckConfig + * @returns ListUptimeCheckConfigsRequest * @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.monitoring.v3.UptimeCheckConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListUptimeCheckConfigsRequest; /** - * Decodes an UptimeCheckConfig message from the specified reader or buffer, length delimited. + * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UptimeCheckConfig + * @returns ListUptimeCheckConfigsRequest * @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.monitoring.v3.UptimeCheckConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListUptimeCheckConfigsRequest; /** - * Verifies an UptimeCheckConfig message. + * Verifies a ListUptimeCheckConfigsRequest 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 UptimeCheckConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListUptimeCheckConfigsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UptimeCheckConfig + * @returns ListUptimeCheckConfigsRequest */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckConfigsRequest; /** - * Creates a plain object from an UptimeCheckConfig message. Also converts values to other types if specified. - * @param message UptimeCheckConfig + * Creates a plain object from a ListUptimeCheckConfigsRequest message. Also converts values to other types if specified. + * @param message ListUptimeCheckConfigsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.UptimeCheckConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListUptimeCheckConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UptimeCheckConfig to JSON. + * Converts this ListUptimeCheckConfigsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace UptimeCheckConfig { + /** Properties of a ListUptimeCheckConfigsResponse. */ + interface IListUptimeCheckConfigsResponse { - /** Properties of a ResourceGroup. */ - interface IResourceGroup { + /** ListUptimeCheckConfigsResponse uptimeCheckConfigs */ + uptimeCheckConfigs?: (google.monitoring.v3.IUptimeCheckConfig[]|null); - /** ResourceGroup groupId */ - groupId?: (string|null); + /** ListUptimeCheckConfigsResponse nextPageToken */ + nextPageToken?: (string|null); - /** ResourceGroup resourceType */ - resourceType?: (google.monitoring.v3.GroupResourceType|keyof typeof google.monitoring.v3.GroupResourceType|null); - } + /** ListUptimeCheckConfigsResponse totalSize */ + totalSize?: (number|null); + } - /** Represents a ResourceGroup. */ - class ResourceGroup implements IResourceGroup { + /** Represents a ListUptimeCheckConfigsResponse. */ + class ListUptimeCheckConfigsResponse implements IListUptimeCheckConfigsResponse { - /** - * Constructs a new ResourceGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.UptimeCheckConfig.IResourceGroup); + /** + * Constructs a new ListUptimeCheckConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListUptimeCheckConfigsResponse); - /** ResourceGroup groupId. */ - public groupId: string; + /** ListUptimeCheckConfigsResponse uptimeCheckConfigs. */ + public uptimeCheckConfigs: google.monitoring.v3.IUptimeCheckConfig[]; - /** ResourceGroup resourceType. */ - public resourceType: (google.monitoring.v3.GroupResourceType|keyof typeof google.monitoring.v3.GroupResourceType); + /** ListUptimeCheckConfigsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Creates a new ResourceGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceGroup instance - */ - public static create(properties?: google.monitoring.v3.UptimeCheckConfig.IResourceGroup): google.monitoring.v3.UptimeCheckConfig.ResourceGroup; + /** ListUptimeCheckConfigsResponse totalSize. */ + public totalSize: number; - /** - * Encodes the specified ResourceGroup message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ResourceGroup.verify|verify} messages. - * @param message ResourceGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.UptimeCheckConfig.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListUptimeCheckConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUptimeCheckConfigsResponse instance + */ + public static create(properties?: google.monitoring.v3.IListUptimeCheckConfigsResponse): google.monitoring.v3.ListUptimeCheckConfigsResponse; - /** - * Encodes the specified ResourceGroup message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ResourceGroup.verify|verify} messages. - * @param message ResourceGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.IResourceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListUptimeCheckConfigsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. + * @param message ListUptimeCheckConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListUptimeCheckConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ResourceGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceGroup - * @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.monitoring.v3.UptimeCheckConfig.ResourceGroup; + /** + * Encodes the specified ListUptimeCheckConfigsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. + * @param message ListUptimeCheckConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ResourceGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceGroup - * @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.monitoring.v3.UptimeCheckConfig.ResourceGroup; + /** + * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUptimeCheckConfigsResponse + * @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.monitoring.v3.ListUptimeCheckConfigsResponse; - /** - * Verifies a ResourceGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUptimeCheckConfigsResponse + * @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.monitoring.v3.ListUptimeCheckConfigsResponse; - /** - * Creates a ResourceGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceGroup - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.ResourceGroup; + /** + * Verifies a ListUptimeCheckConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a ResourceGroup message. Also converts values to other types if specified. - * @param message ResourceGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UptimeCheckConfig.ResourceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a ListUptimeCheckConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUptimeCheckConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckConfigsResponse; - /** - * Converts this ResourceGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a ListUptimeCheckConfigsResponse message. Also converts values to other types if specified. + * @param message ListUptimeCheckConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListUptimeCheckConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a HttpCheck. */ - interface IHttpCheck { + /** + * Converts this ListUptimeCheckConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** HttpCheck useSsl */ - useSsl?: (boolean|null); + /** Properties of a GetUptimeCheckConfigRequest. */ + interface IGetUptimeCheckConfigRequest { - /** HttpCheck path */ - path?: (string|null); + /** GetUptimeCheckConfigRequest name */ + name?: (string|null); + } - /** HttpCheck port */ - port?: (number|null); + /** Represents a GetUptimeCheckConfigRequest. */ + class GetUptimeCheckConfigRequest implements IGetUptimeCheckConfigRequest { - /** HttpCheck authInfo */ - authInfo?: (google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication|null); + /** + * Constructs a new GetUptimeCheckConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IGetUptimeCheckConfigRequest); + + /** GetUptimeCheckConfigRequest name. */ + public name: string; - /** HttpCheck maskHeaders */ - maskHeaders?: (boolean|null); + /** + * Creates a new GetUptimeCheckConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUptimeCheckConfigRequest instance + */ + public static create(properties?: google.monitoring.v3.IGetUptimeCheckConfigRequest): google.monitoring.v3.GetUptimeCheckConfigRequest; - /** HttpCheck headers */ - headers?: ({ [k: string]: string }|null); + /** + * Encodes the specified GetUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. + * @param message GetUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IGetUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpCheck validateSsl */ - validateSsl?: (boolean|null); - } + /** + * Encodes the specified GetUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. + * @param message GetUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IGetUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a HttpCheck. */ - class HttpCheck implements IHttpCheck { + /** + * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUptimeCheckConfigRequest + * @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.monitoring.v3.GetUptimeCheckConfigRequest; - /** - * Constructs a new HttpCheck. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.UptimeCheckConfig.IHttpCheck); + /** + * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUptimeCheckConfigRequest + * @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.monitoring.v3.GetUptimeCheckConfigRequest; - /** HttpCheck useSsl. */ - public useSsl: boolean; + /** + * Verifies a GetUptimeCheckConfigRequest 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); - /** HttpCheck path. */ - public path: string; + /** + * Creates a GetUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUptimeCheckConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.GetUptimeCheckConfigRequest; - /** HttpCheck port. */ - public port: number; + /** + * Creates a plain object from a GetUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @param message GetUptimeCheckConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.GetUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** HttpCheck authInfo. */ - public authInfo?: (google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication|null); + /** + * Converts this GetUptimeCheckConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** HttpCheck maskHeaders. */ - public maskHeaders: boolean; + /** Properties of a CreateUptimeCheckConfigRequest. */ + interface ICreateUptimeCheckConfigRequest { - /** HttpCheck headers. */ - public headers: { [k: string]: string }; + /** CreateUptimeCheckConfigRequest parent */ + parent?: (string|null); - /** HttpCheck validateSsl. */ - public validateSsl: boolean; + /** CreateUptimeCheckConfigRequest uptimeCheckConfig */ + uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); + } - /** - * Creates a new HttpCheck instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpCheck instance - */ - public static create(properties?: google.monitoring.v3.UptimeCheckConfig.IHttpCheck): google.monitoring.v3.UptimeCheckConfig.HttpCheck; + /** Represents a CreateUptimeCheckConfigRequest. */ + class CreateUptimeCheckConfigRequest implements ICreateUptimeCheckConfigRequest { - /** - * Encodes the specified HttpCheck message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.verify|verify} messages. - * @param message HttpCheck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.UptimeCheckConfig.IHttpCheck, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new CreateUptimeCheckConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.ICreateUptimeCheckConfigRequest); - /** - * Encodes the specified HttpCheck message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.verify|verify} messages. - * @param message HttpCheck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.IHttpCheck, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateUptimeCheckConfigRequest parent. */ + public parent: string; - /** - * Decodes a HttpCheck message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpCheck - * @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.monitoring.v3.UptimeCheckConfig.HttpCheck; + /** CreateUptimeCheckConfigRequest uptimeCheckConfig. */ + public uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); - /** - * Decodes a HttpCheck message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpCheck - * @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.monitoring.v3.UptimeCheckConfig.HttpCheck; + /** + * Creates a new CreateUptimeCheckConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUptimeCheckConfigRequest instance + */ + public static create(properties?: google.monitoring.v3.ICreateUptimeCheckConfigRequest): google.monitoring.v3.CreateUptimeCheckConfigRequest; - /** - * Verifies a HttpCheck message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified CreateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. + * @param message CreateUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.ICreateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a HttpCheck message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpCheck - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.HttpCheck; + /** + * Encodes the specified CreateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. + * @param message CreateUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.ICreateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a HttpCheck message. Also converts values to other types if specified. - * @param message HttpCheck - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUptimeCheckConfigRequest + * @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.monitoring.v3.CreateUptimeCheckConfigRequest; - /** - * Converts this HttpCheck to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUptimeCheckConfigRequest + * @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.monitoring.v3.CreateUptimeCheckConfigRequest; - namespace HttpCheck { + /** + * Verifies a CreateUptimeCheckConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a BasicAuthentication. */ - interface IBasicAuthentication { + /** + * Creates a CreateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUptimeCheckConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.CreateUptimeCheckConfigRequest; - /** BasicAuthentication username */ - username?: (string|null); + /** + * Creates a plain object from a CreateUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @param message CreateUptimeCheckConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.CreateUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BasicAuthentication password */ - password?: (string|null); - } + /** + * Converts this CreateUptimeCheckConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a BasicAuthentication. */ - class BasicAuthentication implements IBasicAuthentication { + /** Properties of an UpdateUptimeCheckConfigRequest. */ + interface IUpdateUptimeCheckConfigRequest { - /** - * Constructs a new BasicAuthentication. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication); + /** UpdateUptimeCheckConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** BasicAuthentication username. */ - public username: string; + /** UpdateUptimeCheckConfigRequest uptimeCheckConfig */ + uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); + } - /** BasicAuthentication password. */ - public password: string; + /** Represents an UpdateUptimeCheckConfigRequest. */ + class UpdateUptimeCheckConfigRequest implements IUpdateUptimeCheckConfigRequest { - /** - * Creates a new BasicAuthentication instance using the specified properties. - * @param [properties] Properties to set - * @returns BasicAuthentication instance - */ - public static create(properties?: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication): google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; + /** + * Constructs a new UpdateUptimeCheckConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IUpdateUptimeCheckConfigRequest); - /** - * Encodes the specified BasicAuthentication message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication.verify|verify} messages. - * @param message BasicAuthentication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + /** UpdateUptimeCheckConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** - * Encodes the specified BasicAuthentication message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication.verify|verify} messages. - * @param message BasicAuthentication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck.IBasicAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + /** UpdateUptimeCheckConfigRequest uptimeCheckConfig. */ + public uptimeCheckConfig?: (google.monitoring.v3.IUptimeCheckConfig|null); - /** - * Decodes a BasicAuthentication message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BasicAuthentication - * @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.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; + /** + * Creates a new UpdateUptimeCheckConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUptimeCheckConfigRequest instance + */ + public static create(properties?: google.monitoring.v3.IUpdateUptimeCheckConfigRequest): google.monitoring.v3.UpdateUptimeCheckConfigRequest; - /** - * Decodes a BasicAuthentication message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BasicAuthentication - * @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.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; + /** + * Encodes the specified UpdateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. + * @param message UpdateUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IUpdateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a BasicAuthentication message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified UpdateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. + * @param message UpdateUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IUpdateUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a BasicAuthentication message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BasicAuthentication - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication; + /** + * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUptimeCheckConfigRequest + * @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.monitoring.v3.UpdateUptimeCheckConfigRequest; - /** - * Creates a plain object from a BasicAuthentication message. Also converts values to other types if specified. - * @param message BasicAuthentication - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUptimeCheckConfigRequest + * @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.monitoring.v3.UpdateUptimeCheckConfigRequest; - /** - * Converts this BasicAuthentication to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Verifies an UpdateUptimeCheckConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a TcpCheck. */ - interface ITcpCheck { + /** + * Creates an UpdateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUptimeCheckConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UpdateUptimeCheckConfigRequest; - /** TcpCheck port */ - port?: (number|null); - } + /** + * Creates a plain object from an UpdateUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @param message UpdateUptimeCheckConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.UpdateUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a TcpCheck. */ - class TcpCheck implements ITcpCheck { + /** + * Converts this UpdateUptimeCheckConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new TcpCheck. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.UptimeCheckConfig.ITcpCheck); + /** Properties of a DeleteUptimeCheckConfigRequest. */ + interface IDeleteUptimeCheckConfigRequest { - /** TcpCheck port. */ - public port: number; + /** DeleteUptimeCheckConfigRequest name */ + name?: (string|null); + } - /** - * Creates a new TcpCheck instance using the specified properties. - * @param [properties] Properties to set - * @returns TcpCheck instance - */ - public static create(properties?: google.monitoring.v3.UptimeCheckConfig.ITcpCheck): google.monitoring.v3.UptimeCheckConfig.TcpCheck; + /** Represents a DeleteUptimeCheckConfigRequest. */ + class DeleteUptimeCheckConfigRequest implements IDeleteUptimeCheckConfigRequest { - /** - * Encodes the specified TcpCheck message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.TcpCheck.verify|verify} messages. - * @param message TcpCheck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.UptimeCheckConfig.ITcpCheck, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new DeleteUptimeCheckConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IDeleteUptimeCheckConfigRequest); - /** - * Encodes the specified TcpCheck message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.TcpCheck.verify|verify} messages. - * @param message TcpCheck message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.ITcpCheck, writer?: $protobuf.Writer): $protobuf.Writer; + /** DeleteUptimeCheckConfigRequest name. */ + public name: string; - /** - * Decodes a TcpCheck message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TcpCheck - * @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.monitoring.v3.UptimeCheckConfig.TcpCheck; + /** + * Creates a new DeleteUptimeCheckConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUptimeCheckConfigRequest instance + */ + public static create(properties?: google.monitoring.v3.IDeleteUptimeCheckConfigRequest): google.monitoring.v3.DeleteUptimeCheckConfigRequest; - /** - * Decodes a TcpCheck message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TcpCheck - * @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.monitoring.v3.UptimeCheckConfig.TcpCheck; + /** + * Encodes the specified DeleteUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. + * @param message DeleteUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IDeleteUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a TcpCheck message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified DeleteUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. + * @param message DeleteUptimeCheckConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IDeleteUptimeCheckConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a TcpCheck message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TcpCheck - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.TcpCheck; + /** + * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUptimeCheckConfigRequest + * @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.monitoring.v3.DeleteUptimeCheckConfigRequest; - /** - * Creates a plain object from a TcpCheck message. Also converts values to other types if specified. - * @param message TcpCheck - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UptimeCheckConfig.TcpCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUptimeCheckConfigRequest + * @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.monitoring.v3.DeleteUptimeCheckConfigRequest; - /** - * Converts this TcpCheck to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a DeleteUptimeCheckConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a ContentMatcher. */ - interface IContentMatcher { + /** + * Creates a DeleteUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUptimeCheckConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.DeleteUptimeCheckConfigRequest; - /** ContentMatcher content */ - content?: (string|null); + /** + * Creates a plain object from a DeleteUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @param message DeleteUptimeCheckConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.DeleteUptimeCheckConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ContentMatcher matcher */ - matcher?: (google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption|keyof typeof google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption|null); - } + /** + * Converts this DeleteUptimeCheckConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a ContentMatcher. */ - class ContentMatcher implements IContentMatcher { + /** Properties of a ListUptimeCheckIpsRequest. */ + interface IListUptimeCheckIpsRequest { - /** - * Constructs a new ContentMatcher. - * @param [properties] Properties to set - */ - constructor(properties?: google.monitoring.v3.UptimeCheckConfig.IContentMatcher); + /** ListUptimeCheckIpsRequest pageSize */ + pageSize?: (number|null); - /** ContentMatcher content. */ - public content: string; + /** ListUptimeCheckIpsRequest pageToken */ + pageToken?: (string|null); + } - /** ContentMatcher matcher. */ - public matcher: (google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption|keyof typeof google.monitoring.v3.UptimeCheckConfig.ContentMatcher.ContentMatcherOption); + /** Represents a ListUptimeCheckIpsRequest. */ + class ListUptimeCheckIpsRequest implements IListUptimeCheckIpsRequest { - /** - * Creates a new ContentMatcher instance using the specified properties. - * @param [properties] Properties to set - * @returns ContentMatcher instance - */ - public static create(properties?: google.monitoring.v3.UptimeCheckConfig.IContentMatcher): google.monitoring.v3.UptimeCheckConfig.ContentMatcher; + /** + * Constructs a new ListUptimeCheckIpsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.monitoring.v3.IListUptimeCheckIpsRequest); - /** - * Encodes the specified ContentMatcher message. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ContentMatcher.verify|verify} messages. - * @param message ContentMatcher message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.monitoring.v3.UptimeCheckConfig.IContentMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListUptimeCheckIpsRequest pageSize. */ + public pageSize: number; - /** - * Encodes the specified ContentMatcher message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckConfig.ContentMatcher.verify|verify} messages. - * @param message ContentMatcher message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.monitoring.v3.UptimeCheckConfig.IContentMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListUptimeCheckIpsRequest pageToken. */ + public pageToken: string; - /** - * Decodes a ContentMatcher message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ContentMatcher - * @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.monitoring.v3.UptimeCheckConfig.ContentMatcher; + /** + * Creates a new ListUptimeCheckIpsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUptimeCheckIpsRequest instance + */ + public static create(properties?: google.monitoring.v3.IListUptimeCheckIpsRequest): google.monitoring.v3.ListUptimeCheckIpsRequest; - /** - * Decodes a ContentMatcher message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ContentMatcher - * @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.monitoring.v3.UptimeCheckConfig.ContentMatcher; + /** + * Encodes the specified ListUptimeCheckIpsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. + * @param message ListUptimeCheckIpsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.monitoring.v3.IListUptimeCheckIpsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a ContentMatcher message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ListUptimeCheckIpsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. + * @param message ListUptimeCheckIpsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckIpsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a ContentMatcher message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ContentMatcher - */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckConfig.ContentMatcher; + /** + * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUptimeCheckIpsRequest + * @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.monitoring.v3.ListUptimeCheckIpsRequest; - /** - * Creates a plain object from a ContentMatcher message. Also converts values to other types if specified. - * @param message ContentMatcher - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.monitoring.v3.UptimeCheckConfig.ContentMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUptimeCheckIpsRequest + * @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.monitoring.v3.ListUptimeCheckIpsRequest; - /** - * Converts this ContentMatcher to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a ListUptimeCheckIpsRequest 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); - namespace ContentMatcher { + /** + * Creates a ListUptimeCheckIpsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUptimeCheckIpsRequest + */ + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckIpsRequest; - /** ContentMatcherOption enum. */ - enum ContentMatcherOption { - CONTENT_MATCHER_OPTION_UNSPECIFIED = 0, - CONTAINS_STRING = 1, - NOT_CONTAINS_STRING = 2, - MATCHES_REGEX = 3, - NOT_MATCHES_REGEX = 4 - } - } - } + /** + * Creates a plain object from a ListUptimeCheckIpsRequest message. Also converts values to other types if specified. + * @param message ListUptimeCheckIpsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.monitoring.v3.ListUptimeCheckIpsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UptimeCheckRegion enum. */ - enum UptimeCheckRegion { - REGION_UNSPECIFIED = 0, - USA = 1, - EUROPE = 2, - SOUTH_AMERICA = 3, - ASIA_PACIFIC = 4 + /** + * Converts this ListUptimeCheckIpsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of an UptimeCheckIp. */ - interface IUptimeCheckIp { - - /** UptimeCheckIp region */ - region?: (google.monitoring.v3.UptimeCheckRegion|keyof typeof google.monitoring.v3.UptimeCheckRegion|null); + /** Properties of a ListUptimeCheckIpsResponse. */ + interface IListUptimeCheckIpsResponse { - /** UptimeCheckIp location */ - location?: (string|null); + /** ListUptimeCheckIpsResponse uptimeCheckIps */ + uptimeCheckIps?: (google.monitoring.v3.IUptimeCheckIp[]|null); - /** UptimeCheckIp ipAddress */ - ipAddress?: (string|null); + /** ListUptimeCheckIpsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an UptimeCheckIp. */ - class UptimeCheckIp implements IUptimeCheckIp { + /** Represents a ListUptimeCheckIpsResponse. */ + class ListUptimeCheckIpsResponse implements IListUptimeCheckIpsResponse { /** - * Constructs a new UptimeCheckIp. + * Constructs a new ListUptimeCheckIpsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.monitoring.v3.IUptimeCheckIp); - - /** UptimeCheckIp region. */ - public region: (google.monitoring.v3.UptimeCheckRegion|keyof typeof google.monitoring.v3.UptimeCheckRegion); + constructor(properties?: google.monitoring.v3.IListUptimeCheckIpsResponse); - /** UptimeCheckIp location. */ - public location: string; + /** ListUptimeCheckIpsResponse uptimeCheckIps. */ + public uptimeCheckIps: google.monitoring.v3.IUptimeCheckIp[]; - /** UptimeCheckIp ipAddress. */ - public ipAddress: string; + /** ListUptimeCheckIpsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new UptimeCheckIp instance using the specified properties. + * Creates a new ListUptimeCheckIpsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UptimeCheckIp instance + * @returns ListUptimeCheckIpsResponse instance */ - public static create(properties?: google.monitoring.v3.IUptimeCheckIp): google.monitoring.v3.UptimeCheckIp; + public static create(properties?: google.monitoring.v3.IListUptimeCheckIpsResponse): google.monitoring.v3.ListUptimeCheckIpsResponse; /** - * Encodes the specified UptimeCheckIp message. Does not implicitly {@link google.monitoring.v3.UptimeCheckIp.verify|verify} messages. - * @param message UptimeCheckIp message or plain object to encode + * Encodes the specified ListUptimeCheckIpsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. + * @param message ListUptimeCheckIpsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.monitoring.v3.IUptimeCheckIp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.monitoring.v3.IListUptimeCheckIpsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UptimeCheckIp message, length delimited. Does not implicitly {@link google.monitoring.v3.UptimeCheckIp.verify|verify} messages. - * @param message UptimeCheckIp message or plain object to encode + * Encodes the specified ListUptimeCheckIpsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. + * @param message ListUptimeCheckIpsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.monitoring.v3.IUptimeCheckIp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.monitoring.v3.IListUptimeCheckIpsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UptimeCheckIp message from the specified reader or buffer. + * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UptimeCheckIp + * @returns ListUptimeCheckIpsResponse * @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.monitoring.v3.UptimeCheckIp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.monitoring.v3.ListUptimeCheckIpsResponse; /** - * Decodes an UptimeCheckIp message from the specified reader or buffer, length delimited. + * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UptimeCheckIp + * @returns ListUptimeCheckIpsResponse * @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.monitoring.v3.UptimeCheckIp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.monitoring.v3.ListUptimeCheckIpsResponse; /** - * Verifies an UptimeCheckIp message. + * Verifies a ListUptimeCheckIpsResponse 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 UptimeCheckIp message from a plain object. Also converts values to their respective internal types. + * Creates a ListUptimeCheckIpsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UptimeCheckIp + * @returns ListUptimeCheckIpsResponse */ - public static fromObject(object: { [k: string]: any }): google.monitoring.v3.UptimeCheckIp; + public static fromObject(object: { [k: string]: any }): google.monitoring.v3.ListUptimeCheckIpsResponse; /** - * Creates a plain object from an UptimeCheckIp message. Also converts values to other types if specified. - * @param message UptimeCheckIp + * Creates a plain object from a ListUptimeCheckIpsResponse message. Also converts values to other types if specified. + * @param message ListUptimeCheckIpsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.monitoring.v3.UptimeCheckIp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.monitoring.v3.ListUptimeCheckIpsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UptimeCheckIp to JSON. + * Converts this ListUptimeCheckIpsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - - /** GroupResourceType enum. */ - enum GroupResourceType { - RESOURCE_TYPE_UNSPECIFIED = 0, - INSTANCE = 1, - AWS_ELB_LOAD_BALANCER = 2 - } } } /** Namespace api. */ namespace api { - /** Properties of a Http. */ - interface IHttp { + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** ResourceDescriptor type */ + type?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new Http. + * Constructs a new ResourceDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); + constructor(properties?: google.api.IResourceDescriptor); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** ResourceDescriptor type. */ + public type: string; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; /** - * Creates a new Http instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Http + * @returns ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @returns ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** 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); + namespace ResourceDescriptor { - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } - /** HttpRule body */ - body?: (string|null); + /** Properties of a ResourceReference. */ + interface IResourceReference { - /** HttpRule responseBody */ - responseBody?: (string|null); + /** ResourceReference type */ + type?: (string|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** ResourceReference childType */ + childType?: (string|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { /** - * Constructs a new HttpRule. + * Constructs a new ResourceReference. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get: string; - - /** HttpRule put. */ - public put: string; - - /** HttpRule post. */ - public post: string; - - /** HttpRule delete. */ - public delete: string; - - /** HttpRule patch. */ - public patch: string; - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; + constructor(properties?: google.api.IResourceReference); - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** ResourceReference type. */ + public type: string; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns ResourceReference instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpRule + * @returns ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @returns ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Properties of a Distribution. */ + interface IDistribution { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Distribution count */ + count?: (number|Long|string|null); - /** CustomHttpPattern path */ - path?: (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 CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a Distribution. */ + class Distribution implements IDistribution { /** - * Constructs a new CustomHttpPattern. + * Constructs a new Distribution. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.api.IDistribution); - /** CustomHttpPattern kind. */ - public kind: string; + /** Distribution count. */ + public count: (number|Long|string); - /** CustomHttpPattern path. */ - public path: 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 CustomHttpPattern instance using the specified properties. + * Creates a new Distribution instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns Distribution instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IDistribution): google.api.Distribution; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IDistribution, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IDistribution, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * 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 CustomHttpPattern + * @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.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Distribution; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Distribution message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @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.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Distribution; /** - * Verifies a CustomHttpPattern message. + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Distribution message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns Distribution */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.Distribution; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * Creates a plain object from a 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.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Distribution, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Distribution to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5 - } + namespace Distribution { - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** Properties of a Range. */ + interface IRange { - /** ResourceDescriptor type */ - type?: (string|null); + /** Range min */ + min?: (number|null); - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** Range max */ + max?: (number|null); + } - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** Represents a Range. */ + class Range implements IRange { - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** + * Constructs a new Range. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.IRange); - /** ResourceDescriptor plural */ - plural?: (string|null); + /** Range min. */ + public min: number; - /** ResourceDescriptor singular */ - singular?: (string|null); - } + /** Range max. */ + public max: number; - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** + * 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; - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); + /** + * 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; - /** ResourceDescriptor type. */ - public type: string; + /** + * 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; - /** ResourceDescriptor pattern. */ - public pattern: string[]; + /** + * 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; - /** ResourceDescriptor nameField. */ - public nameField: string; + /** + * 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; - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + /** + * 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); - /** ResourceDescriptor plural. */ - public plural: string; + /** + * 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; - /** ResourceDescriptor singular. */ - public singular: string; + /** + * 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 }; - /** - * 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; + /** + * Converts this Range to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a BucketOptions. */ + interface IBucketOptions { - /** - * 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; + /** BucketOptions linearBuckets */ + linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); - /** - * 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; + /** BucketOptions exponentialBuckets */ + exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); - /** - * 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; + /** BucketOptions explicitBuckets */ + explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + } - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a BucketOptions. */ + class BucketOptions implements IBucketOptions { - /** - * 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; + /** + * Constructs a new BucketOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.IBucketOptions); - /** - * 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 }; + /** BucketOptions linearBuckets. */ + public linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BucketOptions exponentialBuckets. */ + public exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); - namespace ResourceDescriptor { + /** BucketOptions explicitBuckets. */ + public explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } + /** BucketOptions options. */ + public options?: ("linearBuckets"|"exponentialBuckets"|"explicitBuckets"); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** + * 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; - /** ResourceReference type */ - type?: (string|null); + /** + * 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; - /** ResourceReference childType */ - childType?: (string|null); - } + /** + * 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; - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** + * 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; - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); + /** + * 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; - /** ResourceReference type. */ - public type: string; + /** + * 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); - /** ResourceReference childType. */ - public childType: string; + /** + * 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 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; + /** + * 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 }; - /** - * 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; + /** + * Converts this BucketOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + namespace BucketOptions { - /** - * 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; + /** Properties of a Linear. */ + interface ILinear { - /** - * 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; + /** Linear numFiniteBuckets */ + numFiniteBuckets?: (number|null); - /** - * 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); + /** Linear width */ + width?: (number|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; + /** Linear offset */ + offset?: (number|null); + } - /** - * 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 }; + /** Represents a Linear. */ + class Linear implements ILinear { - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new Linear. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.BucketOptions.ILinear); - /** Properties of a Distribution. */ - interface IDistribution { + /** Linear numFiniteBuckets. */ + public numFiniteBuckets: number; - /** Distribution count */ - count?: (number|Long|string|null); + /** Linear width. */ + public width: number; - /** Distribution mean */ - mean?: (number|null); + /** Linear offset. */ + public offset: number; - /** Distribution sumOfSquaredDeviation */ - sumOfSquaredDeviation?: (number|null); + /** + * 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; - /** Distribution range */ - range?: (google.api.Distribution.IRange|null); + /** + * 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; - /** Distribution bucketOptions */ - bucketOptions?: (google.api.Distribution.IBucketOptions|null); + /** + * 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; - /** Distribution bucketCounts */ - bucketCounts?: ((number|Long|string)[]|null); + /** + * 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; - /** Distribution exemplars */ - exemplars?: (google.api.Distribution.IExemplar[]|null); - } + /** + * 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; - /** Represents a Distribution. */ - class Distribution implements IDistribution { + /** + * 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); - /** - * Constructs a new Distribution. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDistribution); + /** + * 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; - /** Distribution count. */ - public count: (number|Long|string); + /** + * 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 }; - /** Distribution mean. */ - public mean: number; + /** + * Converts this Linear to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Distribution sumOfSquaredDeviation. */ - public sumOfSquaredDeviation: number; + /** Properties of an Exponential. */ + interface IExponential { - /** Distribution range. */ - public range?: (google.api.Distribution.IRange|null); + /** Exponential numFiniteBuckets */ + numFiniteBuckets?: (number|null); - /** Distribution bucketOptions. */ - public bucketOptions?: (google.api.Distribution.IBucketOptions|null); + /** Exponential growthFactor */ + growthFactor?: (number|null); - /** Distribution bucketCounts. */ - public bucketCounts: (number|Long|string)[]; + /** Exponential scale */ + scale?: (number|null); + } - /** Distribution exemplars. */ - public exemplars: google.api.Distribution.IExemplar[]; + /** Represents an Exponential. */ + class Exponential implements IExponential { - /** - * 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; + /** + * Constructs a new Exponential. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.BucketOptions.IExponential); - /** - * 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; + /** Exponential numFiniteBuckets. */ + public numFiniteBuckets: number; - /** - * 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; + /** Exponential growthFactor. */ + public growthFactor: number; - /** - * 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; + /** Exponential scale. */ + public scale: number; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this Distribution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - namespace Distribution { + /** + * 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); - /** Properties of a Range. */ - interface IRange { + /** + * 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; - /** Range min */ - min?: (number|null); + /** + * 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 }; - /** Range max */ - max?: (number|null); - } + /** + * Converts this Exponential to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a Range. */ - class Range implements IRange { + /** Properties of an Explicit. */ + interface IExplicit { - /** - * Constructs a new Range. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.IRange); + /** Explicit bounds */ + bounds?: (number[]|null); + } - /** Range min. */ - public min: number; + /** Represents an Explicit. */ + class Explicit implements IExplicit { - /** Range max. */ - public max: number; + /** + * Constructs a new Explicit. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.Distribution.BucketOptions.IExplicit); - /** - * 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; + /** Explicit bounds. */ + public bounds: number[]; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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 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 }; + /** + * 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; - /** - * Converts this Range to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 }; + } } - /** Properties of a BucketOptions. */ - interface IBucketOptions { + /** Properties of an Exemplar. */ + interface IExemplar { - /** BucketOptions linearBuckets */ - linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); + /** Exemplar value */ + value?: (number|null); - /** BucketOptions exponentialBuckets */ - exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); + /** Exemplar timestamp */ + timestamp?: (google.protobuf.ITimestamp|null); - /** BucketOptions explicitBuckets */ - explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + /** Exemplar attachments */ + attachments?: (google.protobuf.IAny[]|null); } - /** Represents a BucketOptions. */ - class BucketOptions implements IBucketOptions { + /** Represents an Exemplar. */ + class Exemplar implements IExemplar { /** - * Constructs a new BucketOptions. + * Constructs a new Exemplar. * @param [properties] Properties to set */ - constructor(properties?: google.api.Distribution.IBucketOptions); - - /** BucketOptions linearBuckets. */ - public linearBuckets?: (google.api.Distribution.BucketOptions.ILinear|null); + constructor(properties?: google.api.Distribution.IExemplar); - /** BucketOptions exponentialBuckets. */ - public exponentialBuckets?: (google.api.Distribution.BucketOptions.IExponential|null); + /** Exemplar value. */ + public value: number; - /** BucketOptions explicitBuckets. */ - public explicitBuckets?: (google.api.Distribution.BucketOptions.IExplicit|null); + /** Exemplar timestamp. */ + public timestamp?: (google.protobuf.ITimestamp|null); - /** BucketOptions options. */ - public options?: ("linearBuckets"|"exponentialBuckets"|"explicitBuckets"); + /** Exemplar attachments. */ + public attachments: google.protobuf.IAny[]; /** - * Creates a new BucketOptions instance using the specified properties. + * Creates a new Exemplar instance using the specified properties. * @param [properties] Properties to set - * @returns BucketOptions instance + * @returns Exemplar instance */ - public static create(properties?: google.api.Distribution.IBucketOptions): google.api.Distribution.BucketOptions; + public static create(properties?: google.api.Distribution.IExemplar): google.api.Distribution.Exemplar; /** - * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. - * @param message BucketOptions message or plain object to encode + * Encodes the specified 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.IBucketOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. - * @param message BucketOptions message or plain object to encode + * Encodes the specified 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.IBucketOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BucketOptions message from the specified reader or buffer. + * 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 BucketOptions + * @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.BucketOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Distribution.Exemplar; /** - * Decodes a BucketOptions message from the specified reader or buffer, length delimited. + * Decodes an Exemplar message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BucketOptions + * @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.BucketOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Distribution.Exemplar; /** - * Verifies a BucketOptions message. + * 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 a BucketOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BucketOptions + * @returns Exemplar */ - public static fromObject(object: { [k: string]: any }): google.api.Distribution.BucketOptions; + public static fromObject(object: { [k: string]: any }): google.api.Distribution.Exemplar; /** - * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. - * @param message BucketOptions + * 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.BucketOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Distribution.Exemplar, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BucketOptions to JSON. + * Converts this Exemplar to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - namespace BucketOptions { - - /** Properties of a Linear. */ - interface ILinear { - - /** Linear numFiniteBuckets */ - numFiniteBuckets?: (number|null); - - /** Linear width */ - width?: (number|null); - - /** Linear offset */ - offset?: (number|null); - } - - /** Represents a Linear. */ - class Linear implements ILinear { - - /** - * Constructs a new Linear. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.BucketOptions.ILinear); + /** Properties of a Http. */ + interface IHttp { - /** Linear numFiniteBuckets. */ - public numFiniteBuckets: number; + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** Linear width. */ - public width: number; + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } - /** Linear offset. */ - public offset: number; + /** Represents a Http. */ + class Http implements IHttp { - /** - * 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; + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); - /** - * 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; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** - * 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; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this Linear to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of an Exponential. */ - interface IExponential { + /** + * 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; - /** Exponential numFiniteBuckets */ - numFiniteBuckets?: (number|null); + /** + * 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 }; - /** Exponential growthFactor */ - growthFactor?: (number|null); + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Exponential scale */ - scale?: (number|null); - } + /** Properties of a HttpRule. */ + interface IHttpRule { - /** Represents an Exponential. */ - class Exponential implements IExponential { + /** HttpRule selector */ + selector?: (string|null); - /** - * Constructs a new Exponential. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.BucketOptions.IExponential); + /** HttpRule get */ + get?: (string|null); - /** Exponential numFiniteBuckets. */ - public numFiniteBuckets: number; + /** HttpRule put */ + put?: (string|null); - /** Exponential growthFactor. */ - public growthFactor: number; + /** HttpRule post */ + post?: (string|null); - /** Exponential scale. */ - public scale: number; + /** HttpRule delete */ + "delete"?: (string|null); - /** - * 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; + /** HttpRule patch */ + patch?: (string|null); - /** - * 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; + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); - /** - * 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; + /** HttpRule body */ + body?: (string|null); - /** - * Decodes an Exponential message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Exponential - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Distribution.BucketOptions.Exponential; + /** HttpRule responseBody */ + responseBody?: (string|null); - /** - * 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; + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } - /** - * 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); + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { - /** - * 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; + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); - /** - * 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 }; + /** HttpRule selector. */ + public selector: string; - /** - * Converts this Exponential to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** HttpRule get. */ + public get: string; - /** Properties of an Explicit. */ - interface IExplicit { + /** HttpRule put. */ + public put: string; - /** Explicit bounds */ - bounds?: (number[]|null); - } + /** HttpRule post. */ + public post: string; - /** Represents an Explicit. */ - class Explicit implements IExplicit { + /** HttpRule delete. */ + public delete: string; - /** - * Constructs a new Explicit. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.BucketOptions.IExplicit); + /** HttpRule patch. */ + public patch: string; - /** Explicit bounds. */ - public bounds: number[]; + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); - /** - * 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; + /** HttpRule body. */ + public body: string; - /** - * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @param message Explicit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.BucketOptions.IExplicit, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule responseBody. */ + public responseBody: string; - /** - * 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; + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; - /** - * 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; + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a 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 }; + /** + * 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; - /** - * Converts this Explicit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - /** Properties of an Exemplar. */ - interface IExemplar { + /** + * 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); - /** Exemplar value */ - value?: (number|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; - /** Exemplar timestamp */ - timestamp?: (google.protobuf.ITimestamp|null); + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Exemplar attachments */ - attachments?: (google.protobuf.IAny[]|null); - } + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an Exemplar. */ - class Exemplar implements IExemplar { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** - * Constructs a new Exemplar. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.Distribution.IExemplar); + /** CustomHttpPattern kind */ + kind?: (string|null); - /** Exemplar value. */ - public value: number; + /** CustomHttpPattern path */ + path?: (string|null); + } - /** Exemplar timestamp. */ - public timestamp?: (google.protobuf.ITimestamp|null); + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { - /** Exemplar attachments. */ - public attachments: google.protobuf.IAny[]; + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); - /** - * 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; + /** CustomHttpPattern kind. */ + public kind: string; - /** - * Encodes the specified Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @param message Exemplar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; + /** CustomHttpPattern path. */ + public path: string; - /** - * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @param message Exemplar message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.Distribution.IExemplar, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - /** - * Decodes an Exemplar message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Distribution.Exemplar; + /** + * Encodes the specified 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 an Exemplar message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Distribution.Exemplar; + /** + * Decodes a 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 an Exemplar message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a 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 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 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 an Exemplar message. Also converts values to other types if specified. - * @param message Exemplar - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Distribution.Exemplar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a 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 Exemplar to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 } /** Properties of a MonitoredResourceDescriptor. */ @@ -15639,11 +15825,11 @@ export namespace google { /** 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); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); } /** Represents a FieldOptions. */ @@ -17885,293 +18071,119 @@ export namespace google { public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; /** - * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @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.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @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.BytesValue; - - /** - * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** 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. + * Verifies a StringValue 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. + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns StringValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this StringValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FieldMask. */ - interface IFieldMask { + /** Properties of a BytesValue. */ + interface IBytesValue { - /** FieldMask paths */ - paths?: (string[]|null); + /** BytesValue value */ + value?: (Uint8Array|string|null); } - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { /** - * Constructs a new FieldMask. + * Constructs a new BytesValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFieldMask); + constructor(properties?: google.protobuf.IBytesValue); - /** FieldMask paths. */ - public paths: string[]; + /** BytesValue value. */ + public value: (Uint8Array|string); /** - * Creates a new FieldMask instance using the specified properties. + * Creates a new BytesValue instance using the specified properties. * @param [properties] Properties to set - * @returns FieldMask instance + * @returns BytesValue instance */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue 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; + public static encode(message: google.protobuf.IBytesValue, 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 + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue 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; + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldMask message from the specified reader or buffer. + * Decodes a BytesValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldMask + * @returns BytesValue * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * Decodes a BytesValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldMask + * @returns BytesValue * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; /** - * Verifies a FieldMask message. + * Verifies a BytesValue 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. + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldMask + * @returns BytesValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldMask to JSON. + * Converts this BytesValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -18484,6 +18496,180 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** 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 }; + } + + /** 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 }; + } } /** Namespace rpc. */ diff --git a/protos/protos.js b/protos/protos.js index dd1631e7..315b349c 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -57,314 +57,255 @@ */ var v3 = {}; - v3.AlertPolicyService = (function() { + v3.AlertPolicy = (function() { /** - * Constructs a new AlertPolicyService service. + * Properties of an AlertPolicy. * @memberof google.monitoring.v3 - * @classdesc Represents an AlertPolicyService - * @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 AlertPolicyService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AlertPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlertPolicyService; - - /** - * Creates new AlertPolicyService service using the specified rpc implementation. - * @function create - * @memberof google.monitoring.v3.AlertPolicyService - * @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 {AlertPolicyService} RPC service. Useful where requests and/or responses are streamed. - */ - AlertPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#listAlertPolicies}. - * @memberof google.monitoring.v3.AlertPolicyService - * @typedef ListAlertPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListAlertPoliciesResponse} [response] ListAlertPoliciesResponse + * @interface IAlertPolicy + * @property {string|null} [name] AlertPolicy name + * @property {string|null} [displayName] AlertPolicy displayName + * @property {google.monitoring.v3.AlertPolicy.IDocumentation|null} [documentation] AlertPolicy documentation + * @property {Object.|null} [userLabels] AlertPolicy userLabels + * @property {Array.|null} [conditions] AlertPolicy conditions + * @property {google.monitoring.v3.AlertPolicy.ConditionCombinerType|null} [combiner] AlertPolicy combiner + * @property {google.protobuf.IBoolValue|null} [enabled] AlertPolicy enabled + * @property {google.rpc.IStatus|null} [validity] AlertPolicy validity + * @property {Array.|null} [notificationChannels] AlertPolicy notificationChannels + * @property {google.monitoring.v3.IMutationRecord|null} [creationRecord] AlertPolicy creationRecord + * @property {google.monitoring.v3.IMutationRecord|null} [mutationRecord] AlertPolicy mutationRecord */ /** - * Calls ListAlertPolicies. - * @function listAlertPolicies - * @memberof google.monitoring.v3.AlertPolicyService - * @instance - * @param {google.monitoring.v3.IListAlertPoliciesRequest} request ListAlertPoliciesRequest message or plain object - * @param {google.monitoring.v3.AlertPolicyService.ListAlertPoliciesCallback} callback Node-style callback called with the error, if any, and ListAlertPoliciesResponse - * @returns {undefined} - * @variation 1 + * Constructs a new AlertPolicy. + * @memberof google.monitoring.v3 + * @classdesc Represents an AlertPolicy. + * @implements IAlertPolicy + * @constructor + * @param {google.monitoring.v3.IAlertPolicy=} [properties] Properties to set */ - Object.defineProperty(AlertPolicyService.prototype.listAlertPolicies = function listAlertPolicies(request, callback) { - return this.rpcCall(listAlertPolicies, $root.google.monitoring.v3.ListAlertPoliciesRequest, $root.google.monitoring.v3.ListAlertPoliciesResponse, request, callback); - }, "name", { value: "ListAlertPolicies" }); + function AlertPolicy(properties) { + this.userLabels = {}; + this.conditions = []; + this.notificationChannels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListAlertPolicies. - * @function listAlertPolicies - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy name. + * @member {string} name + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IListAlertPoliciesRequest} request ListAlertPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#getAlertPolicy}. - * @memberof google.monitoring.v3.AlertPolicyService - * @typedef GetAlertPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.AlertPolicy} [response] AlertPolicy */ + AlertPolicy.prototype.name = ""; /** - * Calls GetAlertPolicy. - * @function getAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IGetAlertPolicyRequest} request GetAlertPolicyRequest message or plain object - * @param {google.monitoring.v3.AlertPolicyService.GetAlertPolicyCallback} callback Node-style callback called with the error, if any, and AlertPolicy - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlertPolicyService.prototype.getAlertPolicy = function getAlertPolicy(request, callback) { - return this.rpcCall(getAlertPolicy, $root.google.monitoring.v3.GetAlertPolicyRequest, $root.google.monitoring.v3.AlertPolicy, request, callback); - }, "name", { value: "GetAlertPolicy" }); + AlertPolicy.prototype.displayName = ""; /** - * Calls GetAlertPolicy. - * @function getAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy documentation. + * @member {google.monitoring.v3.AlertPolicy.IDocumentation|null|undefined} documentation + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IGetAlertPolicyRequest} request GetAlertPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#createAlertPolicy}. - * @memberof google.monitoring.v3.AlertPolicyService - * @typedef CreateAlertPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.AlertPolicy} [response] AlertPolicy */ + AlertPolicy.prototype.documentation = null; /** - * Calls CreateAlertPolicy. - * @function createAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy userLabels. + * @member {Object.} userLabels + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.ICreateAlertPolicyRequest} request CreateAlertPolicyRequest message or plain object - * @param {google.monitoring.v3.AlertPolicyService.CreateAlertPolicyCallback} callback Node-style callback called with the error, if any, and AlertPolicy - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlertPolicyService.prototype.createAlertPolicy = function createAlertPolicy(request, callback) { - return this.rpcCall(createAlertPolicy, $root.google.monitoring.v3.CreateAlertPolicyRequest, $root.google.monitoring.v3.AlertPolicy, request, callback); - }, "name", { value: "CreateAlertPolicy" }); + AlertPolicy.prototype.userLabels = $util.emptyObject; /** - * Calls CreateAlertPolicy. - * @function createAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy conditions. + * @member {Array.} conditions + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.ICreateAlertPolicyRequest} request CreateAlertPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#deleteAlertPolicy}. - * @memberof google.monitoring.v3.AlertPolicyService - * @typedef DeleteAlertPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty */ + AlertPolicy.prototype.conditions = $util.emptyArray; /** - * Calls DeleteAlertPolicy. - * @function deleteAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy combiner. + * @member {google.monitoring.v3.AlertPolicy.ConditionCombinerType} combiner + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} request DeleteAlertPolicyRequest message or plain object - * @param {google.monitoring.v3.AlertPolicyService.DeleteAlertPolicyCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlertPolicyService.prototype.deleteAlertPolicy = function deleteAlertPolicy(request, callback) { - return this.rpcCall(deleteAlertPolicy, $root.google.monitoring.v3.DeleteAlertPolicyRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAlertPolicy" }); + AlertPolicy.prototype.combiner = 0; /** - * Calls DeleteAlertPolicy. - * @function deleteAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy enabled. + * @member {google.protobuf.IBoolValue|null|undefined} enabled + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} request DeleteAlertPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.AlertPolicyService#updateAlertPolicy}. - * @memberof google.monitoring.v3.AlertPolicyService - * @typedef UpdateAlertPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.AlertPolicy} [response] AlertPolicy */ + AlertPolicy.prototype.enabled = null; /** - * Calls UpdateAlertPolicy. - * @function updateAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy validity. + * @member {google.rpc.IStatus|null|undefined} validity + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} request UpdateAlertPolicyRequest message or plain object - * @param {google.monitoring.v3.AlertPolicyService.UpdateAlertPolicyCallback} callback Node-style callback called with the error, if any, and AlertPolicy - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AlertPolicyService.prototype.updateAlertPolicy = function updateAlertPolicy(request, callback) { - return this.rpcCall(updateAlertPolicy, $root.google.monitoring.v3.UpdateAlertPolicyRequest, $root.google.monitoring.v3.AlertPolicy, request, callback); - }, "name", { value: "UpdateAlertPolicy" }); + AlertPolicy.prototype.validity = null; /** - * Calls UpdateAlertPolicy. - * @function updateAlertPolicy - * @memberof google.monitoring.v3.AlertPolicyService + * AlertPolicy notificationChannels. + * @member {Array.} notificationChannels + * @memberof google.monitoring.v3.AlertPolicy * @instance - * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} request UpdateAlertPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AlertPolicyService; - })(); - - v3.CreateAlertPolicyRequest = (function() { - - /** - * Properties of a CreateAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @interface ICreateAlertPolicyRequest - * @property {string|null} [name] CreateAlertPolicyRequest name - * @property {google.monitoring.v3.IAlertPolicy|null} [alertPolicy] CreateAlertPolicyRequest alertPolicy - */ - - /** - * Constructs a new CreateAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a CreateAlertPolicyRequest. - * @implements ICreateAlertPolicyRequest - * @constructor - * @param {google.monitoring.v3.ICreateAlertPolicyRequest=} [properties] Properties to set */ - function CreateAlertPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + AlertPolicy.prototype.notificationChannels = $util.emptyArray; /** - * CreateAlertPolicyRequest name. - * @member {string} name - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * AlertPolicy creationRecord. + * @member {google.monitoring.v3.IMutationRecord|null|undefined} creationRecord + * @memberof google.monitoring.v3.AlertPolicy * @instance */ - CreateAlertPolicyRequest.prototype.name = ""; + AlertPolicy.prototype.creationRecord = null; /** - * CreateAlertPolicyRequest alertPolicy. - * @member {google.monitoring.v3.IAlertPolicy|null|undefined} alertPolicy - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * AlertPolicy mutationRecord. + * @member {google.monitoring.v3.IMutationRecord|null|undefined} mutationRecord + * @memberof google.monitoring.v3.AlertPolicy * @instance */ - CreateAlertPolicyRequest.prototype.alertPolicy = null; + AlertPolicy.prototype.mutationRecord = null; /** - * Creates a new CreateAlertPolicyRequest instance using the specified properties. + * Creates a new AlertPolicy instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static - * @param {google.monitoring.v3.ICreateAlertPolicyRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest instance + * @param {google.monitoring.v3.IAlertPolicy=} [properties] Properties to set + * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy instance */ - CreateAlertPolicyRequest.create = function create(properties) { - return new CreateAlertPolicyRequest(properties); + AlertPolicy.create = function create(properties) { + return new AlertPolicy(properties); }; /** - * Encodes the specified CreateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. + * Encodes the specified AlertPolicy message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static - * @param {google.monitoring.v3.ICreateAlertPolicyRequest} message CreateAlertPolicyRequest message or plain object to encode + * @param {google.monitoring.v3.IAlertPolicy} message AlertPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateAlertPolicyRequest.encode = function encode(message, writer) { + AlertPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) - $root.google.monitoring.v3.AlertPolicy.encode(message.alertPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.combiner != null && message.hasOwnProperty("combiner")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.combiner); + if (message.creationRecord != null && message.hasOwnProperty("creationRecord")) + $root.google.monitoring.v3.MutationRecord.encode(message.creationRecord, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.mutationRecord != null && message.hasOwnProperty("mutationRecord")) + $root.google.monitoring.v3.MutationRecord.encode(message.mutationRecord, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.monitoring.v3.AlertPolicy.Condition.encode(message.conditions[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.documentation != null && message.hasOwnProperty("documentation")) + $root.google.monitoring.v3.AlertPolicy.Documentation.encode(message.documentation, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.notificationChannels != null && message.notificationChannels.length) + for (var i = 0; i < message.notificationChannels.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.notificationChannels[i]); + if (message.userLabels != null && message.hasOwnProperty("userLabels")) + for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); + if (message.enabled != null && message.hasOwnProperty("enabled")) + $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.validity != null && message.hasOwnProperty("validity")) + $root.google.rpc.Status.encode(message.validity, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. + * Encodes the specified AlertPolicy message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static - * @param {google.monitoring.v3.ICreateAlertPolicyRequest} message CreateAlertPolicyRequest message or plain object to encode + * @param {google.monitoring.v3.IAlertPolicy} message AlertPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + AlertPolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer. + * Decodes an AlertPolicy message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest + * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateAlertPolicyRequest.decode = function decode(reader, length) { + AlertPolicy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateAlertPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: + case 1: message.name = reader.string(); break; case 2: - message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.decode(reader, reader.uint32()); + message.displayName = reader.string(); + break; + case 13: + message.documentation = $root.google.monitoring.v3.AlertPolicy.Documentation.decode(reader, reader.uint32()); + break; + case 16: + reader.skip().pos++; + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + key = reader.string(); + reader.pos++; + message.userLabels[key] = reader.string(); + break; + case 12: + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.monitoring.v3.AlertPolicy.Condition.decode(reader, reader.uint32())); + break; + case 6: + message.combiner = reader.int32(); + break; + case 17: + message.enabled = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + case 18: + message.validity = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 14: + if (!(message.notificationChannels && message.notificationChannels.length)) + message.notificationChannels = []; + message.notificationChannels.push(reader.string()); + break; + case 10: + message.creationRecord = $root.google.monitoring.v3.MutationRecord.decode(reader, reader.uint32()); + break; + case 11: + message.mutationRecord = $root.google.monitoring.v3.MutationRecord.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -375,3357 +316,3586 @@ }; /** - * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an AlertPolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest + * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + AlertPolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateAlertPolicyRequest message. + * Verifies an AlertPolicy message. * @function verify - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateAlertPolicyRequest.verify = function verify(message) { + AlertPolicy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) { - var error = $root.google.monitoring.v3.AlertPolicy.verify(message.alertPolicy); + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.documentation != null && message.hasOwnProperty("documentation")) { + var error = $root.google.monitoring.v3.AlertPolicy.Documentation.verify(message.documentation); if (error) - return "alertPolicy." + error; + return "documentation." + error; + } + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.monitoring.v3.AlertPolicy.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.combiner != null && message.hasOwnProperty("combiner")) + switch (message.combiner) { + default: + return "combiner: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + var error = $root.google.protobuf.BoolValue.verify(message.enabled); + if (error) + return "enabled." + error; + } + if (message.validity != null && message.hasOwnProperty("validity")) { + var error = $root.google.rpc.Status.verify(message.validity); + if (error) + return "validity." + error; + } + if (message.notificationChannels != null && message.hasOwnProperty("notificationChannels")) { + if (!Array.isArray(message.notificationChannels)) + return "notificationChannels: array expected"; + for (var i = 0; i < message.notificationChannels.length; ++i) + if (!$util.isString(message.notificationChannels[i])) + return "notificationChannels: string[] expected"; + } + if (message.creationRecord != null && message.hasOwnProperty("creationRecord")) { + var error = $root.google.monitoring.v3.MutationRecord.verify(message.creationRecord); + if (error) + return "creationRecord." + error; + } + if (message.mutationRecord != null && message.hasOwnProperty("mutationRecord")) { + var error = $root.google.monitoring.v3.MutationRecord.verify(message.mutationRecord); + if (error) + return "mutationRecord." + error; } return null; }; /** - * Creates a CreateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AlertPolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest + * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy */ - CreateAlertPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateAlertPolicyRequest) + AlertPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.AlertPolicy) return object; - var message = new $root.google.monitoring.v3.CreateAlertPolicyRequest(); + var message = new $root.google.monitoring.v3.AlertPolicy(); if (object.name != null) message.name = String(object.name); - if (object.alertPolicy != null) { - if (typeof object.alertPolicy !== "object") - throw TypeError(".google.monitoring.v3.CreateAlertPolicyRequest.alertPolicy: object expected"); - message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.fromObject(object.alertPolicy); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.documentation != null) { + if (typeof object.documentation !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.documentation: object expected"); + message.documentation = $root.google.monitoring.v3.AlertPolicy.Documentation.fromObject(object.documentation); } - return message; - }; - - /** - * Creates a plain object from a CreateAlertPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.CreateAlertPolicyRequest - * @static - * @param {google.monitoring.v3.CreateAlertPolicyRequest} message CreateAlertPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAlertPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.alertPolicy = null; - object.name = ""; + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); } - if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) - object.alertPolicy = $root.google.monitoring.v3.AlertPolicy.toObject(message.alertPolicy, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CreateAlertPolicyRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.CreateAlertPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAlertPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CreateAlertPolicyRequest; - })(); - - v3.GetAlertPolicyRequest = (function() { - - /** - * Properties of a GetAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @interface IGetAlertPolicyRequest - * @property {string|null} [name] GetAlertPolicyRequest name - */ - - /** - * Constructs a new GetAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a GetAlertPolicyRequest. - * @implements IGetAlertPolicyRequest - * @constructor - * @param {google.monitoring.v3.IGetAlertPolicyRequest=} [properties] Properties to set - */ - function GetAlertPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAlertPolicyRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @instance - */ - GetAlertPolicyRequest.prototype.name = ""; - - /** - * Creates a new GetAlertPolicyRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IGetAlertPolicyRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest instance - */ - GetAlertPolicyRequest.create = function create(properties) { - return new GetAlertPolicyRequest(properties); - }; - - /** - * Encodes the specified GetAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IGetAlertPolicyRequest} message GetAlertPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAlertPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IGetAlertPolicyRequest} message GetAlertPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAlertPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAlertPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetAlertPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.monitoring.v3.AlertPolicy.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.conditions: object expected"); + message.conditions[i] = $root.google.monitoring.v3.AlertPolicy.Condition.fromObject(object.conditions[i]); } } + switch (object.combiner) { + case "COMBINE_UNSPECIFIED": + case 0: + message.combiner = 0; + break; + case "AND": + case 1: + message.combiner = 1; + break; + case "OR": + case 2: + message.combiner = 2; + break; + case "AND_WITH_MATCHING_RESOURCE": + case 3: + message.combiner = 3; + break; + } + if (object.enabled != null) { + if (typeof object.enabled !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.enabled: object expected"); + message.enabled = $root.google.protobuf.BoolValue.fromObject(object.enabled); + } + if (object.validity != null) { + if (typeof object.validity !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.validity: object expected"); + message.validity = $root.google.rpc.Status.fromObject(object.validity); + } + if (object.notificationChannels) { + if (!Array.isArray(object.notificationChannels)) + throw TypeError(".google.monitoring.v3.AlertPolicy.notificationChannels: array expected"); + message.notificationChannels = []; + for (var i = 0; i < object.notificationChannels.length; ++i) + message.notificationChannels[i] = String(object.notificationChannels[i]); + } + if (object.creationRecord != null) { + if (typeof object.creationRecord !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.creationRecord: object expected"); + message.creationRecord = $root.google.monitoring.v3.MutationRecord.fromObject(object.creationRecord); + } + if (object.mutationRecord != null) { + if (typeof object.mutationRecord !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.mutationRecord: object expected"); + message.mutationRecord = $root.google.monitoring.v3.MutationRecord.fromObject(object.mutationRecord); + } return message; }; /** - * Decodes a GetAlertPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAlertPolicyRequest message. - * @function verify - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAlertPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.GetAlertPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest - */ - GetAlertPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetAlertPolicyRequest) - return object; - var message = new $root.google.monitoring.v3.GetAlertPolicyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAlertPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from an AlertPolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @static - * @param {google.monitoring.v3.GetAlertPolicyRequest} message GetAlertPolicyRequest + * @param {google.monitoring.v3.AlertPolicy} message AlertPolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetAlertPolicyRequest.toObject = function toObject(message, options) { + AlertPolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.arrays || options.defaults) { + object.conditions = []; + object.notificationChannels = []; + } + if (options.objects || options.defaults) + object.userLabels = {}; + if (options.defaults) { object.name = ""; + object.displayName = ""; + object.combiner = options.enums === String ? "COMBINE_UNSPECIFIED" : 0; + object.creationRecord = null; + object.mutationRecord = null; + object.documentation = null; + object.enabled = null; + object.validity = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.combiner != null && message.hasOwnProperty("combiner")) + object.combiner = options.enums === String ? $root.google.monitoring.v3.AlertPolicy.ConditionCombinerType[message.combiner] : message.combiner; + if (message.creationRecord != null && message.hasOwnProperty("creationRecord")) + object.creationRecord = $root.google.monitoring.v3.MutationRecord.toObject(message.creationRecord, options); + if (message.mutationRecord != null && message.hasOwnProperty("mutationRecord")) + object.mutationRecord = $root.google.monitoring.v3.MutationRecord.toObject(message.mutationRecord, options); + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.monitoring.v3.AlertPolicy.Condition.toObject(message.conditions[j], options); + } + if (message.documentation != null && message.hasOwnProperty("documentation")) + object.documentation = $root.google.monitoring.v3.AlertPolicy.Documentation.toObject(message.documentation, options); + if (message.notificationChannels && message.notificationChannels.length) { + object.notificationChannels = []; + for (var j = 0; j < message.notificationChannels.length; ++j) + object.notificationChannels[j] = message.notificationChannels[j]; + } + var keys2; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options); + if (message.validity != null && message.hasOwnProperty("validity")) + object.validity = $root.google.rpc.Status.toObject(message.validity, options); return object; }; /** - * Converts this GetAlertPolicyRequest to JSON. + * Converts this AlertPolicy to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetAlertPolicyRequest + * @memberof google.monitoring.v3.AlertPolicy * @instance * @returns {Object.} JSON object */ - GetAlertPolicyRequest.prototype.toJSON = function toJSON() { + AlertPolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetAlertPolicyRequest; - })(); + AlertPolicy.Documentation = (function() { - v3.ListAlertPoliciesRequest = (function() { + /** + * Properties of a Documentation. + * @memberof google.monitoring.v3.AlertPolicy + * @interface IDocumentation + * @property {string|null} [content] Documentation content + * @property {string|null} [mimeType] Documentation mimeType + */ - /** - * Properties of a ListAlertPoliciesRequest. - * @memberof google.monitoring.v3 - * @interface IListAlertPoliciesRequest - * @property {string|null} [name] ListAlertPoliciesRequest name - * @property {string|null} [filter] ListAlertPoliciesRequest filter - * @property {string|null} [orderBy] ListAlertPoliciesRequest orderBy - * @property {number|null} [pageSize] ListAlertPoliciesRequest pageSize - * @property {string|null} [pageToken] ListAlertPoliciesRequest pageToken - */ + /** + * Constructs a new Documentation. + * @memberof google.monitoring.v3.AlertPolicy + * @classdesc Represents a Documentation. + * @implements IDocumentation + * @constructor + * @param {google.monitoring.v3.AlertPolicy.IDocumentation=} [properties] Properties to set + */ + function Documentation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ListAlertPoliciesRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListAlertPoliciesRequest. - * @implements IListAlertPoliciesRequest - * @constructor - * @param {google.monitoring.v3.IListAlertPoliciesRequest=} [properties] Properties to set - */ - function ListAlertPoliciesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Documentation content. + * @member {string} content + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @instance + */ + Documentation.prototype.content = ""; - /** - * ListAlertPoliciesRequest name. - * @member {string} name - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @instance - */ - ListAlertPoliciesRequest.prototype.name = ""; + /** + * Documentation mimeType. + * @member {string} mimeType + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @instance + */ + Documentation.prototype.mimeType = ""; - /** - * ListAlertPoliciesRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @instance - */ - ListAlertPoliciesRequest.prototype.filter = ""; + /** + * Creates a new Documentation instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {google.monitoring.v3.AlertPolicy.IDocumentation=} [properties] Properties to set + * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation instance + */ + Documentation.create = function create(properties) { + return new Documentation(properties); + }; - /** - * ListAlertPoliciesRequest orderBy. - * @member {string} orderBy - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @instance - */ - ListAlertPoliciesRequest.prototype.orderBy = ""; + /** + * Encodes the specified Documentation message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {google.monitoring.v3.AlertPolicy.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; - /** - * ListAlertPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @instance - */ - ListAlertPoliciesRequest.prototype.pageSize = 0; + /** + * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {google.monitoring.v3.AlertPolicy.IDocumentation} message Documentation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documentation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ListAlertPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @instance - */ - ListAlertPoliciesRequest.prototype.pageToken = ""; + /** + * Decodes a Documentation message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Documentation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.string(); + break; + case 2: + message.mimeType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new ListAlertPoliciesRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {google.monitoring.v3.IListAlertPoliciesRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest instance - */ - ListAlertPoliciesRequest.create = function create(properties) { - return new ListAlertPoliciesRequest(properties); - }; + /** + * Decodes a Documentation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documentation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListAlertPoliciesRequest message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {google.monitoring.v3.IListAlertPoliciesRequest} message ListAlertPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAlertPoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - return writer; - }; + /** + * Verifies a Documentation message. + * @function verify + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documentation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; - /** - * Encodes the specified ListAlertPoliciesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {google.monitoring.v3.IListAlertPoliciesRequest} message ListAlertPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAlertPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a Documentation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation + */ + Documentation.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.AlertPolicy.Documentation) + return object; + var message = new $root.google.monitoring.v3.AlertPolicy.Documentation(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; - /** - * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAlertPoliciesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListAlertPoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; - case 5: - message.filter = reader.string(); - break; - case 6: - message.orderBy = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a Documentation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @static + * @param {google.monitoring.v3.AlertPolicy.Documentation} message Documentation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documentation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; } - } - return message; - }; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; - /** - * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAlertPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this Documentation to JSON. + * @function toJSON + * @memberof google.monitoring.v3.AlertPolicy.Documentation + * @instance + * @returns {Object.} JSON object + */ + Documentation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a ListAlertPoliciesRequest message. - * @function verify - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAlertPoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; + return Documentation; + })(); - /** - * Creates a ListAlertPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest - */ - ListAlertPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListAlertPoliciesRequest) - return object; - var message = new $root.google.monitoring.v3.ListAlertPoliciesRequest(); - if (object.name != null) - message.name = String(object.name); - 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; - }; + AlertPolicy.Condition = (function() { - /** - * Creates a plain object from a ListAlertPoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @static - * @param {google.monitoring.v3.ListAlertPoliciesRequest} message ListAlertPoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAlertPoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; + /** + * Properties of a Condition. + * @memberof google.monitoring.v3.AlertPolicy + * @interface ICondition + * @property {string|null} [name] Condition name + * @property {string|null} [displayName] Condition displayName + * @property {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null} [conditionThreshold] Condition conditionThreshold + * @property {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null} [conditionAbsent] Condition conditionAbsent + */ - /** - * Converts this ListAlertPoliciesRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.ListAlertPoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - ListAlertPoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new Condition. + * @memberof google.monitoring.v3.AlertPolicy + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.monitoring.v3.AlertPolicy.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return ListAlertPoliciesRequest; - })(); + /** + * Condition name. + * @member {string} name + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @instance + */ + Condition.prototype.name = ""; - v3.ListAlertPoliciesResponse = (function() { + /** + * Condition displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @instance + */ + Condition.prototype.displayName = ""; - /** - * Properties of a ListAlertPoliciesResponse. - * @memberof google.monitoring.v3 - * @interface IListAlertPoliciesResponse - * @property {Array.|null} [alertPolicies] ListAlertPoliciesResponse alertPolicies - * @property {string|null} [nextPageToken] ListAlertPoliciesResponse nextPageToken - */ + /** + * Condition conditionThreshold. + * @member {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null|undefined} conditionThreshold + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @instance + */ + Condition.prototype.conditionThreshold = null; - /** - * Constructs a new ListAlertPoliciesResponse. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListAlertPoliciesResponse. - * @implements IListAlertPoliciesResponse - * @constructor - * @param {google.monitoring.v3.IListAlertPoliciesResponse=} [properties] Properties to set - */ - function ListAlertPoliciesResponse(properties) { - this.alertPolicies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Condition conditionAbsent. + * @member {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null|undefined} conditionAbsent + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @instance + */ + Condition.prototype.conditionAbsent = null; - /** - * ListAlertPoliciesResponse alertPolicies. - * @member {Array.} alertPolicies - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @instance - */ - ListAlertPoliciesResponse.prototype.alertPolicies = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * ListAlertPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @instance - */ - ListAlertPoliciesResponse.prototype.nextPageToken = ""; + /** + * Condition condition. + * @member {"conditionThreshold"|"conditionAbsent"|undefined} condition + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "condition", { + get: $util.oneOfGetter($oneOfFields = ["conditionThreshold", "conditionAbsent"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new ListAlertPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {google.monitoring.v3.IListAlertPoliciesResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse instance - */ - ListAlertPoliciesResponse.create = function create(properties) { - return new ListAlertPoliciesResponse(properties); - }; + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {google.monitoring.v3.AlertPolicy.ICondition=} [properties] Properties to set + * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; - /** - * Encodes the specified ListAlertPoliciesResponse message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {google.monitoring.v3.IListAlertPoliciesResponse} message ListAlertPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAlertPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.alertPolicies != null && message.alertPolicies.length) - for (var i = 0; i < message.alertPolicies.length; ++i) - $root.google.monitoring.v3.AlertPolicy.encode(message.alertPolicies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Condition message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {google.monitoring.v3.AlertPolicy.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionThreshold != null && message.hasOwnProperty("conditionThreshold")) + $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.encode(message.conditionThreshold, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.conditionAbsent != null && message.hasOwnProperty("conditionAbsent")) + $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.encode(message.conditionAbsent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); + return writer; + }; - /** - * Encodes the specified ListAlertPoliciesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {google.monitoring.v3.IListAlertPoliciesResponse} message ListAlertPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAlertPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {google.monitoring.v3.AlertPolicy.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAlertPoliciesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListAlertPoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - if (!(message.alertPolicies && message.alertPolicies.length)) - message.alertPolicies = []; - message.alertPolicies.push($root.google.monitoring.v3.AlertPolicy.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 12: + message.name = reader.string(); + break; + case 6: + message.displayName = reader.string(); + break; + case 1: + message.conditionThreshold = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.decode(reader, reader.uint32()); + break; + case 2: + message.conditionAbsent = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAlertPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListAlertPoliciesResponse message. - * @function verify - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAlertPoliciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.alertPolicies != null && message.hasOwnProperty("alertPolicies")) { - if (!Array.isArray(message.alertPolicies)) - return "alertPolicies: array expected"; - for (var i = 0; i < message.alertPolicies.length; ++i) { - var error = $root.google.monitoring.v3.AlertPolicy.verify(message.alertPolicies[i]); - if (error) - return "alertPolicies." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * Verifies a Condition message. + * @function verify + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.conditionThreshold != null && message.hasOwnProperty("conditionThreshold")) { + properties.condition = 1; + { + var error = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify(message.conditionThreshold); + if (error) + return "conditionThreshold." + error; + } + } + if (message.conditionAbsent != null && message.hasOwnProperty("conditionAbsent")) { + if (properties.condition === 1) + return "condition: multiple values"; + properties.condition = 1; + { + var error = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify(message.conditionAbsent); + if (error) + return "conditionAbsent." + error; + } + } + return null; + }; - /** - * Creates a ListAlertPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse - */ - ListAlertPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListAlertPoliciesResponse) - return object; - var message = new $root.google.monitoring.v3.ListAlertPoliciesResponse(); - if (object.alertPolicies) { - if (!Array.isArray(object.alertPolicies)) - throw TypeError(".google.monitoring.v3.ListAlertPoliciesResponse.alertPolicies: array expected"); - message.alertPolicies = []; - for (var i = 0; i < object.alertPolicies.length; ++i) { - if (typeof object.alertPolicies[i] !== "object") - throw TypeError(".google.monitoring.v3.ListAlertPoliciesResponse.alertPolicies: object expected"); - message.alertPolicies[i] = $root.google.monitoring.v3.AlertPolicy.fromObject(object.alertPolicies[i]); + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition) + return object; + var message = new $root.google.monitoring.v3.AlertPolicy.Condition(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.conditionThreshold != null) { + if (typeof object.conditionThreshold !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.conditionThreshold: object expected"); + message.conditionThreshold = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.fromObject(object.conditionThreshold); } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + if (object.conditionAbsent != null) { + if (typeof object.conditionAbsent !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.conditionAbsent: object expected"); + message.conditionAbsent = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.fromObject(object.conditionAbsent); + } + return message; + }; - /** - * Creates a plain object from a ListAlertPoliciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @static - * @param {google.monitoring.v3.ListAlertPoliciesResponse} message ListAlertPoliciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAlertPoliciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.alertPolicies = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.alertPolicies && message.alertPolicies.length) { - object.alertPolicies = []; - for (var j = 0; j < message.alertPolicies.length; ++j) - object.alertPolicies[j] = $root.google.monitoring.v3.AlertPolicy.toObject(message.alertPolicies[j], options); - } - return object; - }; + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.name = ""; + } + if (message.conditionThreshold != null && message.hasOwnProperty("conditionThreshold")) { + object.conditionThreshold = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.toObject(message.conditionThreshold, options); + if (options.oneofs) + object.condition = "conditionThreshold"; + } + if (message.conditionAbsent != null && message.hasOwnProperty("conditionAbsent")) { + object.conditionAbsent = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.toObject(message.conditionAbsent, options); + if (options.oneofs) + object.condition = "conditionAbsent"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Converts this ListAlertPoliciesResponse to JSON. - * @function toJSON - * @memberof google.monitoring.v3.ListAlertPoliciesResponse - * @instance - * @returns {Object.} JSON object - */ - ListAlertPoliciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ListAlertPoliciesResponse; - })(); + Condition.Trigger = (function() { - v3.UpdateAlertPolicyRequest = (function() { + /** + * Properties of a Trigger. + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @interface ITrigger + * @property {number|null} [count] Trigger count + * @property {number|null} [percent] Trigger percent + */ - /** - * Properties of an UpdateAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @interface IUpdateAlertPolicyRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAlertPolicyRequest updateMask - * @property {google.monitoring.v3.IAlertPolicy|null} [alertPolicy] UpdateAlertPolicyRequest alertPolicy - */ + /** + * Constructs a new Trigger. + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @classdesc Represents a Trigger. + * @implements ITrigger + * @constructor + * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger=} [properties] Properties to set + */ + function Trigger(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new UpdateAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents an UpdateAlertPolicyRequest. - * @implements IUpdateAlertPolicyRequest - * @constructor - * @param {google.monitoring.v3.IUpdateAlertPolicyRequest=} [properties] Properties to set - */ - function UpdateAlertPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Trigger count. + * @member {number} count + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @instance + */ + Trigger.prototype.count = 0; - /** - * UpdateAlertPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @instance - */ - UpdateAlertPolicyRequest.prototype.updateMask = null; + /** + * Trigger percent. + * @member {number} percent + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @instance + */ + Trigger.prototype.percent = 0; - /** - * UpdateAlertPolicyRequest alertPolicy. - * @member {google.monitoring.v3.IAlertPolicy|null|undefined} alertPolicy - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @instance - */ - UpdateAlertPolicyRequest.prototype.alertPolicy = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a new UpdateAlertPolicyRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IUpdateAlertPolicyRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest instance - */ - UpdateAlertPolicyRequest.create = function create(properties) { - return new UpdateAlertPolicyRequest(properties); - }; + /** + * Trigger type. + * @member {"count"|"percent"|undefined} type + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @instance + */ + Object.defineProperty(Trigger.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["count", "percent"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified UpdateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} message UpdateAlertPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAlertPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) - $root.google.monitoring.v3.AlertPolicy.encode(message.alertPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates a new Trigger instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger=} [properties] Properties to set + * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger instance + */ + Trigger.create = function create(properties) { + return new Trigger(properties); + }; - /** - * Encodes the specified UpdateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} message UpdateAlertPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Trigger message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger} message Trigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trigger.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); + if (message.percent != null && message.hasOwnProperty("percent")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.percent); + return writer; + }; - /** - * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAlertPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateAlertPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified Trigger message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger} message Trigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Trigger.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Trigger message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trigger.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition.Trigger(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = reader.int32(); + break; + case 2: + message.percent = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies an UpdateAlertPolicyRequest message. - * @function verify - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAlertPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) { - var error = $root.google.monitoring.v3.AlertPolicy.verify(message.alertPolicy); - if (error) - return "alertPolicy." + error; - } - return null; - }; + /** + * Decodes a Trigger message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Trigger.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an UpdateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest - */ - UpdateAlertPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.UpdateAlertPolicyRequest) - return object; - var message = new $root.google.monitoring.v3.UpdateAlertPolicyRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.monitoring.v3.UpdateAlertPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.alertPolicy != null) { - if (typeof object.alertPolicy !== "object") - throw TypeError(".google.monitoring.v3.UpdateAlertPolicyRequest.alertPolicy: object expected"); - message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.fromObject(object.alertPolicy); - } - return message; - }; + /** + * Verifies a Trigger message. + * @function verify + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Trigger.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.count != null && message.hasOwnProperty("count")) { + properties.type = 1; + if (!$util.isInteger(message.count)) + return "count: integer expected"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (typeof message.percent !== "number") + return "percent: number expected"; + } + return null; + }; - /** - * Creates a plain object from an UpdateAlertPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @static - * @param {google.monitoring.v3.UpdateAlertPolicyRequest} message UpdateAlertPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAlertPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.alertPolicy = null; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) - object.alertPolicy = $root.google.monitoring.v3.AlertPolicy.toObject(message.alertPolicy, options); - return object; - }; - - /** - * Converts this UpdateAlertPolicyRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.UpdateAlertPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAlertPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateAlertPolicyRequest; - })(); - - v3.DeleteAlertPolicyRequest = (function() { - - /** - * Properties of a DeleteAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @interface IDeleteAlertPolicyRequest - * @property {string|null} [name] DeleteAlertPolicyRequest name - */ + /** + * Creates a Trigger message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger + */ + Trigger.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition.Trigger) + return object; + var message = new $root.google.monitoring.v3.AlertPolicy.Condition.Trigger(); + if (object.count != null) + message.count = object.count | 0; + if (object.percent != null) + message.percent = Number(object.percent); + return message; + }; - /** - * Constructs a new DeleteAlertPolicyRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteAlertPolicyRequest. - * @implements IDeleteAlertPolicyRequest - * @constructor - * @param {google.monitoring.v3.IDeleteAlertPolicyRequest=} [properties] Properties to set - */ - function DeleteAlertPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a plain object from a Trigger message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.Trigger} message Trigger + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Trigger.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.count != null && message.hasOwnProperty("count")) { + object.count = message.count; + if (options.oneofs) + object.type = "count"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + object.percent = options.json && !isFinite(message.percent) ? String(message.percent) : message.percent; + if (options.oneofs) + object.type = "percent"; + } + return object; + }; - /** - * DeleteAlertPolicyRequest name. - * @member {string} name - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @instance - */ - DeleteAlertPolicyRequest.prototype.name = ""; + /** + * Converts this Trigger to JSON. + * @function toJSON + * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger + * @instance + * @returns {Object.} JSON object + */ + Trigger.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new DeleteAlertPolicyRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IDeleteAlertPolicyRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest instance - */ - DeleteAlertPolicyRequest.create = function create(properties) { - return new DeleteAlertPolicyRequest(properties); - }; + return Trigger; + })(); - /** - * Encodes the specified DeleteAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} message DeleteAlertPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAlertPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; + Condition.MetricThreshold = (function() { - /** - * Encodes the specified DeleteAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} message DeleteAlertPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a MetricThreshold. + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @interface IMetricThreshold + * @property {string|null} [filter] MetricThreshold filter + * @property {Array.|null} [aggregations] MetricThreshold aggregations + * @property {string|null} [denominatorFilter] MetricThreshold denominatorFilter + * @property {Array.|null} [denominatorAggregations] MetricThreshold denominatorAggregations + * @property {google.monitoring.v3.ComparisonType|null} [comparison] MetricThreshold comparison + * @property {number|null} [thresholdValue] MetricThreshold thresholdValue + * @property {google.protobuf.IDuration|null} [duration] MetricThreshold duration + * @property {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null} [trigger] MetricThreshold trigger + */ - /** - * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAlertPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteAlertPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new MetricThreshold. + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @classdesc Represents a MetricThreshold. + * @implements IMetricThreshold + * @constructor + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold=} [properties] Properties to set + */ + function MetricThreshold(properties) { + this.aggregations = []; + this.denominatorAggregations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * MetricThreshold filter. + * @member {string} filter + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.filter = ""; - /** - * Verifies a DeleteAlertPolicyRequest message. - * @function verify - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAlertPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * MetricThreshold aggregations. + * @member {Array.} aggregations + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.aggregations = $util.emptyArray; - /** - * Creates a DeleteAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest - */ - DeleteAlertPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteAlertPolicyRequest) - return object; - var message = new $root.google.monitoring.v3.DeleteAlertPolicyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * MetricThreshold denominatorFilter. + * @member {string} denominatorFilter + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.denominatorFilter = ""; - /** - * Creates a plain object from a DeleteAlertPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @static - * @param {google.monitoring.v3.DeleteAlertPolicyRequest} message DeleteAlertPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAlertPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * MetricThreshold denominatorAggregations. + * @member {Array.} denominatorAggregations + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.denominatorAggregations = $util.emptyArray; - /** - * Converts this DeleteAlertPolicyRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.DeleteAlertPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAlertPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MetricThreshold comparison. + * @member {google.monitoring.v3.ComparisonType} comparison + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.comparison = 0; - return DeleteAlertPolicyRequest; - })(); + /** + * MetricThreshold thresholdValue. + * @member {number} thresholdValue + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.thresholdValue = 0; - v3.AlertPolicy = (function() { + /** + * MetricThreshold duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.duration = null; - /** - * Properties of an AlertPolicy. - * @memberof google.monitoring.v3 - * @interface IAlertPolicy - * @property {string|null} [name] AlertPolicy name - * @property {string|null} [displayName] AlertPolicy displayName - * @property {google.monitoring.v3.AlertPolicy.IDocumentation|null} [documentation] AlertPolicy documentation - * @property {Object.|null} [userLabels] AlertPolicy userLabels - * @property {Array.|null} [conditions] AlertPolicy conditions - * @property {google.monitoring.v3.AlertPolicy.ConditionCombinerType|null} [combiner] AlertPolicy combiner - * @property {google.protobuf.IBoolValue|null} [enabled] AlertPolicy enabled - * @property {google.rpc.IStatus|null} [validity] AlertPolicy validity - * @property {Array.|null} [notificationChannels] AlertPolicy notificationChannels - * @property {google.monitoring.v3.IMutationRecord|null} [creationRecord] AlertPolicy creationRecord - * @property {google.monitoring.v3.IMutationRecord|null} [mutationRecord] AlertPolicy mutationRecord - */ + /** + * MetricThreshold trigger. + * @member {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null|undefined} trigger + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + */ + MetricThreshold.prototype.trigger = null; - /** - * Constructs a new AlertPolicy. - * @memberof google.monitoring.v3 - * @classdesc Represents an AlertPolicy. - * @implements IAlertPolicy - * @constructor - * @param {google.monitoring.v3.IAlertPolicy=} [properties] Properties to set - */ - function AlertPolicy(properties) { - this.userLabels = {}; - this.conditions = []; - this.notificationChannels = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new MetricThreshold instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold=} [properties] Properties to set + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold instance + */ + MetricThreshold.create = function create(properties) { + return new MetricThreshold(properties); + }; - /** - * AlertPolicy name. - * @member {string} name - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.name = ""; + /** + * Encodes the specified MetricThreshold message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold} message MetricThreshold message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricThreshold.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.comparison != null && message.hasOwnProperty("comparison")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.comparison); + if (message.thresholdValue != null && message.hasOwnProperty("thresholdValue")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.thresholdValue); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.trigger != null && message.hasOwnProperty("trigger")) + $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.encode(message.trigger, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.aggregations != null && message.aggregations.length) + for (var i = 0; i < message.aggregations.length; ++i) + $root.google.monitoring.v3.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.denominatorFilter != null && message.hasOwnProperty("denominatorFilter")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.denominatorFilter); + if (message.denominatorAggregations != null && message.denominatorAggregations.length) + for (var i = 0; i < message.denominatorAggregations.length; ++i) + $root.google.monitoring.v3.Aggregation.encode(message.denominatorAggregations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; - /** - * AlertPolicy displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.displayName = ""; + /** + * Encodes the specified MetricThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold} message MetricThreshold message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricThreshold.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * AlertPolicy documentation. - * @member {google.monitoring.v3.AlertPolicy.IDocumentation|null|undefined} documentation - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.documentation = null; + /** + * Decodes a MetricThreshold message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricThreshold.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.filter = reader.string(); + break; + case 8: + if (!(message.aggregations && message.aggregations.length)) + message.aggregations = []; + message.aggregations.push($root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32())); + break; + case 9: + message.denominatorFilter = reader.string(); + break; + case 10: + if (!(message.denominatorAggregations && message.denominatorAggregations.length)) + message.denominatorAggregations = []; + message.denominatorAggregations.push($root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32())); + break; + case 4: + message.comparison = reader.int32(); + break; + case 5: + message.thresholdValue = reader.double(); + break; + case 6: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 7: + message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AlertPolicy userLabels. - * @member {Object.} userLabels - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.userLabels = $util.emptyObject; + /** + * Decodes a MetricThreshold message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricThreshold.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * AlertPolicy conditions. - * @member {Array.} conditions - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.conditions = $util.emptyArray; + /** + * Verifies a MetricThreshold message. + * @function verify + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricThreshold.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.aggregations != null && message.hasOwnProperty("aggregations")) { + if (!Array.isArray(message.aggregations)) + return "aggregations: array expected"; + for (var i = 0; i < message.aggregations.length; ++i) { + var error = $root.google.monitoring.v3.Aggregation.verify(message.aggregations[i]); + if (error) + return "aggregations." + error; + } + } + if (message.denominatorFilter != null && message.hasOwnProperty("denominatorFilter")) + if (!$util.isString(message.denominatorFilter)) + return "denominatorFilter: string expected"; + if (message.denominatorAggregations != null && message.hasOwnProperty("denominatorAggregations")) { + if (!Array.isArray(message.denominatorAggregations)) + return "denominatorAggregations: array expected"; + for (var i = 0; i < message.denominatorAggregations.length; ++i) { + var error = $root.google.monitoring.v3.Aggregation.verify(message.denominatorAggregations[i]); + if (error) + return "denominatorAggregations." + error; + } + } + if (message.comparison != null && message.hasOwnProperty("comparison")) + switch (message.comparison) { + default: + return "comparison: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.thresholdValue != null && message.hasOwnProperty("thresholdValue")) + if (typeof message.thresholdValue !== "number") + return "thresholdValue: number expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.trigger != null && message.hasOwnProperty("trigger")) { + var error = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.verify(message.trigger); + if (error) + return "trigger." + error; + } + return null; + }; - /** - * AlertPolicy combiner. - * @member {google.monitoring.v3.AlertPolicy.ConditionCombinerType} combiner - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.combiner = 0; + /** + * Creates a MetricThreshold message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold + */ + MetricThreshold.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) + return object; + var message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.aggregations) { + if (!Array.isArray(object.aggregations)) + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.aggregations: array expected"); + message.aggregations = []; + for (var i = 0; i < object.aggregations.length; ++i) { + if (typeof object.aggregations[i] !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.aggregations: object expected"); + message.aggregations[i] = $root.google.monitoring.v3.Aggregation.fromObject(object.aggregations[i]); + } + } + if (object.denominatorFilter != null) + message.denominatorFilter = String(object.denominatorFilter); + if (object.denominatorAggregations) { + if (!Array.isArray(object.denominatorAggregations)) + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.denominatorAggregations: array expected"); + message.denominatorAggregations = []; + for (var i = 0; i < object.denominatorAggregations.length; ++i) { + if (typeof object.denominatorAggregations[i] !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.denominatorAggregations: object expected"); + message.denominatorAggregations[i] = $root.google.monitoring.v3.Aggregation.fromObject(object.denominatorAggregations[i]); + } + } + switch (object.comparison) { + case "COMPARISON_UNSPECIFIED": + case 0: + message.comparison = 0; + break; + case "COMPARISON_GT": + case 1: + message.comparison = 1; + break; + case "COMPARISON_GE": + case 2: + message.comparison = 2; + break; + case "COMPARISON_LT": + case 3: + message.comparison = 3; + break; + case "COMPARISON_LE": + case 4: + message.comparison = 4; + break; + case "COMPARISON_EQ": + case 5: + message.comparison = 5; + break; + case "COMPARISON_NE": + case 6: + message.comparison = 6; + break; + } + if (object.thresholdValue != null) + message.thresholdValue = Number(object.thresholdValue); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.trigger != null) { + if (typeof object.trigger !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.trigger: object expected"); + message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.fromObject(object.trigger); + } + return message; + }; - /** - * AlertPolicy enabled. - * @member {google.protobuf.IBoolValue|null|undefined} enabled - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.enabled = null; + /** + * Creates a plain object from a MetricThreshold message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} message MetricThreshold + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricThreshold.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.aggregations = []; + object.denominatorAggregations = []; + } + if (options.defaults) { + object.filter = ""; + object.comparison = options.enums === String ? "COMPARISON_UNSPECIFIED" : 0; + object.thresholdValue = 0; + object.duration = null; + object.trigger = null; + object.denominatorFilter = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.comparison != null && message.hasOwnProperty("comparison")) + object.comparison = options.enums === String ? $root.google.monitoring.v3.ComparisonType[message.comparison] : message.comparison; + if (message.thresholdValue != null && message.hasOwnProperty("thresholdValue")) + object.thresholdValue = options.json && !isFinite(message.thresholdValue) ? String(message.thresholdValue) : message.thresholdValue; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.toObject(message.trigger, options); + if (message.aggregations && message.aggregations.length) { + object.aggregations = []; + for (var j = 0; j < message.aggregations.length; ++j) + object.aggregations[j] = $root.google.monitoring.v3.Aggregation.toObject(message.aggregations[j], options); + } + if (message.denominatorFilter != null && message.hasOwnProperty("denominatorFilter")) + object.denominatorFilter = message.denominatorFilter; + if (message.denominatorAggregations && message.denominatorAggregations.length) { + object.denominatorAggregations = []; + for (var j = 0; j < message.denominatorAggregations.length; ++j) + object.denominatorAggregations[j] = $root.google.monitoring.v3.Aggregation.toObject(message.denominatorAggregations[j], options); + } + return object; + }; - /** - * AlertPolicy validity. - * @member {google.rpc.IStatus|null|undefined} validity - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.validity = null; + /** + * Converts this MetricThreshold to JSON. + * @function toJSON + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold + * @instance + * @returns {Object.} JSON object + */ + MetricThreshold.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * AlertPolicy notificationChannels. - * @member {Array.} notificationChannels - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.notificationChannels = $util.emptyArray; + return MetricThreshold; + })(); - /** - * AlertPolicy creationRecord. - * @member {google.monitoring.v3.IMutationRecord|null|undefined} creationRecord - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.creationRecord = null; + Condition.MetricAbsence = (function() { - /** - * AlertPolicy mutationRecord. - * @member {google.monitoring.v3.IMutationRecord|null|undefined} mutationRecord - * @memberof google.monitoring.v3.AlertPolicy - * @instance - */ - AlertPolicy.prototype.mutationRecord = null; + /** + * Properties of a MetricAbsence. + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @interface IMetricAbsence + * @property {string|null} [filter] MetricAbsence filter + * @property {Array.|null} [aggregations] MetricAbsence aggregations + * @property {google.protobuf.IDuration|null} [duration] MetricAbsence duration + * @property {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null} [trigger] MetricAbsence trigger + */ - /** - * Creates a new AlertPolicy instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.AlertPolicy - * @static - * @param {google.monitoring.v3.IAlertPolicy=} [properties] Properties to set - * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy instance - */ - AlertPolicy.create = function create(properties) { - return new AlertPolicy(properties); - }; + /** + * Constructs a new MetricAbsence. + * @memberof google.monitoring.v3.AlertPolicy.Condition + * @classdesc Represents a MetricAbsence. + * @implements IMetricAbsence + * @constructor + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence=} [properties] Properties to set + */ + function MetricAbsence(properties) { + this.aggregations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified AlertPolicy message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.AlertPolicy - * @static - * @param {google.monitoring.v3.IAlertPolicy} message AlertPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AlertPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.combiner != null && message.hasOwnProperty("combiner")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.combiner); - if (message.creationRecord != null && message.hasOwnProperty("creationRecord")) - $root.google.monitoring.v3.MutationRecord.encode(message.creationRecord, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.mutationRecord != null && message.hasOwnProperty("mutationRecord")) - $root.google.monitoring.v3.MutationRecord.encode(message.mutationRecord, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.conditions != null && message.conditions.length) - for (var i = 0; i < message.conditions.length; ++i) - $root.google.monitoring.v3.AlertPolicy.Condition.encode(message.conditions[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.documentation != null && message.hasOwnProperty("documentation")) - $root.google.monitoring.v3.AlertPolicy.Documentation.encode(message.documentation, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.notificationChannels != null && message.notificationChannels.length) - for (var i = 0; i < message.notificationChannels.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.notificationChannels[i]); - if (message.userLabels != null && message.hasOwnProperty("userLabels")) - for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); - if (message.enabled != null && message.hasOwnProperty("enabled")) - $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.validity != null && message.hasOwnProperty("validity")) - $root.google.rpc.Status.encode(message.validity, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; + /** + * MetricAbsence filter. + * @member {string} filter + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @instance + */ + MetricAbsence.prototype.filter = ""; - /** - * Encodes the specified AlertPolicy message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.AlertPolicy - * @static - * @param {google.monitoring.v3.IAlertPolicy} message AlertPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AlertPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * MetricAbsence aggregations. + * @member {Array.} aggregations + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @instance + */ + MetricAbsence.prototype.aggregations = $util.emptyArray; - /** - * Decodes an AlertPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.AlertPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AlertPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy(), key; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 13: - message.documentation = $root.google.monitoring.v3.AlertPolicy.Documentation.decode(reader, reader.uint32()); - break; - case 16: - reader.skip().pos++; - if (message.userLabels === $util.emptyObject) - message.userLabels = {}; - key = reader.string(); - reader.pos++; - message.userLabels[key] = reader.string(); - break; - case 12: - if (!(message.conditions && message.conditions.length)) - message.conditions = []; - message.conditions.push($root.google.monitoring.v3.AlertPolicy.Condition.decode(reader, reader.uint32())); - break; - case 6: - message.combiner = reader.int32(); - break; - case 17: - message.enabled = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - case 18: - message.validity = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 14: - if (!(message.notificationChannels && message.notificationChannels.length)) - message.notificationChannels = []; - message.notificationChannels.push(reader.string()); - break; - case 10: - message.creationRecord = $root.google.monitoring.v3.MutationRecord.decode(reader, reader.uint32()); - break; - case 11: - message.mutationRecord = $root.google.monitoring.v3.MutationRecord.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * MetricAbsence duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @instance + */ + MetricAbsence.prototype.duration = null; - /** - * Decodes an AlertPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.AlertPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AlertPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * MetricAbsence trigger. + * @member {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null|undefined} trigger + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @instance + */ + MetricAbsence.prototype.trigger = null; - /** - * Verifies an AlertPolicy message. - * @function verify - * @memberof google.monitoring.v3.AlertPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AlertPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.documentation != null && message.hasOwnProperty("documentation")) { - var error = $root.google.monitoring.v3.AlertPolicy.Documentation.verify(message.documentation); - if (error) - return "documentation." + error; - } - if (message.userLabels != null && message.hasOwnProperty("userLabels")) { - if (!$util.isObject(message.userLabels)) - return "userLabels: object expected"; - var key = Object.keys(message.userLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.userLabels[key[i]])) - return "userLabels: string{k:string} expected"; - } - if (message.conditions != null && message.hasOwnProperty("conditions")) { - if (!Array.isArray(message.conditions)) - return "conditions: array expected"; - for (var i = 0; i < message.conditions.length; ++i) { - var error = $root.google.monitoring.v3.AlertPolicy.Condition.verify(message.conditions[i]); - if (error) - return "conditions." + error; - } - } - if (message.combiner != null && message.hasOwnProperty("combiner")) - switch (message.combiner) { - default: - return "combiner: enum value expected"; - case 0: - case 1: - case 2: - case 3: + /** + * Creates a new MetricAbsence instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence=} [properties] Properties to set + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence instance + */ + MetricAbsence.create = function create(properties) { + return new MetricAbsence(properties); + }; + + /** + * Encodes the specified MetricAbsence message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence} message MetricAbsence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAbsence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.duration != null && message.hasOwnProperty("duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.trigger != null && message.hasOwnProperty("trigger")) + $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.encode(message.trigger, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.aggregations != null && message.aggregations.length) + for (var i = 0; i < message.aggregations.length; ++i) + $root.google.monitoring.v3.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricAbsence message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence} message MetricAbsence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricAbsence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricAbsence message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAbsence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filter = reader.string(); + break; + case 5: + if (!(message.aggregations && message.aggregations.length)) + message.aggregations = []; + message.aggregations.push($root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32())); + break; + case 2: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 3: + message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricAbsence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricAbsence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricAbsence message. + * @function verify + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricAbsence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.aggregations != null && message.hasOwnProperty("aggregations")) { + if (!Array.isArray(message.aggregations)) + return "aggregations: array expected"; + for (var i = 0; i < message.aggregations.length; ++i) { + var error = $root.google.monitoring.v3.Aggregation.verify(message.aggregations[i]); + if (error) + return "aggregations." + error; + } + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.trigger != null && message.hasOwnProperty("trigger")) { + var error = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.verify(message.trigger); + if (error) + return "trigger." + error; + } + return null; + }; + + /** + * Creates a MetricAbsence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence + */ + MetricAbsence.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) + return object; + var message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.aggregations) { + if (!Array.isArray(object.aggregations)) + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.aggregations: array expected"); + message.aggregations = []; + for (var i = 0; i < object.aggregations.length; ++i) { + if (typeof object.aggregations[i] !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.aggregations: object expected"); + message.aggregations[i] = $root.google.monitoring.v3.Aggregation.fromObject(object.aggregations[i]); + } + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.trigger != null) { + if (typeof object.trigger !== "object") + throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.trigger: object expected"); + message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.fromObject(object.trigger); + } + return message; + }; + + /** + * Creates a plain object from a MetricAbsence message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @static + * @param {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} message MetricAbsence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricAbsence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aggregations = []; + if (options.defaults) { + object.filter = ""; + object.duration = null; + object.trigger = null; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.toObject(message.trigger, options); + if (message.aggregations && message.aggregations.length) { + object.aggregations = []; + for (var j = 0; j < message.aggregations.length; ++j) + object.aggregations[j] = $root.google.monitoring.v3.Aggregation.toObject(message.aggregations[j], options); + } + return object; + }; + + /** + * Converts this MetricAbsence to JSON. + * @function toJSON + * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence + * @instance + * @returns {Object.} JSON object + */ + MetricAbsence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MetricAbsence; + })(); + + return Condition; + })(); + + /** + * ConditionCombinerType enum. + * @name google.monitoring.v3.AlertPolicy.ConditionCombinerType + * @enum {string} + * @property {number} COMBINE_UNSPECIFIED=0 COMBINE_UNSPECIFIED value + * @property {number} AND=1 AND value + * @property {number} OR=2 OR value + * @property {number} AND_WITH_MATCHING_RESOURCE=3 AND_WITH_MATCHING_RESOURCE value + */ + AlertPolicy.ConditionCombinerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMBINE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AND"] = 1; + values[valuesById[2] = "OR"] = 2; + values[valuesById[3] = "AND_WITH_MATCHING_RESOURCE"] = 3; + return values; + })(); + + return AlertPolicy; + })(); + + v3.TypedValue = (function() { + + /** + * Properties of a TypedValue. + * @memberof google.monitoring.v3 + * @interface ITypedValue + * @property {boolean|null} [boolValue] TypedValue boolValue + * @property {number|Long|null} [int64Value] TypedValue int64Value + * @property {number|null} [doubleValue] TypedValue doubleValue + * @property {string|null} [stringValue] TypedValue stringValue + * @property {google.api.IDistribution|null} [distributionValue] TypedValue distributionValue + */ + + /** + * Constructs a new TypedValue. + * @memberof google.monitoring.v3 + * @classdesc Represents a TypedValue. + * @implements ITypedValue + * @constructor + * @param {google.monitoring.v3.ITypedValue=} [properties] Properties to set + */ + function TypedValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypedValue boolValue. + * @member {boolean} boolValue + * @memberof google.monitoring.v3.TypedValue + * @instance + */ + TypedValue.prototype.boolValue = false; + + /** + * TypedValue int64Value. + * @member {number|Long} int64Value + * @memberof google.monitoring.v3.TypedValue + * @instance + */ + TypedValue.prototype.int64Value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TypedValue doubleValue. + * @member {number} doubleValue + * @memberof google.monitoring.v3.TypedValue + * @instance + */ + TypedValue.prototype.doubleValue = 0; + + /** + * TypedValue stringValue. + * @member {string} stringValue + * @memberof google.monitoring.v3.TypedValue + * @instance + */ + TypedValue.prototype.stringValue = ""; + + /** + * TypedValue distributionValue. + * @member {google.api.IDistribution|null|undefined} distributionValue + * @memberof google.monitoring.v3.TypedValue + * @instance + */ + TypedValue.prototype.distributionValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TypedValue value. + * @member {"boolValue"|"int64Value"|"doubleValue"|"stringValue"|"distributionValue"|undefined} value + * @memberof google.monitoring.v3.TypedValue + * @instance + */ + Object.defineProperty(TypedValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["boolValue", "int64Value", "doubleValue", "stringValue", "distributionValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TypedValue instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.TypedValue + * @static + * @param {google.monitoring.v3.ITypedValue=} [properties] Properties to set + * @returns {google.monitoring.v3.TypedValue} TypedValue instance + */ + TypedValue.create = function create(properties) { + return new TypedValue(properties); + }; + + /** + * Encodes the specified TypedValue message. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.TypedValue + * @static + * @param {google.monitoring.v3.ITypedValue} message TypedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypedValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boolValue != null && message.hasOwnProperty("boolValue")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.boolValue); + if (message.int64Value != null && message.hasOwnProperty("int64Value")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.int64Value); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stringValue); + if (message.distributionValue != null && message.hasOwnProperty("distributionValue")) + $root.google.api.Distribution.encode(message.distributionValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TypedValue message, length delimited. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.TypedValue + * @static + * @param {google.monitoring.v3.ITypedValue} message TypedValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypedValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypedValue message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.TypedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.TypedValue} TypedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypedValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TypedValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boolValue = reader.bool(); + break; + case 2: + message.int64Value = reader.int64(); + break; + case 3: + message.doubleValue = reader.double(); + break; + case 4: + message.stringValue = reader.string(); + break; + case 5: + message.distributionValue = $root.google.api.Distribution.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); break; } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - var error = $root.google.protobuf.BoolValue.verify(message.enabled); - if (error) - return "enabled." + error; } - if (message.validity != null && message.hasOwnProperty("validity")) { - var error = $root.google.rpc.Status.verify(message.validity); - if (error) - return "validity." + error; + return message; + }; + + /** + * Decodes a TypedValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.TypedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.TypedValue} TypedValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypedValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypedValue message. + * @function verify + * @memberof google.monitoring.v3.TypedValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypedValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + properties.value = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; } - if (message.notificationChannels != null && message.hasOwnProperty("notificationChannels")) { - if (!Array.isArray(message.notificationChannels)) - return "notificationChannels: array expected"; - for (var i = 0; i < message.notificationChannels.length; ++i) - if (!$util.isString(message.notificationChannels[i])) - return "notificationChannels: string[] expected"; + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.int64Value) && !(message.int64Value && $util.isInteger(message.int64Value.low) && $util.isInteger(message.int64Value.high))) + return "int64Value: integer|Long expected"; } - if (message.creationRecord != null && message.hasOwnProperty("creationRecord")) { - var error = $root.google.monitoring.v3.MutationRecord.verify(message.creationRecord); - if (error) - return "creationRecord." + error; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; } - if (message.mutationRecord != null && message.hasOwnProperty("mutationRecord")) { - var error = $root.google.monitoring.v3.MutationRecord.verify(message.mutationRecord); - if (error) - return "mutationRecord." + error; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.distributionValue != null && message.hasOwnProperty("distributionValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.api.Distribution.verify(message.distributionValue); + if (error) + return "distributionValue." + error; + } } return null; }; /** - * Creates an AlertPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a TypedValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.AlertPolicy + * @memberof google.monitoring.v3.TypedValue * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.AlertPolicy} AlertPolicy + * @returns {google.monitoring.v3.TypedValue} TypedValue */ - AlertPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.AlertPolicy) + TypedValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.TypedValue) return object; - var message = new $root.google.monitoring.v3.AlertPolicy(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.documentation != null) { - if (typeof object.documentation !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.documentation: object expected"); - message.documentation = $root.google.monitoring.v3.AlertPolicy.Documentation.fromObject(object.documentation); - } - if (object.userLabels) { - if (typeof object.userLabels !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.userLabels: object expected"); - message.userLabels = {}; - for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) - message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); - } - if (object.conditions) { - if (!Array.isArray(object.conditions)) - throw TypeError(".google.monitoring.v3.AlertPolicy.conditions: array expected"); - message.conditions = []; - for (var i = 0; i < object.conditions.length; ++i) { - if (typeof object.conditions[i] !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.conditions: object expected"); - message.conditions[i] = $root.google.monitoring.v3.AlertPolicy.Condition.fromObject(object.conditions[i]); - } - } - switch (object.combiner) { - case "COMBINE_UNSPECIFIED": - case 0: - message.combiner = 0; - break; - case "AND": - case 1: - message.combiner = 1; - break; - case "OR": - case 2: - message.combiner = 2; - break; - case "AND_WITH_MATCHING_RESOURCE": - case 3: - message.combiner = 3; - break; - } - if (object.enabled != null) { - if (typeof object.enabled !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.enabled: object expected"); - message.enabled = $root.google.protobuf.BoolValue.fromObject(object.enabled); - } - if (object.validity != null) { - if (typeof object.validity !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.validity: object expected"); - message.validity = $root.google.rpc.Status.fromObject(object.validity); - } - if (object.notificationChannels) { - if (!Array.isArray(object.notificationChannels)) - throw TypeError(".google.monitoring.v3.AlertPolicy.notificationChannels: array expected"); - message.notificationChannels = []; - for (var i = 0; i < object.notificationChannels.length; ++i) - message.notificationChannels[i] = String(object.notificationChannels[i]); - } - if (object.creationRecord != null) { - if (typeof object.creationRecord !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.creationRecord: object expected"); - message.creationRecord = $root.google.monitoring.v3.MutationRecord.fromObject(object.creationRecord); - } - if (object.mutationRecord != null) { - if (typeof object.mutationRecord !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.mutationRecord: object expected"); - message.mutationRecord = $root.google.monitoring.v3.MutationRecord.fromObject(object.mutationRecord); + var message = new $root.google.monitoring.v3.TypedValue(); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.int64Value != null) + if ($util.Long) + (message.int64Value = $util.Long.fromValue(object.int64Value)).unsigned = false; + else if (typeof object.int64Value === "string") + message.int64Value = parseInt(object.int64Value, 10); + else if (typeof object.int64Value === "number") + message.int64Value = object.int64Value; + else if (typeof object.int64Value === "object") + message.int64Value = new $util.LongBits(object.int64Value.low >>> 0, object.int64Value.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.distributionValue != null) { + if (typeof object.distributionValue !== "object") + throw TypeError(".google.monitoring.v3.TypedValue.distributionValue: object expected"); + message.distributionValue = $root.google.api.Distribution.fromObject(object.distributionValue); } return message; }; /** - * Creates a plain object from an AlertPolicy message. Also converts values to other types if specified. + * Creates a plain object from a TypedValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.AlertPolicy + * @memberof google.monitoring.v3.TypedValue * @static - * @param {google.monitoring.v3.AlertPolicy} message AlertPolicy + * @param {google.monitoring.v3.TypedValue} message TypedValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AlertPolicy.toObject = function toObject(message, options) { + TypedValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.conditions = []; - object.notificationChannels = []; + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.value = "boolValue"; } - if (options.objects || options.defaults) - object.userLabels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.combiner = options.enums === String ? "COMBINE_UNSPECIFIED" : 0; - object.creationRecord = null; - object.mutationRecord = null; - object.documentation = null; - object.enabled = null; - object.validity = null; + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + if (typeof message.int64Value === "number") + object.int64Value = options.longs === String ? String(message.int64Value) : message.int64Value; + else + object.int64Value = options.longs === String ? $util.Long.prototype.toString.call(message.int64Value) : options.longs === Number ? new $util.LongBits(message.int64Value.low >>> 0, message.int64Value.high >>> 0).toNumber() : message.int64Value; + if (options.oneofs) + object.value = "int64Value"; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.combiner != null && message.hasOwnProperty("combiner")) - object.combiner = options.enums === String ? $root.google.monitoring.v3.AlertPolicy.ConditionCombinerType[message.combiner] : message.combiner; - if (message.creationRecord != null && message.hasOwnProperty("creationRecord")) - object.creationRecord = $root.google.monitoring.v3.MutationRecord.toObject(message.creationRecord, options); - if (message.mutationRecord != null && message.hasOwnProperty("mutationRecord")) - object.mutationRecord = $root.google.monitoring.v3.MutationRecord.toObject(message.mutationRecord, options); - if (message.conditions && message.conditions.length) { - object.conditions = []; - for (var j = 0; j < message.conditions.length; ++j) - object.conditions[j] = $root.google.monitoring.v3.AlertPolicy.Condition.toObject(message.conditions[j], options); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object.value = "doubleValue"; } - if (message.documentation != null && message.hasOwnProperty("documentation")) - object.documentation = $root.google.monitoring.v3.AlertPolicy.Documentation.toObject(message.documentation, options); - if (message.notificationChannels && message.notificationChannels.length) { - object.notificationChannels = []; - for (var j = 0; j < message.notificationChannels.length; ++j) - object.notificationChannels[j] = message.notificationChannels[j]; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; } - var keys2; - if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { - object.userLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + if (message.distributionValue != null && message.hasOwnProperty("distributionValue")) { + object.distributionValue = $root.google.api.Distribution.toObject(message.distributionValue, options); + if (options.oneofs) + object.value = "distributionValue"; } - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options); - if (message.validity != null && message.hasOwnProperty("validity")) - object.validity = $root.google.rpc.Status.toObject(message.validity, options); return object; }; /** - * Converts this AlertPolicy to JSON. + * Converts this TypedValue to JSON. * @function toJSON - * @memberof google.monitoring.v3.AlertPolicy + * @memberof google.monitoring.v3.TypedValue * @instance * @returns {Object.} JSON object */ - AlertPolicy.prototype.toJSON = function toJSON() { + TypedValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - AlertPolicy.Documentation = (function() { + return TypedValue; + })(); - /** - * Properties of a Documentation. - * @memberof google.monitoring.v3.AlertPolicy - * @interface IDocumentation - * @property {string|null} [content] Documentation content - * @property {string|null} [mimeType] Documentation mimeType - */ + v3.TimeInterval = (function() { - /** - * Constructs a new Documentation. - * @memberof google.monitoring.v3.AlertPolicy - * @classdesc Represents a Documentation. - * @implements IDocumentation - * @constructor - * @param {google.monitoring.v3.AlertPolicy.IDocumentation=} [properties] Properties to set - */ - function Documentation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a TimeInterval. + * @memberof google.monitoring.v3 + * @interface ITimeInterval + * @property {google.protobuf.ITimestamp|null} [endTime] TimeInterval endTime + * @property {google.protobuf.ITimestamp|null} [startTime] TimeInterval startTime + */ - /** - * Documentation content. - * @member {string} content - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @instance - */ - Documentation.prototype.content = ""; + /** + * Constructs a new TimeInterval. + * @memberof google.monitoring.v3 + * @classdesc Represents a TimeInterval. + * @implements ITimeInterval + * @constructor + * @param {google.monitoring.v3.ITimeInterval=} [properties] Properties to set + */ + function TimeInterval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Documentation mimeType. - * @member {string} mimeType - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @instance - */ - Documentation.prototype.mimeType = ""; + /** + * TimeInterval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.monitoring.v3.TimeInterval + * @instance + */ + TimeInterval.prototype.endTime = null; - /** - * Creates a new Documentation instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {google.monitoring.v3.AlertPolicy.IDocumentation=} [properties] Properties to set - * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation instance - */ - Documentation.create = function create(properties) { - return new Documentation(properties); - }; + /** + * TimeInterval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.monitoring.v3.TimeInterval + * @instance + */ + TimeInterval.prototype.startTime = null; - /** - * Encodes the specified Documentation message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {google.monitoring.v3.AlertPolicy.IDocumentation} message Documentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documentation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && message.hasOwnProperty("content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; + /** + * Creates a new TimeInterval instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {google.monitoring.v3.ITimeInterval=} [properties] Properties to set + * @returns {google.monitoring.v3.TimeInterval} TimeInterval instance + */ + TimeInterval.create = function create(properties) { + return new TimeInterval(properties); + }; - /** - * Encodes the specified Documentation message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Documentation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {google.monitoring.v3.AlertPolicy.IDocumentation} message Documentation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documentation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified TimeInterval message. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {google.monitoring.v3.ITimeInterval} message TimeInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInterval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Decodes a Documentation message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documentation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Documentation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = reader.string(); - break; - case 2: - message.mimeType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified TimeInterval message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {google.monitoring.v3.ITimeInterval} message TimeInterval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeInterval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Documentation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documentation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a TimeInterval message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.TimeInterval} TimeInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInterval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeInterval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a Documentation message. - * @function verify - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documentation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + /** + * Decodes a TimeInterval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.TimeInterval} TimeInterval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeInterval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Documentation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.AlertPolicy.Documentation} Documentation - */ - Documentation.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.AlertPolicy.Documentation) - return object; - var message = new $root.google.monitoring.v3.AlertPolicy.Documentation(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + /** + * Verifies a TimeInterval message. + * @function verify + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeInterval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; - /** - * Creates a plain object from a Documentation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @static - * @param {google.monitoring.v3.AlertPolicy.Documentation} message Documentation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documentation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; + /** + * Creates a TimeInterval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.TimeInterval} TimeInterval + */ + TimeInterval.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.TimeInterval) return object; - }; - - /** - * Converts this Documentation to JSON. - * @function toJSON - * @memberof google.monitoring.v3.AlertPolicy.Documentation - * @instance - * @returns {Object.} JSON object - */ - Documentation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.monitoring.v3.TimeInterval(); + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.monitoring.v3.TimeInterval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.monitoring.v3.TimeInterval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; - return Documentation; - })(); + /** + * Creates a plain object from a TimeInterval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.TimeInterval + * @static + * @param {google.monitoring.v3.TimeInterval} message TimeInterval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeInterval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; - AlertPolicy.Condition = (function() { + /** + * Converts this TimeInterval to JSON. + * @function toJSON + * @memberof google.monitoring.v3.TimeInterval + * @instance + * @returns {Object.} JSON object + */ + TimeInterval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Condition. - * @memberof google.monitoring.v3.AlertPolicy - * @interface ICondition - * @property {string|null} [name] Condition name - * @property {string|null} [displayName] Condition displayName - * @property {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null} [conditionThreshold] Condition conditionThreshold - * @property {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null} [conditionAbsent] Condition conditionAbsent - */ + return TimeInterval; + })(); - /** - * Constructs a new Condition. - * @memberof google.monitoring.v3.AlertPolicy - * @classdesc Represents a Condition. - * @implements ICondition - * @constructor - * @param {google.monitoring.v3.AlertPolicy.ICondition=} [properties] Properties to set - */ - function Condition(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v3.Aggregation = (function() { - /** - * Condition name. - * @member {string} name - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @instance - */ - Condition.prototype.name = ""; + /** + * Properties of an Aggregation. + * @memberof google.monitoring.v3 + * @interface IAggregation + * @property {google.protobuf.IDuration|null} [alignmentPeriod] Aggregation alignmentPeriod + * @property {google.monitoring.v3.Aggregation.Aligner|null} [perSeriesAligner] Aggregation perSeriesAligner + * @property {google.monitoring.v3.Aggregation.Reducer|null} [crossSeriesReducer] Aggregation crossSeriesReducer + * @property {Array.|null} [groupByFields] Aggregation groupByFields + */ - /** - * Condition displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @instance - */ - Condition.prototype.displayName = ""; + /** + * Constructs a new Aggregation. + * @memberof google.monitoring.v3 + * @classdesc Represents an Aggregation. + * @implements IAggregation + * @constructor + * @param {google.monitoring.v3.IAggregation=} [properties] Properties to set + */ + function Aggregation(properties) { + this.groupByFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Condition conditionThreshold. - * @member {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold|null|undefined} conditionThreshold - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @instance - */ - Condition.prototype.conditionThreshold = null; + /** + * Aggregation alignmentPeriod. + * @member {google.protobuf.IDuration|null|undefined} alignmentPeriod + * @memberof google.monitoring.v3.Aggregation + * @instance + */ + Aggregation.prototype.alignmentPeriod = null; - /** - * Condition conditionAbsent. - * @member {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence|null|undefined} conditionAbsent - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @instance - */ - Condition.prototype.conditionAbsent = null; + /** + * Aggregation perSeriesAligner. + * @member {google.monitoring.v3.Aggregation.Aligner} perSeriesAligner + * @memberof google.monitoring.v3.Aggregation + * @instance + */ + Aggregation.prototype.perSeriesAligner = 0; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Aggregation crossSeriesReducer. + * @member {google.monitoring.v3.Aggregation.Reducer} crossSeriesReducer + * @memberof google.monitoring.v3.Aggregation + * @instance + */ + Aggregation.prototype.crossSeriesReducer = 0; - /** - * Condition condition. - * @member {"conditionThreshold"|"conditionAbsent"|undefined} condition - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @instance - */ - Object.defineProperty(Condition.prototype, "condition", { - get: $util.oneOfGetter($oneOfFields = ["conditionThreshold", "conditionAbsent"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Aggregation groupByFields. + * @member {Array.} groupByFields + * @memberof google.monitoring.v3.Aggregation + * @instance + */ + Aggregation.prototype.groupByFields = $util.emptyArray; - /** - * Creates a new Condition instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {google.monitoring.v3.AlertPolicy.ICondition=} [properties] Properties to set - * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition instance - */ - Condition.create = function create(properties) { - return new Condition(properties); - }; + /** + * Creates a new Aggregation instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {google.monitoring.v3.IAggregation=} [properties] Properties to set + * @returns {google.monitoring.v3.Aggregation} Aggregation instance + */ + Aggregation.create = function create(properties) { + return new Aggregation(properties); + }; - /** - * Encodes the specified Condition message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {google.monitoring.v3.AlertPolicy.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.conditionThreshold != null && message.hasOwnProperty("conditionThreshold")) - $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.encode(message.conditionThreshold, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.conditionAbsent != null && message.hasOwnProperty("conditionAbsent")) - $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.encode(message.conditionAbsent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); - return writer; - }; + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {google.monitoring.v3.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) + $root.google.protobuf.Duration.encode(message.alignmentPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.perSeriesAligner); + if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.crossSeriesReducer); + if (message.groupByFields != null && message.groupByFields.length) + for (var i = 0; i < message.groupByFields.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.groupByFields[i]); + return writer; + }; - /** - * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {google.monitoring.v3.AlertPolicy.ICondition} message Condition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Condition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {google.monitoring.v3.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Condition message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 12: - message.name = reader.string(); - break; - case 6: - message.displayName = reader.string(); - break; - case 1: - message.conditionThreshold = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.decode(reader, reader.uint32()); - break; - case 2: - message.conditionAbsent = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Aggregation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alignmentPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 2: + message.perSeriesAligner = reader.int32(); + break; + case 4: + message.crossSeriesReducer = reader.int32(); + break; + case 5: + if (!(message.groupByFields && message.groupByFields.length)) + message.groupByFields = []; + message.groupByFields.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a Condition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Condition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a Condition message. - * @function verify - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Condition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.conditionThreshold != null && message.hasOwnProperty("conditionThreshold")) { - properties.condition = 1; - { - var error = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify(message.conditionThreshold); - if (error) - return "conditionThreshold." + error; - } - } - if (message.conditionAbsent != null && message.hasOwnProperty("conditionAbsent")) { - if (properties.condition === 1) - return "condition: multiple values"; - properties.condition = 1; - { - var error = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify(message.conditionAbsent); - if (error) - return "conditionAbsent." + error; - } - } - return null; - }; + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Condition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.AlertPolicy.Condition} Condition - */ - Condition.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition) - return object; - var message = new $root.google.monitoring.v3.AlertPolicy.Condition(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.conditionThreshold != null) { - if (typeof object.conditionThreshold !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.conditionThreshold: object expected"); - message.conditionThreshold = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.fromObject(object.conditionThreshold); + /** + * Verifies an Aggregation message. + * @function verify + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.alignmentPeriod); + if (error) + return "alignmentPeriod." + error; + } + if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) + switch (message.perSeriesAligner) { + default: + return "perSeriesAligner: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 24: + case 17: + case 18: + case 19: + case 20: + case 21: + case 23: + break; } - if (object.conditionAbsent != null) { - if (typeof object.conditionAbsent !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.conditionAbsent: object expected"); - message.conditionAbsent = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.fromObject(object.conditionAbsent); + if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) + switch (message.crossSeriesReducer) { + default: + return "crossSeriesReducer: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 15: + case 8: + case 9: + case 10: + case 11: + case 12: + break; } - return message; - }; + if (message.groupByFields != null && message.hasOwnProperty("groupByFields")) { + if (!Array.isArray(message.groupByFields)) + return "groupByFields: array expected"; + for (var i = 0; i < message.groupByFields.length; ++i) + if (!$util.isString(message.groupByFields[i])) + return "groupByFields: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from a Condition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition} message Condition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Condition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayName = ""; - object.name = ""; - } - if (message.conditionThreshold != null && message.hasOwnProperty("conditionThreshold")) { - object.conditionThreshold = $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.toObject(message.conditionThreshold, options); - if (options.oneofs) - object.condition = "conditionThreshold"; - } - if (message.conditionAbsent != null && message.hasOwnProperty("conditionAbsent")) { - object.conditionAbsent = $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.toObject(message.conditionAbsent, options); - if (options.oneofs) - object.condition = "conditionAbsent"; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Aggregation} Aggregation + */ + Aggregation.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Aggregation) return object; - }; + var message = new $root.google.monitoring.v3.Aggregation(); + if (object.alignmentPeriod != null) { + if (typeof object.alignmentPeriod !== "object") + throw TypeError(".google.monitoring.v3.Aggregation.alignmentPeriod: object expected"); + message.alignmentPeriod = $root.google.protobuf.Duration.fromObject(object.alignmentPeriod); + } + switch (object.perSeriesAligner) { + case "ALIGN_NONE": + case 0: + message.perSeriesAligner = 0; + break; + case "ALIGN_DELTA": + case 1: + message.perSeriesAligner = 1; + break; + case "ALIGN_RATE": + case 2: + message.perSeriesAligner = 2; + break; + case "ALIGN_INTERPOLATE": + case 3: + message.perSeriesAligner = 3; + break; + case "ALIGN_NEXT_OLDER": + case 4: + message.perSeriesAligner = 4; + break; + case "ALIGN_MIN": + case 10: + message.perSeriesAligner = 10; + break; + case "ALIGN_MAX": + case 11: + message.perSeriesAligner = 11; + break; + case "ALIGN_MEAN": + case 12: + message.perSeriesAligner = 12; + break; + case "ALIGN_COUNT": + case 13: + message.perSeriesAligner = 13; + break; + case "ALIGN_SUM": + case 14: + message.perSeriesAligner = 14; + break; + case "ALIGN_STDDEV": + case 15: + message.perSeriesAligner = 15; + break; + case "ALIGN_COUNT_TRUE": + case 16: + message.perSeriesAligner = 16; + break; + case "ALIGN_COUNT_FALSE": + case 24: + message.perSeriesAligner = 24; + break; + case "ALIGN_FRACTION_TRUE": + case 17: + message.perSeriesAligner = 17; + break; + case "ALIGN_PERCENTILE_99": + case 18: + message.perSeriesAligner = 18; + break; + case "ALIGN_PERCENTILE_95": + case 19: + message.perSeriesAligner = 19; + break; + case "ALIGN_PERCENTILE_50": + case 20: + message.perSeriesAligner = 20; + break; + case "ALIGN_PERCENTILE_05": + case 21: + message.perSeriesAligner = 21; + break; + case "ALIGN_PERCENT_CHANGE": + case 23: + message.perSeriesAligner = 23; + break; + } + switch (object.crossSeriesReducer) { + case "REDUCE_NONE": + case 0: + message.crossSeriesReducer = 0; + break; + case "REDUCE_MEAN": + case 1: + message.crossSeriesReducer = 1; + break; + case "REDUCE_MIN": + case 2: + message.crossSeriesReducer = 2; + break; + case "REDUCE_MAX": + case 3: + message.crossSeriesReducer = 3; + break; + case "REDUCE_SUM": + case 4: + message.crossSeriesReducer = 4; + break; + case "REDUCE_STDDEV": + case 5: + message.crossSeriesReducer = 5; + break; + case "REDUCE_COUNT": + case 6: + message.crossSeriesReducer = 6; + break; + case "REDUCE_COUNT_TRUE": + case 7: + message.crossSeriesReducer = 7; + break; + case "REDUCE_COUNT_FALSE": + case 15: + message.crossSeriesReducer = 15; + break; + case "REDUCE_FRACTION_TRUE": + case 8: + message.crossSeriesReducer = 8; + break; + case "REDUCE_PERCENTILE_99": + case 9: + message.crossSeriesReducer = 9; + break; + case "REDUCE_PERCENTILE_95": + case 10: + message.crossSeriesReducer = 10; + break; + case "REDUCE_PERCENTILE_50": + case 11: + message.crossSeriesReducer = 11; + break; + case "REDUCE_PERCENTILE_05": + case 12: + message.crossSeriesReducer = 12; + break; + } + if (object.groupByFields) { + if (!Array.isArray(object.groupByFields)) + throw TypeError(".google.monitoring.v3.Aggregation.groupByFields: array expected"); + message.groupByFields = []; + for (var i = 0; i < object.groupByFields.length; ++i) + message.groupByFields[i] = String(object.groupByFields[i]); + } + return message; + }; - /** - * Converts this Condition to JSON. - * @function toJSON - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @instance - * @returns {Object.} JSON object - */ - Condition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Aggregation + * @static + * @param {google.monitoring.v3.Aggregation} message Aggregation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupByFields = []; + if (options.defaults) { + object.alignmentPeriod = null; + object.perSeriesAligner = options.enums === String ? "ALIGN_NONE" : 0; + object.crossSeriesReducer = options.enums === String ? "REDUCE_NONE" : 0; + } + if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) + object.alignmentPeriod = $root.google.protobuf.Duration.toObject(message.alignmentPeriod, options); + if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) + object.perSeriesAligner = options.enums === String ? $root.google.monitoring.v3.Aggregation.Aligner[message.perSeriesAligner] : message.perSeriesAligner; + if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) + object.crossSeriesReducer = options.enums === String ? $root.google.monitoring.v3.Aggregation.Reducer[message.crossSeriesReducer] : message.crossSeriesReducer; + if (message.groupByFields && message.groupByFields.length) { + object.groupByFields = []; + for (var j = 0; j < message.groupByFields.length; ++j) + object.groupByFields[j] = message.groupByFields[j]; + } + return object; + }; - Condition.Trigger = (function() { + /** + * Converts this Aggregation to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Aggregation + * @instance + * @returns {Object.} JSON object + */ + Aggregation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Trigger. - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @interface ITrigger - * @property {number|null} [count] Trigger count - * @property {number|null} [percent] Trigger percent - */ + /** + * Aligner enum. + * @name google.monitoring.v3.Aggregation.Aligner + * @enum {string} + * @property {number} ALIGN_NONE=0 ALIGN_NONE value + * @property {number} ALIGN_DELTA=1 ALIGN_DELTA value + * @property {number} ALIGN_RATE=2 ALIGN_RATE value + * @property {number} ALIGN_INTERPOLATE=3 ALIGN_INTERPOLATE value + * @property {number} ALIGN_NEXT_OLDER=4 ALIGN_NEXT_OLDER value + * @property {number} ALIGN_MIN=10 ALIGN_MIN value + * @property {number} ALIGN_MAX=11 ALIGN_MAX value + * @property {number} ALIGN_MEAN=12 ALIGN_MEAN value + * @property {number} ALIGN_COUNT=13 ALIGN_COUNT value + * @property {number} ALIGN_SUM=14 ALIGN_SUM value + * @property {number} ALIGN_STDDEV=15 ALIGN_STDDEV value + * @property {number} ALIGN_COUNT_TRUE=16 ALIGN_COUNT_TRUE value + * @property {number} ALIGN_COUNT_FALSE=24 ALIGN_COUNT_FALSE value + * @property {number} ALIGN_FRACTION_TRUE=17 ALIGN_FRACTION_TRUE value + * @property {number} ALIGN_PERCENTILE_99=18 ALIGN_PERCENTILE_99 value + * @property {number} ALIGN_PERCENTILE_95=19 ALIGN_PERCENTILE_95 value + * @property {number} ALIGN_PERCENTILE_50=20 ALIGN_PERCENTILE_50 value + * @property {number} ALIGN_PERCENTILE_05=21 ALIGN_PERCENTILE_05 value + * @property {number} ALIGN_PERCENT_CHANGE=23 ALIGN_PERCENT_CHANGE value + */ + Aggregation.Aligner = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALIGN_NONE"] = 0; + values[valuesById[1] = "ALIGN_DELTA"] = 1; + values[valuesById[2] = "ALIGN_RATE"] = 2; + values[valuesById[3] = "ALIGN_INTERPOLATE"] = 3; + values[valuesById[4] = "ALIGN_NEXT_OLDER"] = 4; + values[valuesById[10] = "ALIGN_MIN"] = 10; + values[valuesById[11] = "ALIGN_MAX"] = 11; + values[valuesById[12] = "ALIGN_MEAN"] = 12; + values[valuesById[13] = "ALIGN_COUNT"] = 13; + values[valuesById[14] = "ALIGN_SUM"] = 14; + values[valuesById[15] = "ALIGN_STDDEV"] = 15; + values[valuesById[16] = "ALIGN_COUNT_TRUE"] = 16; + values[valuesById[24] = "ALIGN_COUNT_FALSE"] = 24; + values[valuesById[17] = "ALIGN_FRACTION_TRUE"] = 17; + values[valuesById[18] = "ALIGN_PERCENTILE_99"] = 18; + values[valuesById[19] = "ALIGN_PERCENTILE_95"] = 19; + values[valuesById[20] = "ALIGN_PERCENTILE_50"] = 20; + values[valuesById[21] = "ALIGN_PERCENTILE_05"] = 21; + values[valuesById[23] = "ALIGN_PERCENT_CHANGE"] = 23; + return values; + })(); - /** - * Constructs a new Trigger. - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @classdesc Represents a Trigger. - * @implements ITrigger - * @constructor - * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger=} [properties] Properties to set - */ - function Trigger(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Reducer enum. + * @name google.monitoring.v3.Aggregation.Reducer + * @enum {string} + * @property {number} REDUCE_NONE=0 REDUCE_NONE value + * @property {number} REDUCE_MEAN=1 REDUCE_MEAN value + * @property {number} REDUCE_MIN=2 REDUCE_MIN value + * @property {number} REDUCE_MAX=3 REDUCE_MAX value + * @property {number} REDUCE_SUM=4 REDUCE_SUM value + * @property {number} REDUCE_STDDEV=5 REDUCE_STDDEV value + * @property {number} REDUCE_COUNT=6 REDUCE_COUNT value + * @property {number} REDUCE_COUNT_TRUE=7 REDUCE_COUNT_TRUE value + * @property {number} REDUCE_COUNT_FALSE=15 REDUCE_COUNT_FALSE value + * @property {number} REDUCE_FRACTION_TRUE=8 REDUCE_FRACTION_TRUE value + * @property {number} REDUCE_PERCENTILE_99=9 REDUCE_PERCENTILE_99 value + * @property {number} REDUCE_PERCENTILE_95=10 REDUCE_PERCENTILE_95 value + * @property {number} REDUCE_PERCENTILE_50=11 REDUCE_PERCENTILE_50 value + * @property {number} REDUCE_PERCENTILE_05=12 REDUCE_PERCENTILE_05 value + */ + Aggregation.Reducer = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REDUCE_NONE"] = 0; + values[valuesById[1] = "REDUCE_MEAN"] = 1; + values[valuesById[2] = "REDUCE_MIN"] = 2; + values[valuesById[3] = "REDUCE_MAX"] = 3; + values[valuesById[4] = "REDUCE_SUM"] = 4; + values[valuesById[5] = "REDUCE_STDDEV"] = 5; + values[valuesById[6] = "REDUCE_COUNT"] = 6; + values[valuesById[7] = "REDUCE_COUNT_TRUE"] = 7; + values[valuesById[15] = "REDUCE_COUNT_FALSE"] = 15; + values[valuesById[8] = "REDUCE_FRACTION_TRUE"] = 8; + values[valuesById[9] = "REDUCE_PERCENTILE_99"] = 9; + values[valuesById[10] = "REDUCE_PERCENTILE_95"] = 10; + values[valuesById[11] = "REDUCE_PERCENTILE_50"] = 11; + values[valuesById[12] = "REDUCE_PERCENTILE_05"] = 12; + return values; + })(); - /** - * Trigger count. - * @member {number} count - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @instance - */ - Trigger.prototype.count = 0; + return Aggregation; + })(); - /** - * Trigger percent. - * @member {number} percent - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @instance - */ - Trigger.prototype.percent = 0; + /** + * ComparisonType enum. + * @name google.monitoring.v3.ComparisonType + * @enum {string} + * @property {number} COMPARISON_UNSPECIFIED=0 COMPARISON_UNSPECIFIED value + * @property {number} COMPARISON_GT=1 COMPARISON_GT value + * @property {number} COMPARISON_GE=2 COMPARISON_GE value + * @property {number} COMPARISON_LT=3 COMPARISON_LT value + * @property {number} COMPARISON_LE=4 COMPARISON_LE value + * @property {number} COMPARISON_EQ=5 COMPARISON_EQ value + * @property {number} COMPARISON_NE=6 COMPARISON_NE value + */ + v3.ComparisonType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPARISON_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPARISON_GT"] = 1; + values[valuesById[2] = "COMPARISON_GE"] = 2; + values[valuesById[3] = "COMPARISON_LT"] = 3; + values[valuesById[4] = "COMPARISON_LE"] = 4; + values[valuesById[5] = "COMPARISON_EQ"] = 5; + values[valuesById[6] = "COMPARISON_NE"] = 6; + return values; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ServiceTier enum. + * @name google.monitoring.v3.ServiceTier + * @enum {string} + * @property {number} SERVICE_TIER_UNSPECIFIED=0 SERVICE_TIER_UNSPECIFIED value + * @property {number} SERVICE_TIER_BASIC=1 SERVICE_TIER_BASIC value + * @property {number} SERVICE_TIER_PREMIUM=2 SERVICE_TIER_PREMIUM value + */ + v3.ServiceTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVICE_TIER_BASIC"] = 1; + values[valuesById[2] = "SERVICE_TIER_PREMIUM"] = 2; + return values; + })(); - /** - * Trigger type. - * @member {"count"|"percent"|undefined} type - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @instance - */ - Object.defineProperty(Trigger.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["count", "percent"]), - set: $util.oneOfSetter($oneOfFields) - }); + v3.MutationRecord = (function() { - /** - * Creates a new Trigger instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger=} [properties] Properties to set - * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger instance - */ - Trigger.create = function create(properties) { - return new Trigger(properties); - }; + /** + * Properties of a MutationRecord. + * @memberof google.monitoring.v3 + * @interface IMutationRecord + * @property {google.protobuf.ITimestamp|null} [mutateTime] MutationRecord mutateTime + * @property {string|null} [mutatedBy] MutationRecord mutatedBy + */ - /** - * Encodes the specified Trigger message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger} message Trigger message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Trigger.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); - if (message.percent != null && message.hasOwnProperty("percent")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.percent); - return writer; - }; + /** + * Constructs a new MutationRecord. + * @memberof google.monitoring.v3 + * @classdesc Represents a MutationRecord. + * @implements IMutationRecord + * @constructor + * @param {google.monitoring.v3.IMutationRecord=} [properties] Properties to set + */ + function MutationRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Trigger message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.Trigger.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.ITrigger} message Trigger message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Trigger.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * MutationRecord mutateTime. + * @member {google.protobuf.ITimestamp|null|undefined} mutateTime + * @memberof google.monitoring.v3.MutationRecord + * @instance + */ + MutationRecord.prototype.mutateTime = null; - /** - * Decodes a Trigger message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Trigger.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition.Trigger(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.count = reader.int32(); - break; - case 2: - message.percent = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * MutationRecord mutatedBy. + * @member {string} mutatedBy + * @memberof google.monitoring.v3.MutationRecord + * @instance + */ + MutationRecord.prototype.mutatedBy = ""; - /** - * Decodes a Trigger message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Trigger.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new MutationRecord instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {google.monitoring.v3.IMutationRecord=} [properties] Properties to set + * @returns {google.monitoring.v3.MutationRecord} MutationRecord instance + */ + MutationRecord.create = function create(properties) { + return new MutationRecord(properties); + }; - /** - * Verifies a Trigger message. - * @function verify - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Trigger.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.count != null && message.hasOwnProperty("count")) { - properties.type = 1; - if (!$util.isInteger(message.count)) - return "count: integer expected"; - } - if (message.percent != null && message.hasOwnProperty("percent")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - if (typeof message.percent !== "number") - return "percent: number expected"; - } - return null; - }; + /** + * Encodes the specified MutationRecord message. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {google.monitoring.v3.IMutationRecord} message MutationRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mutateTime != null && message.hasOwnProperty("mutateTime")) + $root.google.protobuf.Timestamp.encode(message.mutateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mutatedBy != null && message.hasOwnProperty("mutatedBy")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mutatedBy); + return writer; + }; - /** - * Creates a Trigger message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.AlertPolicy.Condition.Trigger} Trigger - */ - Trigger.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition.Trigger) - return object; - var message = new $root.google.monitoring.v3.AlertPolicy.Condition.Trigger(); - if (object.count != null) - message.count = object.count | 0; - if (object.percent != null) - message.percent = Number(object.percent); - return message; - }; + /** + * Encodes the specified MutationRecord message, length delimited. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {google.monitoring.v3.IMutationRecord} message MutationRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a Trigger message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.Trigger} message Trigger - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Trigger.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.count != null && message.hasOwnProperty("count")) { - object.count = message.count; - if (options.oneofs) - object.type = "count"; - } - if (message.percent != null && message.hasOwnProperty("percent")) { - object.percent = options.json && !isFinite(message.percent) ? String(message.percent) : message.percent; - if (options.oneofs) - object.type = "percent"; - } - return object; - }; + /** + * Decodes a MutationRecord message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.MutationRecord} MutationRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.MutationRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mutateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.mutatedBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this Trigger to JSON. - * @function toJSON - * @memberof google.monitoring.v3.AlertPolicy.Condition.Trigger - * @instance - * @returns {Object.} JSON object - */ - Trigger.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a MutationRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.MutationRecord} MutationRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return Trigger; - })(); + /** + * Verifies a MutationRecord message. + * @function verify + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mutateTime != null && message.hasOwnProperty("mutateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.mutateTime); + if (error) + return "mutateTime." + error; + } + if (message.mutatedBy != null && message.hasOwnProperty("mutatedBy")) + if (!$util.isString(message.mutatedBy)) + return "mutatedBy: string expected"; + return null; + }; - Condition.MetricThreshold = (function() { + /** + * Creates a MutationRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.MutationRecord} MutationRecord + */ + MutationRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.MutationRecord) + return object; + var message = new $root.google.monitoring.v3.MutationRecord(); + if (object.mutateTime != null) { + if (typeof object.mutateTime !== "object") + throw TypeError(".google.monitoring.v3.MutationRecord.mutateTime: object expected"); + message.mutateTime = $root.google.protobuf.Timestamp.fromObject(object.mutateTime); + } + if (object.mutatedBy != null) + message.mutatedBy = String(object.mutatedBy); + return message; + }; - /** - * Properties of a MetricThreshold. - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @interface IMetricThreshold - * @property {string|null} [filter] MetricThreshold filter - * @property {Array.|null} [aggregations] MetricThreshold aggregations - * @property {string|null} [denominatorFilter] MetricThreshold denominatorFilter - * @property {Array.|null} [denominatorAggregations] MetricThreshold denominatorAggregations - * @property {google.monitoring.v3.ComparisonType|null} [comparison] MetricThreshold comparison - * @property {number|null} [thresholdValue] MetricThreshold thresholdValue - * @property {google.protobuf.IDuration|null} [duration] MetricThreshold duration - * @property {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null} [trigger] MetricThreshold trigger - */ + /** + * Creates a plain object from a MutationRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.MutationRecord + * @static + * @param {google.monitoring.v3.MutationRecord} message MutationRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mutateTime = null; + object.mutatedBy = ""; + } + if (message.mutateTime != null && message.hasOwnProperty("mutateTime")) + object.mutateTime = $root.google.protobuf.Timestamp.toObject(message.mutateTime, options); + if (message.mutatedBy != null && message.hasOwnProperty("mutatedBy")) + object.mutatedBy = message.mutatedBy; + return object; + }; - /** - * Constructs a new MetricThreshold. - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @classdesc Represents a MetricThreshold. - * @implements IMetricThreshold - * @constructor - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold=} [properties] Properties to set - */ - function MetricThreshold(properties) { - this.aggregations = []; - this.denominatorAggregations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this MutationRecord to JSON. + * @function toJSON + * @memberof google.monitoring.v3.MutationRecord + * @instance + * @returns {Object.} JSON object + */ + MutationRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MetricThreshold filter. - * @member {string} filter - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.filter = ""; + return MutationRecord; + })(); - /** - * MetricThreshold aggregations. - * @member {Array.} aggregations - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.aggregations = $util.emptyArray; + v3.AlertPolicyService = (function() { - /** - * MetricThreshold denominatorFilter. - * @member {string} denominatorFilter - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.denominatorFilter = ""; + /** + * Constructs a new AlertPolicyService service. + * @memberof google.monitoring.v3 + * @classdesc Represents an AlertPolicyService + * @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 AlertPolicyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * MetricThreshold denominatorAggregations. - * @member {Array.} denominatorAggregations - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.denominatorAggregations = $util.emptyArray; + (AlertPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlertPolicyService; - /** - * MetricThreshold comparison. - * @member {google.monitoring.v3.ComparisonType} comparison - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.comparison = 0; + /** + * Creates new AlertPolicyService service using the specified rpc implementation. + * @function create + * @memberof google.monitoring.v3.AlertPolicyService + * @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 {AlertPolicyService} RPC service. Useful where requests and/or responses are streamed. + */ + AlertPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * MetricThreshold thresholdValue. - * @member {number} thresholdValue - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.thresholdValue = 0; + /** + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#listAlertPolicies}. + * @memberof google.monitoring.v3.AlertPolicyService + * @typedef ListAlertPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListAlertPoliciesResponse} [response] ListAlertPoliciesResponse + */ - /** - * MetricThreshold duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.duration = null; + /** + * Calls ListAlertPolicies. + * @function listAlertPolicies + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IListAlertPoliciesRequest} request ListAlertPoliciesRequest message or plain object + * @param {google.monitoring.v3.AlertPolicyService.ListAlertPoliciesCallback} callback Node-style callback called with the error, if any, and ListAlertPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlertPolicyService.prototype.listAlertPolicies = function listAlertPolicies(request, callback) { + return this.rpcCall(listAlertPolicies, $root.google.monitoring.v3.ListAlertPoliciesRequest, $root.google.monitoring.v3.ListAlertPoliciesResponse, request, callback); + }, "name", { value: "ListAlertPolicies" }); - /** - * MetricThreshold trigger. - * @member {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null|undefined} trigger - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - */ - MetricThreshold.prototype.trigger = null; + /** + * Calls ListAlertPolicies. + * @function listAlertPolicies + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IListAlertPoliciesRequest} request ListAlertPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new MetricThreshold instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold=} [properties] Properties to set - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold instance - */ - MetricThreshold.create = function create(properties) { - return new MetricThreshold(properties); - }; + /** + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#getAlertPolicy}. + * @memberof google.monitoring.v3.AlertPolicyService + * @typedef GetAlertPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.AlertPolicy} [response] AlertPolicy + */ - /** - * Encodes the specified MetricThreshold message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold} message MetricThreshold message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricThreshold.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.comparison != null && message.hasOwnProperty("comparison")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.comparison); - if (message.thresholdValue != null && message.hasOwnProperty("thresholdValue")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.thresholdValue); - if (message.duration != null && message.hasOwnProperty("duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.trigger != null && message.hasOwnProperty("trigger")) - $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.encode(message.trigger, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.aggregations != null && message.aggregations.length) - for (var i = 0; i < message.aggregations.length; ++i) - $root.google.monitoring.v3.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.denominatorFilter != null && message.hasOwnProperty("denominatorFilter")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.denominatorFilter); - if (message.denominatorAggregations != null && message.denominatorAggregations.length) - for (var i = 0; i < message.denominatorAggregations.length; ++i) - $root.google.monitoring.v3.Aggregation.encode(message.denominatorAggregations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; + /** + * Calls GetAlertPolicy. + * @function getAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IGetAlertPolicyRequest} request GetAlertPolicyRequest message or plain object + * @param {google.monitoring.v3.AlertPolicyService.GetAlertPolicyCallback} callback Node-style callback called with the error, if any, and AlertPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlertPolicyService.prototype.getAlertPolicy = function getAlertPolicy(request, callback) { + return this.rpcCall(getAlertPolicy, $root.google.monitoring.v3.GetAlertPolicyRequest, $root.google.monitoring.v3.AlertPolicy, request, callback); + }, "name", { value: "GetAlertPolicy" }); - /** - * Encodes the specified MetricThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricThreshold} message MetricThreshold message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricThreshold.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls GetAlertPolicy. + * @function getAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IGetAlertPolicyRequest} request GetAlertPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a MetricThreshold message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricThreshold.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.filter = reader.string(); - break; - case 8: - if (!(message.aggregations && message.aggregations.length)) - message.aggregations = []; - message.aggregations.push($root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32())); - break; - case 9: - message.denominatorFilter = reader.string(); - break; - case 10: - if (!(message.denominatorAggregations && message.denominatorAggregations.length)) - message.denominatorAggregations = []; - message.denominatorAggregations.push($root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32())); - break; - case 4: - message.comparison = reader.int32(); - break; - case 5: - message.thresholdValue = reader.double(); - break; - case 6: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 7: - message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#createAlertPolicy}. + * @memberof google.monitoring.v3.AlertPolicyService + * @typedef CreateAlertPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.AlertPolicy} [response] AlertPolicy + */ - /** - * Decodes a MetricThreshold message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricThreshold.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls CreateAlertPolicy. + * @function createAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.ICreateAlertPolicyRequest} request CreateAlertPolicyRequest message or plain object + * @param {google.monitoring.v3.AlertPolicyService.CreateAlertPolicyCallback} callback Node-style callback called with the error, if any, and AlertPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlertPolicyService.prototype.createAlertPolicy = function createAlertPolicy(request, callback) { + return this.rpcCall(createAlertPolicy, $root.google.monitoring.v3.CreateAlertPolicyRequest, $root.google.monitoring.v3.AlertPolicy, request, callback); + }, "name", { value: "CreateAlertPolicy" }); - /** - * Verifies a MetricThreshold message. - * @function verify - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricThreshold.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.aggregations != null && message.hasOwnProperty("aggregations")) { - if (!Array.isArray(message.aggregations)) - return "aggregations: array expected"; - for (var i = 0; i < message.aggregations.length; ++i) { - var error = $root.google.monitoring.v3.Aggregation.verify(message.aggregations[i]); - if (error) - return "aggregations." + error; - } - } - if (message.denominatorFilter != null && message.hasOwnProperty("denominatorFilter")) - if (!$util.isString(message.denominatorFilter)) - return "denominatorFilter: string expected"; - if (message.denominatorAggregations != null && message.hasOwnProperty("denominatorAggregations")) { - if (!Array.isArray(message.denominatorAggregations)) - return "denominatorAggregations: array expected"; - for (var i = 0; i < message.denominatorAggregations.length; ++i) { - var error = $root.google.monitoring.v3.Aggregation.verify(message.denominatorAggregations[i]); - if (error) - return "denominatorAggregations." + error; - } - } - if (message.comparison != null && message.hasOwnProperty("comparison")) - switch (message.comparison) { - default: - return "comparison: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.thresholdValue != null && message.hasOwnProperty("thresholdValue")) - if (typeof message.thresholdValue !== "number") - return "thresholdValue: number expected"; - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.trigger != null && message.hasOwnProperty("trigger")) { - var error = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.verify(message.trigger); - if (error) - return "trigger." + error; - } - return null; - }; + /** + * Calls CreateAlertPolicy. + * @function createAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.ICreateAlertPolicyRequest} request CreateAlertPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a MetricThreshold message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} MetricThreshold - */ - MetricThreshold.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold) - return object; - var message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricThreshold(); - if (object.filter != null) - message.filter = String(object.filter); - if (object.aggregations) { - if (!Array.isArray(object.aggregations)) - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.aggregations: array expected"); - message.aggregations = []; - for (var i = 0; i < object.aggregations.length; ++i) { - if (typeof object.aggregations[i] !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.aggregations: object expected"); - message.aggregations[i] = $root.google.monitoring.v3.Aggregation.fromObject(object.aggregations[i]); - } - } - if (object.denominatorFilter != null) - message.denominatorFilter = String(object.denominatorFilter); - if (object.denominatorAggregations) { - if (!Array.isArray(object.denominatorAggregations)) - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.denominatorAggregations: array expected"); - message.denominatorAggregations = []; - for (var i = 0; i < object.denominatorAggregations.length; ++i) { - if (typeof object.denominatorAggregations[i] !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.denominatorAggregations: object expected"); - message.denominatorAggregations[i] = $root.google.monitoring.v3.Aggregation.fromObject(object.denominatorAggregations[i]); - } - } - switch (object.comparison) { - case "COMPARISON_UNSPECIFIED": - case 0: - message.comparison = 0; - break; - case "COMPARISON_GT": - case 1: - message.comparison = 1; - break; - case "COMPARISON_GE": - case 2: - message.comparison = 2; - break; - case "COMPARISON_LT": - case 3: - message.comparison = 3; - break; - case "COMPARISON_LE": - case 4: - message.comparison = 4; - break; - case "COMPARISON_EQ": - case 5: - message.comparison = 5; - break; - case "COMPARISON_NE": - case 6: - message.comparison = 6; - break; - } - if (object.thresholdValue != null) - message.thresholdValue = Number(object.thresholdValue); - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.trigger != null) { - if (typeof object.trigger !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricThreshold.trigger: object expected"); - message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.fromObject(object.trigger); - } - return message; - }; + /** + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#deleteAlertPolicy}. + * @memberof google.monitoring.v3.AlertPolicyService + * @typedef DeleteAlertPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Creates a plain object from a MetricThreshold message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.MetricThreshold} message MetricThreshold - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricThreshold.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.aggregations = []; - object.denominatorAggregations = []; - } - if (options.defaults) { - object.filter = ""; - object.comparison = options.enums === String ? "COMPARISON_UNSPECIFIED" : 0; - object.thresholdValue = 0; - object.duration = null; - object.trigger = null; - object.denominatorFilter = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.comparison != null && message.hasOwnProperty("comparison")) - object.comparison = options.enums === String ? $root.google.monitoring.v3.ComparisonType[message.comparison] : message.comparison; - if (message.thresholdValue != null && message.hasOwnProperty("thresholdValue")) - object.thresholdValue = options.json && !isFinite(message.thresholdValue) ? String(message.thresholdValue) : message.thresholdValue; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.trigger != null && message.hasOwnProperty("trigger")) - object.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.toObject(message.trigger, options); - if (message.aggregations && message.aggregations.length) { - object.aggregations = []; - for (var j = 0; j < message.aggregations.length; ++j) - object.aggregations[j] = $root.google.monitoring.v3.Aggregation.toObject(message.aggregations[j], options); - } - if (message.denominatorFilter != null && message.hasOwnProperty("denominatorFilter")) - object.denominatorFilter = message.denominatorFilter; - if (message.denominatorAggregations && message.denominatorAggregations.length) { - object.denominatorAggregations = []; - for (var j = 0; j < message.denominatorAggregations.length; ++j) - object.denominatorAggregations[j] = $root.google.monitoring.v3.Aggregation.toObject(message.denominatorAggregations[j], options); - } - return object; - }; + /** + * Calls DeleteAlertPolicy. + * @function deleteAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} request DeleteAlertPolicyRequest message or plain object + * @param {google.monitoring.v3.AlertPolicyService.DeleteAlertPolicyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlertPolicyService.prototype.deleteAlertPolicy = function deleteAlertPolicy(request, callback) { + return this.rpcCall(deleteAlertPolicy, $root.google.monitoring.v3.DeleteAlertPolicyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAlertPolicy" }); - /** - * Converts this MetricThreshold to JSON. - * @function toJSON - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricThreshold - * @instance - * @returns {Object.} JSON object - */ - MetricThreshold.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls DeleteAlertPolicy. + * @function deleteAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} request DeleteAlertPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return MetricThreshold; - })(); + /** + * Callback as used by {@link google.monitoring.v3.AlertPolicyService#updateAlertPolicy}. + * @memberof google.monitoring.v3.AlertPolicyService + * @typedef UpdateAlertPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.AlertPolicy} [response] AlertPolicy + */ - Condition.MetricAbsence = (function() { + /** + * Calls UpdateAlertPolicy. + * @function updateAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} request UpdateAlertPolicyRequest message or plain object + * @param {google.monitoring.v3.AlertPolicyService.UpdateAlertPolicyCallback} callback Node-style callback called with the error, if any, and AlertPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AlertPolicyService.prototype.updateAlertPolicy = function updateAlertPolicy(request, callback) { + return this.rpcCall(updateAlertPolicy, $root.google.monitoring.v3.UpdateAlertPolicyRequest, $root.google.monitoring.v3.AlertPolicy, request, callback); + }, "name", { value: "UpdateAlertPolicy" }); - /** - * Properties of a MetricAbsence. - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @interface IMetricAbsence - * @property {string|null} [filter] MetricAbsence filter - * @property {Array.|null} [aggregations] MetricAbsence aggregations - * @property {google.protobuf.IDuration|null} [duration] MetricAbsence duration - * @property {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null} [trigger] MetricAbsence trigger - */ + /** + * Calls UpdateAlertPolicy. + * @function updateAlertPolicy + * @memberof google.monitoring.v3.AlertPolicyService + * @instance + * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} request UpdateAlertPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new MetricAbsence. - * @memberof google.monitoring.v3.AlertPolicy.Condition - * @classdesc Represents a MetricAbsence. - * @implements IMetricAbsence - * @constructor - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence=} [properties] Properties to set - */ - function MetricAbsence(properties) { - this.aggregations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return AlertPolicyService; + })(); - /** - * MetricAbsence filter. - * @member {string} filter - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @instance - */ - MetricAbsence.prototype.filter = ""; + v3.CreateAlertPolicyRequest = (function() { - /** - * MetricAbsence aggregations. - * @member {Array.} aggregations - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @instance - */ - MetricAbsence.prototype.aggregations = $util.emptyArray; + /** + * Properties of a CreateAlertPolicyRequest. + * @memberof google.monitoring.v3 + * @interface ICreateAlertPolicyRequest + * @property {string|null} [name] CreateAlertPolicyRequest name + * @property {google.monitoring.v3.IAlertPolicy|null} [alertPolicy] CreateAlertPolicyRequest alertPolicy + */ - /** - * MetricAbsence duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @instance - */ - MetricAbsence.prototype.duration = null; + /** + * Constructs a new CreateAlertPolicyRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a CreateAlertPolicyRequest. + * @implements ICreateAlertPolicyRequest + * @constructor + * @param {google.monitoring.v3.ICreateAlertPolicyRequest=} [properties] Properties to set + */ + function CreateAlertPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * MetricAbsence trigger. - * @member {google.monitoring.v3.AlertPolicy.Condition.ITrigger|null|undefined} trigger - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @instance - */ - MetricAbsence.prototype.trigger = null; + /** + * CreateAlertPolicyRequest name. + * @member {string} name + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @instance + */ + CreateAlertPolicyRequest.prototype.name = ""; - /** - * Creates a new MetricAbsence instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence=} [properties] Properties to set - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence instance - */ - MetricAbsence.create = function create(properties) { - return new MetricAbsence(properties); - }; + /** + * CreateAlertPolicyRequest alertPolicy. + * @member {google.monitoring.v3.IAlertPolicy|null|undefined} alertPolicy + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @instance + */ + CreateAlertPolicyRequest.prototype.alertPolicy = null; - /** - * Encodes the specified MetricAbsence message. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence} message MetricAbsence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricAbsence.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.duration != null && message.hasOwnProperty("duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.trigger != null && message.hasOwnProperty("trigger")) - $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.encode(message.trigger, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.aggregations != null && message.aggregations.length) - for (var i = 0; i < message.aggregations.length; ++i) - $root.google.monitoring.v3.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Creates a new CreateAlertPolicyRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {google.monitoring.v3.ICreateAlertPolicyRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest instance + */ + CreateAlertPolicyRequest.create = function create(properties) { + return new CreateAlertPolicyRequest(properties); + }; - /** - * Encodes the specified MetricAbsence message, length delimited. Does not implicitly {@link google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.IMetricAbsence} message MetricAbsence message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricAbsence.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetricAbsence message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricAbsence.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.filter = reader.string(); - break; - case 5: - if (!(message.aggregations && message.aggregations.length)) - message.aggregations = []; - message.aggregations.push($root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32())); - break; - case 2: - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 3: - message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetricAbsence message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricAbsence.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetricAbsence message. - * @function verify - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricAbsence.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.aggregations != null && message.hasOwnProperty("aggregations")) { - if (!Array.isArray(message.aggregations)) - return "aggregations: array expected"; - for (var i = 0; i < message.aggregations.length; ++i) { - var error = $root.google.monitoring.v3.Aggregation.verify(message.aggregations[i]); - if (error) - return "aggregations." + error; - } - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.trigger != null && message.hasOwnProperty("trigger")) { - var error = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.verify(message.trigger); - if (error) - return "trigger." + error; - } - return null; - }; - - /** - * Creates a MetricAbsence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} MetricAbsence - */ - MetricAbsence.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence) - return object; - var message = new $root.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence(); - if (object.filter != null) - message.filter = String(object.filter); - if (object.aggregations) { - if (!Array.isArray(object.aggregations)) - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.aggregations: array expected"); - message.aggregations = []; - for (var i = 0; i < object.aggregations.length; ++i) { - if (typeof object.aggregations[i] !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.aggregations: object expected"); - message.aggregations[i] = $root.google.monitoring.v3.Aggregation.fromObject(object.aggregations[i]); - } - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.trigger != null) { - if (typeof object.trigger !== "object") - throw TypeError(".google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.trigger: object expected"); - message.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.fromObject(object.trigger); - } - return message; - }; - - /** - * Creates a plain object from a MetricAbsence message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @static - * @param {google.monitoring.v3.AlertPolicy.Condition.MetricAbsence} message MetricAbsence - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricAbsence.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.aggregations = []; - if (options.defaults) { - object.filter = ""; - object.duration = null; - object.trigger = null; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.trigger != null && message.hasOwnProperty("trigger")) - object.trigger = $root.google.monitoring.v3.AlertPolicy.Condition.Trigger.toObject(message.trigger, options); - if (message.aggregations && message.aggregations.length) { - object.aggregations = []; - for (var j = 0; j < message.aggregations.length; ++j) - object.aggregations[j] = $root.google.monitoring.v3.Aggregation.toObject(message.aggregations[j], options); - } - return object; - }; - - /** - * Converts this MetricAbsence to JSON. - * @function toJSON - * @memberof google.monitoring.v3.AlertPolicy.Condition.MetricAbsence - * @instance - * @returns {Object.} JSON object - */ - MetricAbsence.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MetricAbsence; - })(); - - return Condition; - })(); + /** + * Encodes the specified CreateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {google.monitoring.v3.ICreateAlertPolicyRequest} message CreateAlertPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAlertPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) + $root.google.monitoring.v3.AlertPolicy.encode(message.alertPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; /** - * ConditionCombinerType enum. - * @name google.monitoring.v3.AlertPolicy.ConditionCombinerType - * @enum {string} - * @property {number} COMBINE_UNSPECIFIED=0 COMBINE_UNSPECIFIED value - * @property {number} AND=1 AND value - * @property {number} OR=2 OR value - * @property {number} AND_WITH_MATCHING_RESOURCE=3 AND_WITH_MATCHING_RESOURCE value + * Encodes the specified CreateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateAlertPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {google.monitoring.v3.ICreateAlertPolicyRequest} message CreateAlertPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - AlertPolicy.ConditionCombinerType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMBINE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AND"] = 1; - values[valuesById[2] = "OR"] = 2; - values[valuesById[3] = "AND_WITH_MATCHING_RESOURCE"] = 3; - return values; - })(); - - return AlertPolicy; - })(); - - v3.TypedValue = (function() { + CreateAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Properties of a TypedValue. - * @memberof google.monitoring.v3 - * @interface ITypedValue - * @property {boolean|null} [boolValue] TypedValue boolValue - * @property {number|Long|null} [int64Value] TypedValue int64Value - * @property {number|null} [doubleValue] TypedValue doubleValue - * @property {string|null} [stringValue] TypedValue stringValue - * @property {google.api.IDistribution|null} [distributionValue] TypedValue distributionValue + * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateAlertPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateAlertPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.name = reader.string(); + break; + case 2: + message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Constructs a new TypedValue. - * @memberof google.monitoring.v3 - * @classdesc Represents a TypedValue. - * @implements ITypedValue - * @constructor - * @param {google.monitoring.v3.ITypedValue=} [properties] Properties to set + * Decodes a CreateAlertPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - function TypedValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + CreateAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * TypedValue boolValue. - * @member {boolean} boolValue - * @memberof google.monitoring.v3.TypedValue - * @instance + * Verifies a CreateAlertPolicyRequest message. + * @function verify + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TypedValue.prototype.boolValue = false; + CreateAlertPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) { + var error = $root.google.monitoring.v3.AlertPolicy.verify(message.alertPolicy); + if (error) + return "alertPolicy." + error; + } + return null; + }; /** - * TypedValue int64Value. - * @member {number|Long} int64Value - * @memberof google.monitoring.v3.TypedValue - * @instance + * Creates a CreateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.CreateAlertPolicyRequest} CreateAlertPolicyRequest */ - TypedValue.prototype.int64Value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CreateAlertPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateAlertPolicyRequest) + return object; + var message = new $root.google.monitoring.v3.CreateAlertPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.alertPolicy != null) { + if (typeof object.alertPolicy !== "object") + throw TypeError(".google.monitoring.v3.CreateAlertPolicyRequest.alertPolicy: object expected"); + message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.fromObject(object.alertPolicy); + } + return message; + }; /** - * TypedValue doubleValue. - * @member {number} doubleValue - * @memberof google.monitoring.v3.TypedValue - * @instance + * Creates a plain object from a CreateAlertPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.CreateAlertPolicyRequest + * @static + * @param {google.monitoring.v3.CreateAlertPolicyRequest} message CreateAlertPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - TypedValue.prototype.doubleValue = 0; + CreateAlertPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.alertPolicy = null; + object.name = ""; + } + if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) + object.alertPolicy = $root.google.monitoring.v3.AlertPolicy.toObject(message.alertPolicy, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; /** - * TypedValue stringValue. - * @member {string} stringValue - * @memberof google.monitoring.v3.TypedValue + * Converts this CreateAlertPolicyRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.CreateAlertPolicyRequest * @instance + * @returns {Object.} JSON object */ - TypedValue.prototype.stringValue = ""; + CreateAlertPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateAlertPolicyRequest; + })(); + + v3.GetAlertPolicyRequest = (function() { /** - * TypedValue distributionValue. - * @member {google.api.IDistribution|null|undefined} distributionValue - * @memberof google.monitoring.v3.TypedValue - * @instance + * Properties of a GetAlertPolicyRequest. + * @memberof google.monitoring.v3 + * @interface IGetAlertPolicyRequest + * @property {string|null} [name] GetAlertPolicyRequest name */ - TypedValue.prototype.distributionValue = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Constructs a new GetAlertPolicyRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a GetAlertPolicyRequest. + * @implements IGetAlertPolicyRequest + * @constructor + * @param {google.monitoring.v3.IGetAlertPolicyRequest=} [properties] Properties to set + */ + function GetAlertPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * TypedValue value. - * @member {"boolValue"|"int64Value"|"doubleValue"|"stringValue"|"distributionValue"|undefined} value - * @memberof google.monitoring.v3.TypedValue + * GetAlertPolicyRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @instance */ - Object.defineProperty(TypedValue.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["boolValue", "int64Value", "doubleValue", "stringValue", "distributionValue"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetAlertPolicyRequest.prototype.name = ""; /** - * Creates a new TypedValue instance using the specified properties. + * Creates a new GetAlertPolicyRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static - * @param {google.monitoring.v3.ITypedValue=} [properties] Properties to set - * @returns {google.monitoring.v3.TypedValue} TypedValue instance + * @param {google.monitoring.v3.IGetAlertPolicyRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest instance */ - TypedValue.create = function create(properties) { - return new TypedValue(properties); + GetAlertPolicyRequest.create = function create(properties) { + return new GetAlertPolicyRequest(properties); }; /** - * Encodes the specified TypedValue message. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. + * Encodes the specified GetAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static - * @param {google.monitoring.v3.ITypedValue} message TypedValue message or plain object to encode + * @param {google.monitoring.v3.IGetAlertPolicyRequest} message GetAlertPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TypedValue.encode = function encode(message, writer) { + GetAlertPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.boolValue != null && message.hasOwnProperty("boolValue")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.boolValue); - if (message.int64Value != null && message.hasOwnProperty("int64Value")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.int64Value); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.stringValue); - if (message.distributionValue != null && message.hasOwnProperty("distributionValue")) - $root.google.api.Distribution.encode(message.distributionValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified TypedValue message, length delimited. Does not implicitly {@link google.monitoring.v3.TypedValue.verify|verify} messages. + * Encodes the specified GetAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetAlertPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static - * @param {google.monitoring.v3.ITypedValue} message TypedValue message or plain object to encode + * @param {google.monitoring.v3.IGetAlertPolicyRequest} message GetAlertPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TypedValue.encodeDelimited = function encodeDelimited(message, writer) { + GetAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TypedValue message from the specified reader or buffer. + * Decodes a GetAlertPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.TypedValue} TypedValue + * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TypedValue.decode = function decode(reader, length) { + GetAlertPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TypedValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetAlertPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.boolValue = reader.bool(); - break; - case 2: - message.int64Value = reader.int64(); - break; case 3: - message.doubleValue = reader.double(); - break; - case 4: - message.stringValue = reader.string(); - break; - case 5: - message.distributionValue = $root.google.api.Distribution.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -3736,184 +3906,111 @@ }; /** - * Decodes a TypedValue message from the specified reader or buffer, length delimited. + * Decodes a GetAlertPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.TypedValue} TypedValue + * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TypedValue.decodeDelimited = function decodeDelimited(reader) { + GetAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TypedValue message. + * Verifies a GetAlertPolicyRequest message. * @function verify - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TypedValue.verify = function verify(message) { + GetAlertPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - properties.value = 1; - if (typeof message.boolValue !== "boolean") - return "boolValue: boolean expected"; - } - if (message.int64Value != null && message.hasOwnProperty("int64Value")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.int64Value) && !(message.int64Value && $util.isInteger(message.int64Value.low) && $util.isInteger(message.int64Value.high))) - return "int64Value: integer|Long expected"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - if (!$util.isString(message.stringValue)) - return "stringValue: string expected"; - } - if (message.distributionValue != null && message.hasOwnProperty("distributionValue")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.api.Distribution.verify(message.distributionValue); - if (error) - return "distributionValue." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TypedValue message from a plain object. Also converts values to their respective internal types. + * Creates a GetAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.TypedValue} TypedValue + * @returns {google.monitoring.v3.GetAlertPolicyRequest} GetAlertPolicyRequest */ - TypedValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.TypedValue) + GetAlertPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetAlertPolicyRequest) return object; - var message = new $root.google.monitoring.v3.TypedValue(); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.int64Value != null) - if ($util.Long) - (message.int64Value = $util.Long.fromValue(object.int64Value)).unsigned = false; - else if (typeof object.int64Value === "string") - message.int64Value = parseInt(object.int64Value, 10); - else if (typeof object.int64Value === "number") - message.int64Value = object.int64Value; - else if (typeof object.int64Value === "object") - message.int64Value = new $util.LongBits(object.int64Value.low >>> 0, object.int64Value.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.distributionValue != null) { - if (typeof object.distributionValue !== "object") - throw TypeError(".google.monitoring.v3.TypedValue.distributionValue: object expected"); - message.distributionValue = $root.google.api.Distribution.fromObject(object.distributionValue); - } + var message = new $root.google.monitoring.v3.GetAlertPolicyRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TypedValue message. Also converts values to other types if specified. + * Creates a plain object from a GetAlertPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @static - * @param {google.monitoring.v3.TypedValue} message TypedValue + * @param {google.monitoring.v3.GetAlertPolicyRequest} message GetAlertPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TypedValue.toObject = function toObject(message, options) { + GetAlertPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.value = "boolValue"; - } - if (message.int64Value != null && message.hasOwnProperty("int64Value")) { - if (typeof message.int64Value === "number") - object.int64Value = options.longs === String ? String(message.int64Value) : message.int64Value; - else - object.int64Value = options.longs === String ? $util.Long.prototype.toString.call(message.int64Value) : options.longs === Number ? new $util.LongBits(message.int64Value.low >>> 0, message.int64Value.high >>> 0).toNumber() : message.int64Value; - if (options.oneofs) - object.value = "int64Value"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (options.oneofs) - object.value = "doubleValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.value = "stringValue"; - } - if (message.distributionValue != null && message.hasOwnProperty("distributionValue")) { - object.distributionValue = $root.google.api.Distribution.toObject(message.distributionValue, options); - if (options.oneofs) - object.value = "distributionValue"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TypedValue to JSON. + * Converts this GetAlertPolicyRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.TypedValue + * @memberof google.monitoring.v3.GetAlertPolicyRequest * @instance * @returns {Object.} JSON object */ - TypedValue.prototype.toJSON = function toJSON() { + GetAlertPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TypedValue; + return GetAlertPolicyRequest; })(); - v3.TimeInterval = (function() { + v3.ListAlertPoliciesRequest = (function() { /** - * Properties of a TimeInterval. + * Properties of a ListAlertPoliciesRequest. * @memberof google.monitoring.v3 - * @interface ITimeInterval - * @property {google.protobuf.ITimestamp|null} [endTime] TimeInterval endTime - * @property {google.protobuf.ITimestamp|null} [startTime] TimeInterval startTime + * @interface IListAlertPoliciesRequest + * @property {string|null} [name] ListAlertPoliciesRequest name + * @property {string|null} [filter] ListAlertPoliciesRequest filter + * @property {string|null} [orderBy] ListAlertPoliciesRequest orderBy + * @property {number|null} [pageSize] ListAlertPoliciesRequest pageSize + * @property {string|null} [pageToken] ListAlertPoliciesRequest pageToken */ /** - * Constructs a new TimeInterval. + * Constructs a new ListAlertPoliciesRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a TimeInterval. - * @implements ITimeInterval + * @classdesc Represents a ListAlertPoliciesRequest. + * @implements IListAlertPoliciesRequest * @constructor - * @param {google.monitoring.v3.ITimeInterval=} [properties] Properties to set + * @param {google.monitoring.v3.IListAlertPoliciesRequest=} [properties] Properties to set */ - function TimeInterval(properties) { + function ListAlertPoliciesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3921,88 +4018,127 @@ } /** - * TimeInterval endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.monitoring.v3.TimeInterval + * ListAlertPoliciesRequest name. + * @member {string} name + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @instance */ - TimeInterval.prototype.endTime = null; + ListAlertPoliciesRequest.prototype.name = ""; /** - * TimeInterval startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.monitoring.v3.TimeInterval + * ListAlertPoliciesRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @instance */ - TimeInterval.prototype.startTime = null; + ListAlertPoliciesRequest.prototype.filter = ""; /** - * Creates a new TimeInterval instance using the specified properties. + * ListAlertPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.monitoring.v3.ListAlertPoliciesRequest + * @instance + */ + ListAlertPoliciesRequest.prototype.orderBy = ""; + + /** + * ListAlertPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListAlertPoliciesRequest + * @instance + */ + ListAlertPoliciesRequest.prototype.pageSize = 0; + + /** + * ListAlertPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListAlertPoliciesRequest + * @instance + */ + ListAlertPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAlertPoliciesRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static - * @param {google.monitoring.v3.ITimeInterval=} [properties] Properties to set - * @returns {google.monitoring.v3.TimeInterval} TimeInterval instance + * @param {google.monitoring.v3.IListAlertPoliciesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest instance */ - TimeInterval.create = function create(properties) { - return new TimeInterval(properties); + ListAlertPoliciesRequest.create = function create(properties) { + return new ListAlertPoliciesRequest(properties); }; /** - * Encodes the specified TimeInterval message. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. + * Encodes the specified ListAlertPoliciesRequest message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static - * @param {google.monitoring.v3.ITimeInterval} message TimeInterval message or plain object to encode + * @param {google.monitoring.v3.IListAlertPoliciesRequest} message ListAlertPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInterval.encode = function encode(message, writer) { + ListAlertPoliciesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && message.hasOwnProperty("endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); return writer; }; /** - * Encodes the specified TimeInterval message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeInterval.verify|verify} messages. + * Encodes the specified ListAlertPoliciesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static - * @param {google.monitoring.v3.ITimeInterval} message TimeInterval message or plain object to encode + * @param {google.monitoring.v3.IListAlertPoliciesRequest} message ListAlertPoliciesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeInterval.encodeDelimited = function encodeDelimited(message, writer) { + ListAlertPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeInterval message from the specified reader or buffer. + * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.TimeInterval} TimeInterval + * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInterval.decode = function decode(reader, length) { + ListAlertPoliciesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeInterval(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListAlertPoliciesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.orderBy = reader.string(); + break; case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; - case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4013,130 +4149,142 @@ }; /** - * Decodes a TimeInterval message from the specified reader or buffer, length delimited. + * Decodes a ListAlertPoliciesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.TimeInterval} TimeInterval + * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeInterval.decodeDelimited = function decodeDelimited(reader) { + ListAlertPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeInterval message. + * Verifies a ListAlertPoliciesRequest message. * @function verify - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeInterval.verify = function verify(message) { + ListAlertPoliciesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a TimeInterval message from a plain object. Also converts values to their respective internal types. + * Creates a ListAlertPoliciesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.TimeInterval} TimeInterval + * @returns {google.monitoring.v3.ListAlertPoliciesRequest} ListAlertPoliciesRequest */ - TimeInterval.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.TimeInterval) + ListAlertPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListAlertPoliciesRequest) return object; - var message = new $root.google.monitoring.v3.TimeInterval(); - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.monitoring.v3.TimeInterval.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.monitoring.v3.TimeInterval.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } + var message = new $root.google.monitoring.v3.ListAlertPoliciesRequest(); + if (object.name != null) + message.name = String(object.name); + 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 TimeInterval message. Also converts values to other types if specified. + * Creates a plain object from a ListAlertPoliciesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @static - * @param {google.monitoring.v3.TimeInterval} message TimeInterval + * @param {google.monitoring.v3.ListAlertPoliciesRequest} message ListAlertPoliciesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeInterval.toObject = function toObject(message, options) { + ListAlertPoliciesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startTime = null; - object.endTime = null; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this TimeInterval to JSON. + * Converts this ListAlertPoliciesRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.TimeInterval + * @memberof google.monitoring.v3.ListAlertPoliciesRequest * @instance * @returns {Object.} JSON object */ - TimeInterval.prototype.toJSON = function toJSON() { + ListAlertPoliciesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeInterval; + return ListAlertPoliciesRequest; })(); - v3.Aggregation = (function() { + v3.ListAlertPoliciesResponse = (function() { /** - * Properties of an Aggregation. + * Properties of a ListAlertPoliciesResponse. * @memberof google.monitoring.v3 - * @interface IAggregation - * @property {google.protobuf.IDuration|null} [alignmentPeriod] Aggregation alignmentPeriod - * @property {google.monitoring.v3.Aggregation.Aligner|null} [perSeriesAligner] Aggregation perSeriesAligner - * @property {google.monitoring.v3.Aggregation.Reducer|null} [crossSeriesReducer] Aggregation crossSeriesReducer - * @property {Array.|null} [groupByFields] Aggregation groupByFields + * @interface IListAlertPoliciesResponse + * @property {Array.|null} [alertPolicies] ListAlertPoliciesResponse alertPolicies + * @property {string|null} [nextPageToken] ListAlertPoliciesResponse nextPageToken */ /** - * Constructs a new Aggregation. + * Constructs a new ListAlertPoliciesResponse. * @memberof google.monitoring.v3 - * @classdesc Represents an Aggregation. - * @implements IAggregation + * @classdesc Represents a ListAlertPoliciesResponse. + * @implements IListAlertPoliciesResponse * @constructor - * @param {google.monitoring.v3.IAggregation=} [properties] Properties to set + * @param {google.monitoring.v3.IListAlertPoliciesResponse=} [properties] Properties to set */ - function Aggregation(properties) { - this.groupByFields = []; + function ListAlertPoliciesResponse(properties) { + this.alertPolicies = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4144,117 +4292,91 @@ } /** - * Aggregation alignmentPeriod. - * @member {google.protobuf.IDuration|null|undefined} alignmentPeriod - * @memberof google.monitoring.v3.Aggregation - * @instance - */ - Aggregation.prototype.alignmentPeriod = null; - - /** - * Aggregation perSeriesAligner. - * @member {google.monitoring.v3.Aggregation.Aligner} perSeriesAligner - * @memberof google.monitoring.v3.Aggregation - * @instance - */ - Aggregation.prototype.perSeriesAligner = 0; - - /** - * Aggregation crossSeriesReducer. - * @member {google.monitoring.v3.Aggregation.Reducer} crossSeriesReducer - * @memberof google.monitoring.v3.Aggregation + * ListAlertPoliciesResponse alertPolicies. + * @member {Array.} alertPolicies + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @instance */ - Aggregation.prototype.crossSeriesReducer = 0; + ListAlertPoliciesResponse.prototype.alertPolicies = $util.emptyArray; /** - * Aggregation groupByFields. - * @member {Array.} groupByFields - * @memberof google.monitoring.v3.Aggregation + * ListAlertPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @instance */ - Aggregation.prototype.groupByFields = $util.emptyArray; + ListAlertPoliciesResponse.prototype.nextPageToken = ""; /** - * Creates a new Aggregation instance using the specified properties. + * Creates a new ListAlertPoliciesResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static - * @param {google.monitoring.v3.IAggregation=} [properties] Properties to set - * @returns {google.monitoring.v3.Aggregation} Aggregation instance + * @param {google.monitoring.v3.IListAlertPoliciesResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse instance */ - Aggregation.create = function create(properties) { - return new Aggregation(properties); + ListAlertPoliciesResponse.create = function create(properties) { + return new ListAlertPoliciesResponse(properties); }; /** - * Encodes the specified Aggregation message. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. + * Encodes the specified ListAlertPoliciesResponse message. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static - * @param {google.monitoring.v3.IAggregation} message Aggregation message or plain object to encode + * @param {google.monitoring.v3.IListAlertPoliciesResponse} message ListAlertPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Aggregation.encode = function encode(message, writer) { + ListAlertPoliciesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) - $root.google.protobuf.Duration.encode(message.alignmentPeriod, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.perSeriesAligner); - if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.crossSeriesReducer); - if (message.groupByFields != null && message.groupByFields.length) - for (var i = 0; i < message.groupByFields.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.groupByFields[i]); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.alertPolicies != null && message.alertPolicies.length) + for (var i = 0; i < message.alertPolicies.length; ++i) + $root.google.monitoring.v3.AlertPolicy.encode(message.alertPolicies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.monitoring.v3.Aggregation.verify|verify} messages. + * Encodes the specified ListAlertPoliciesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListAlertPoliciesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static - * @param {google.monitoring.v3.IAggregation} message Aggregation message or plain object to encode + * @param {google.monitoring.v3.IListAlertPoliciesResponse} message ListAlertPoliciesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + ListAlertPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Aggregation message from the specified reader or buffer. + * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Aggregation} Aggregation + * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Aggregation.decode = function decode(reader, length) { + ListAlertPoliciesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Aggregation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListAlertPoliciesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.alignmentPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + case 3: + if (!(message.alertPolicies && message.alertPolicies.length)) + message.alertPolicies = []; + message.alertPolicies.push($root.google.monitoring.v3.AlertPolicy.decode(reader, reader.uint32())); break; case 2: - message.perSeriesAligner = reader.int32(); - break; - case 4: - message.crossSeriesReducer = reader.int32(); - break; - case 5: - if (!(message.groupByFields && message.groupByFields.length)) - message.groupByFields = []; - message.groupByFields.push(reader.string()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4265,448 +4387,134 @@ }; /** - * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * Decodes a ListAlertPoliciesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Aggregation} Aggregation + * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Aggregation.decodeDelimited = function decodeDelimited(reader) { + ListAlertPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Aggregation message. + * Verifies a ListAlertPoliciesResponse message. * @function verify - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Aggregation.verify = function verify(message) { + ListAlertPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.alignmentPeriod); - if (error) - return "alignmentPeriod." + error; - } - if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) - switch (message.perSeriesAligner) { - default: - return "perSeriesAligner: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 24: - case 17: - case 18: - case 19: - case 20: - case 21: - case 23: - break; + if (message.alertPolicies != null && message.hasOwnProperty("alertPolicies")) { + if (!Array.isArray(message.alertPolicies)) + return "alertPolicies: array expected"; + for (var i = 0; i < message.alertPolicies.length; ++i) { + var error = $root.google.monitoring.v3.AlertPolicy.verify(message.alertPolicies[i]); + if (error) + return "alertPolicies." + error; } - if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) - switch (message.crossSeriesReducer) { - default: - return "crossSeriesReducer: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 15: - case 8: - case 9: - case 10: - case 11: - case 12: - break; - } - if (message.groupByFields != null && message.hasOwnProperty("groupByFields")) { - if (!Array.isArray(message.groupByFields)) - return "groupByFields: array expected"; - for (var i = 0; i < message.groupByFields.length; ++i) - if (!$util.isString(message.groupByFields[i])) - return "groupByFields: string[] expected"; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * Creates a ListAlertPoliciesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Aggregation} Aggregation + * @returns {google.monitoring.v3.ListAlertPoliciesResponse} ListAlertPoliciesResponse */ - Aggregation.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Aggregation) + ListAlertPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListAlertPoliciesResponse) return object; - var message = new $root.google.monitoring.v3.Aggregation(); - if (object.alignmentPeriod != null) { - if (typeof object.alignmentPeriod !== "object") - throw TypeError(".google.monitoring.v3.Aggregation.alignmentPeriod: object expected"); - message.alignmentPeriod = $root.google.protobuf.Duration.fromObject(object.alignmentPeriod); - } - switch (object.perSeriesAligner) { - case "ALIGN_NONE": - case 0: - message.perSeriesAligner = 0; - break; - case "ALIGN_DELTA": - case 1: - message.perSeriesAligner = 1; - break; - case "ALIGN_RATE": - case 2: - message.perSeriesAligner = 2; - break; - case "ALIGN_INTERPOLATE": - case 3: - message.perSeriesAligner = 3; - break; - case "ALIGN_NEXT_OLDER": - case 4: - message.perSeriesAligner = 4; - break; - case "ALIGN_MIN": - case 10: - message.perSeriesAligner = 10; - break; - case "ALIGN_MAX": - case 11: - message.perSeriesAligner = 11; - break; - case "ALIGN_MEAN": - case 12: - message.perSeriesAligner = 12; - break; - case "ALIGN_COUNT": - case 13: - message.perSeriesAligner = 13; - break; - case "ALIGN_SUM": - case 14: - message.perSeriesAligner = 14; - break; - case "ALIGN_STDDEV": - case 15: - message.perSeriesAligner = 15; - break; - case "ALIGN_COUNT_TRUE": - case 16: - message.perSeriesAligner = 16; - break; - case "ALIGN_COUNT_FALSE": - case 24: - message.perSeriesAligner = 24; - break; - case "ALIGN_FRACTION_TRUE": - case 17: - message.perSeriesAligner = 17; - break; - case "ALIGN_PERCENTILE_99": - case 18: - message.perSeriesAligner = 18; - break; - case "ALIGN_PERCENTILE_95": - case 19: - message.perSeriesAligner = 19; - break; - case "ALIGN_PERCENTILE_50": - case 20: - message.perSeriesAligner = 20; - break; - case "ALIGN_PERCENTILE_05": - case 21: - message.perSeriesAligner = 21; - break; - case "ALIGN_PERCENT_CHANGE": - case 23: - message.perSeriesAligner = 23; - break; - } - switch (object.crossSeriesReducer) { - case "REDUCE_NONE": - case 0: - message.crossSeriesReducer = 0; - break; - case "REDUCE_MEAN": - case 1: - message.crossSeriesReducer = 1; - break; - case "REDUCE_MIN": - case 2: - message.crossSeriesReducer = 2; - break; - case "REDUCE_MAX": - case 3: - message.crossSeriesReducer = 3; - break; - case "REDUCE_SUM": - case 4: - message.crossSeriesReducer = 4; - break; - case "REDUCE_STDDEV": - case 5: - message.crossSeriesReducer = 5; - break; - case "REDUCE_COUNT": - case 6: - message.crossSeriesReducer = 6; - break; - case "REDUCE_COUNT_TRUE": - case 7: - message.crossSeriesReducer = 7; - break; - case "REDUCE_COUNT_FALSE": - case 15: - message.crossSeriesReducer = 15; - break; - case "REDUCE_FRACTION_TRUE": - case 8: - message.crossSeriesReducer = 8; - break; - case "REDUCE_PERCENTILE_99": - case 9: - message.crossSeriesReducer = 9; - break; - case "REDUCE_PERCENTILE_95": - case 10: - message.crossSeriesReducer = 10; - break; - case "REDUCE_PERCENTILE_50": - case 11: - message.crossSeriesReducer = 11; - break; - case "REDUCE_PERCENTILE_05": - case 12: - message.crossSeriesReducer = 12; - break; - } - if (object.groupByFields) { - if (!Array.isArray(object.groupByFields)) - throw TypeError(".google.monitoring.v3.Aggregation.groupByFields: array expected"); - message.groupByFields = []; - for (var i = 0; i < object.groupByFields.length; ++i) - message.groupByFields[i] = String(object.groupByFields[i]); + var message = new $root.google.monitoring.v3.ListAlertPoliciesResponse(); + if (object.alertPolicies) { + if (!Array.isArray(object.alertPolicies)) + throw TypeError(".google.monitoring.v3.ListAlertPoliciesResponse.alertPolicies: array expected"); + message.alertPolicies = []; + for (var i = 0; i < object.alertPolicies.length; ++i) { + if (typeof object.alertPolicies[i] !== "object") + throw TypeError(".google.monitoring.v3.ListAlertPoliciesResponse.alertPolicies: object expected"); + message.alertPolicies[i] = $root.google.monitoring.v3.AlertPolicy.fromObject(object.alertPolicies[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * Creates a plain object from a ListAlertPoliciesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @static - * @param {google.monitoring.v3.Aggregation} message Aggregation + * @param {google.monitoring.v3.ListAlertPoliciesResponse} message ListAlertPoliciesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Aggregation.toObject = function toObject(message, options) { + ListAlertPoliciesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.groupByFields = []; - if (options.defaults) { - object.alignmentPeriod = null; - object.perSeriesAligner = options.enums === String ? "ALIGN_NONE" : 0; - object.crossSeriesReducer = options.enums === String ? "REDUCE_NONE" : 0; - } - if (message.alignmentPeriod != null && message.hasOwnProperty("alignmentPeriod")) - object.alignmentPeriod = $root.google.protobuf.Duration.toObject(message.alignmentPeriod, options); - if (message.perSeriesAligner != null && message.hasOwnProperty("perSeriesAligner")) - object.perSeriesAligner = options.enums === String ? $root.google.monitoring.v3.Aggregation.Aligner[message.perSeriesAligner] : message.perSeriesAligner; - if (message.crossSeriesReducer != null && message.hasOwnProperty("crossSeriesReducer")) - object.crossSeriesReducer = options.enums === String ? $root.google.monitoring.v3.Aggregation.Reducer[message.crossSeriesReducer] : message.crossSeriesReducer; - if (message.groupByFields && message.groupByFields.length) { - object.groupByFields = []; - for (var j = 0; j < message.groupByFields.length; ++j) - object.groupByFields[j] = message.groupByFields[j]; + object.alertPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.alertPolicies && message.alertPolicies.length) { + object.alertPolicies = []; + for (var j = 0; j < message.alertPolicies.length; ++j) + object.alertPolicies[j] = $root.google.monitoring.v3.AlertPolicy.toObject(message.alertPolicies[j], options); } return object; }; /** - * Converts this Aggregation to JSON. + * Converts this ListAlertPoliciesResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.Aggregation + * @memberof google.monitoring.v3.ListAlertPoliciesResponse * @instance * @returns {Object.} JSON object */ - Aggregation.prototype.toJSON = function toJSON() { + ListAlertPoliciesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Aligner enum. - * @name google.monitoring.v3.Aggregation.Aligner - * @enum {string} - * @property {number} ALIGN_NONE=0 ALIGN_NONE value - * @property {number} ALIGN_DELTA=1 ALIGN_DELTA value - * @property {number} ALIGN_RATE=2 ALIGN_RATE value - * @property {number} ALIGN_INTERPOLATE=3 ALIGN_INTERPOLATE value - * @property {number} ALIGN_NEXT_OLDER=4 ALIGN_NEXT_OLDER value - * @property {number} ALIGN_MIN=10 ALIGN_MIN value - * @property {number} ALIGN_MAX=11 ALIGN_MAX value - * @property {number} ALIGN_MEAN=12 ALIGN_MEAN value - * @property {number} ALIGN_COUNT=13 ALIGN_COUNT value - * @property {number} ALIGN_SUM=14 ALIGN_SUM value - * @property {number} ALIGN_STDDEV=15 ALIGN_STDDEV value - * @property {number} ALIGN_COUNT_TRUE=16 ALIGN_COUNT_TRUE value - * @property {number} ALIGN_COUNT_FALSE=24 ALIGN_COUNT_FALSE value - * @property {number} ALIGN_FRACTION_TRUE=17 ALIGN_FRACTION_TRUE value - * @property {number} ALIGN_PERCENTILE_99=18 ALIGN_PERCENTILE_99 value - * @property {number} ALIGN_PERCENTILE_95=19 ALIGN_PERCENTILE_95 value - * @property {number} ALIGN_PERCENTILE_50=20 ALIGN_PERCENTILE_50 value - * @property {number} ALIGN_PERCENTILE_05=21 ALIGN_PERCENTILE_05 value - * @property {number} ALIGN_PERCENT_CHANGE=23 ALIGN_PERCENT_CHANGE value - */ - Aggregation.Aligner = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ALIGN_NONE"] = 0; - values[valuesById[1] = "ALIGN_DELTA"] = 1; - values[valuesById[2] = "ALIGN_RATE"] = 2; - values[valuesById[3] = "ALIGN_INTERPOLATE"] = 3; - values[valuesById[4] = "ALIGN_NEXT_OLDER"] = 4; - values[valuesById[10] = "ALIGN_MIN"] = 10; - values[valuesById[11] = "ALIGN_MAX"] = 11; - values[valuesById[12] = "ALIGN_MEAN"] = 12; - values[valuesById[13] = "ALIGN_COUNT"] = 13; - values[valuesById[14] = "ALIGN_SUM"] = 14; - values[valuesById[15] = "ALIGN_STDDEV"] = 15; - values[valuesById[16] = "ALIGN_COUNT_TRUE"] = 16; - values[valuesById[24] = "ALIGN_COUNT_FALSE"] = 24; - values[valuesById[17] = "ALIGN_FRACTION_TRUE"] = 17; - values[valuesById[18] = "ALIGN_PERCENTILE_99"] = 18; - values[valuesById[19] = "ALIGN_PERCENTILE_95"] = 19; - values[valuesById[20] = "ALIGN_PERCENTILE_50"] = 20; - values[valuesById[21] = "ALIGN_PERCENTILE_05"] = 21; - values[valuesById[23] = "ALIGN_PERCENT_CHANGE"] = 23; - return values; - })(); - - /** - * Reducer enum. - * @name google.monitoring.v3.Aggregation.Reducer - * @enum {string} - * @property {number} REDUCE_NONE=0 REDUCE_NONE value - * @property {number} REDUCE_MEAN=1 REDUCE_MEAN value - * @property {number} REDUCE_MIN=2 REDUCE_MIN value - * @property {number} REDUCE_MAX=3 REDUCE_MAX value - * @property {number} REDUCE_SUM=4 REDUCE_SUM value - * @property {number} REDUCE_STDDEV=5 REDUCE_STDDEV value - * @property {number} REDUCE_COUNT=6 REDUCE_COUNT value - * @property {number} REDUCE_COUNT_TRUE=7 REDUCE_COUNT_TRUE value - * @property {number} REDUCE_COUNT_FALSE=15 REDUCE_COUNT_FALSE value - * @property {number} REDUCE_FRACTION_TRUE=8 REDUCE_FRACTION_TRUE value - * @property {number} REDUCE_PERCENTILE_99=9 REDUCE_PERCENTILE_99 value - * @property {number} REDUCE_PERCENTILE_95=10 REDUCE_PERCENTILE_95 value - * @property {number} REDUCE_PERCENTILE_50=11 REDUCE_PERCENTILE_50 value - * @property {number} REDUCE_PERCENTILE_05=12 REDUCE_PERCENTILE_05 value - */ - Aggregation.Reducer = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REDUCE_NONE"] = 0; - values[valuesById[1] = "REDUCE_MEAN"] = 1; - values[valuesById[2] = "REDUCE_MIN"] = 2; - values[valuesById[3] = "REDUCE_MAX"] = 3; - values[valuesById[4] = "REDUCE_SUM"] = 4; - values[valuesById[5] = "REDUCE_STDDEV"] = 5; - values[valuesById[6] = "REDUCE_COUNT"] = 6; - values[valuesById[7] = "REDUCE_COUNT_TRUE"] = 7; - values[valuesById[15] = "REDUCE_COUNT_FALSE"] = 15; - values[valuesById[8] = "REDUCE_FRACTION_TRUE"] = 8; - values[valuesById[9] = "REDUCE_PERCENTILE_99"] = 9; - values[valuesById[10] = "REDUCE_PERCENTILE_95"] = 10; - values[valuesById[11] = "REDUCE_PERCENTILE_50"] = 11; - values[valuesById[12] = "REDUCE_PERCENTILE_05"] = 12; - return values; - })(); - - return Aggregation; - })(); - - /** - * ComparisonType enum. - * @name google.monitoring.v3.ComparisonType - * @enum {string} - * @property {number} COMPARISON_UNSPECIFIED=0 COMPARISON_UNSPECIFIED value - * @property {number} COMPARISON_GT=1 COMPARISON_GT value - * @property {number} COMPARISON_GE=2 COMPARISON_GE value - * @property {number} COMPARISON_LT=3 COMPARISON_LT value - * @property {number} COMPARISON_LE=4 COMPARISON_LE value - * @property {number} COMPARISON_EQ=5 COMPARISON_EQ value - * @property {number} COMPARISON_NE=6 COMPARISON_NE value - */ - v3.ComparisonType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPARISON_UNSPECIFIED"] = 0; - values[valuesById[1] = "COMPARISON_GT"] = 1; - values[valuesById[2] = "COMPARISON_GE"] = 2; - values[valuesById[3] = "COMPARISON_LT"] = 3; - values[valuesById[4] = "COMPARISON_LE"] = 4; - values[valuesById[5] = "COMPARISON_EQ"] = 5; - values[valuesById[6] = "COMPARISON_NE"] = 6; - return values; - })(); - - /** - * ServiceTier enum. - * @name google.monitoring.v3.ServiceTier - * @enum {string} - * @property {number} SERVICE_TIER_UNSPECIFIED=0 SERVICE_TIER_UNSPECIFIED value - * @property {number} SERVICE_TIER_BASIC=1 SERVICE_TIER_BASIC value - * @property {number} SERVICE_TIER_PREMIUM=2 SERVICE_TIER_PREMIUM value - */ - v3.ServiceTier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SERVICE_TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERVICE_TIER_BASIC"] = 1; - values[valuesById[2] = "SERVICE_TIER_PREMIUM"] = 2; - return values; + return ListAlertPoliciesResponse; })(); - v3.MutationRecord = (function() { + v3.UpdateAlertPolicyRequest = (function() { /** - * Properties of a MutationRecord. + * Properties of an UpdateAlertPolicyRequest. * @memberof google.monitoring.v3 - * @interface IMutationRecord - * @property {google.protobuf.ITimestamp|null} [mutateTime] MutationRecord mutateTime - * @property {string|null} [mutatedBy] MutationRecord mutatedBy + * @interface IUpdateAlertPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAlertPolicyRequest updateMask + * @property {google.monitoring.v3.IAlertPolicy|null} [alertPolicy] UpdateAlertPolicyRequest alertPolicy */ /** - * Constructs a new MutationRecord. + * Constructs a new UpdateAlertPolicyRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a MutationRecord. - * @implements IMutationRecord + * @classdesc Represents an UpdateAlertPolicyRequest. + * @implements IUpdateAlertPolicyRequest * @constructor - * @param {google.monitoring.v3.IMutationRecord=} [properties] Properties to set + * @param {google.monitoring.v3.IUpdateAlertPolicyRequest=} [properties] Properties to set */ - function MutationRecord(properties) { + function UpdateAlertPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4714,88 +4522,88 @@ } /** - * MutationRecord mutateTime. - * @member {google.protobuf.ITimestamp|null|undefined} mutateTime - * @memberof google.monitoring.v3.MutationRecord + * UpdateAlertPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @instance */ - MutationRecord.prototype.mutateTime = null; + UpdateAlertPolicyRequest.prototype.updateMask = null; /** - * MutationRecord mutatedBy. - * @member {string} mutatedBy - * @memberof google.monitoring.v3.MutationRecord + * UpdateAlertPolicyRequest alertPolicy. + * @member {google.monitoring.v3.IAlertPolicy|null|undefined} alertPolicy + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @instance */ - MutationRecord.prototype.mutatedBy = ""; + UpdateAlertPolicyRequest.prototype.alertPolicy = null; /** - * Creates a new MutationRecord instance using the specified properties. + * Creates a new UpdateAlertPolicyRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static - * @param {google.monitoring.v3.IMutationRecord=} [properties] Properties to set - * @returns {google.monitoring.v3.MutationRecord} MutationRecord instance + * @param {google.monitoring.v3.IUpdateAlertPolicyRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest instance */ - MutationRecord.create = function create(properties) { - return new MutationRecord(properties); + UpdateAlertPolicyRequest.create = function create(properties) { + return new UpdateAlertPolicyRequest(properties); }; /** - * Encodes the specified MutationRecord message. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. + * Encodes the specified UpdateAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static - * @param {google.monitoring.v3.IMutationRecord} message MutationRecord message or plain object to encode + * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} message UpdateAlertPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MutationRecord.encode = function encode(message, writer) { + UpdateAlertPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mutateTime != null && message.hasOwnProperty("mutateTime")) - $root.google.protobuf.Timestamp.encode(message.mutateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.mutatedBy != null && message.hasOwnProperty("mutatedBy")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mutatedBy); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) + $root.google.monitoring.v3.AlertPolicy.encode(message.alertPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified MutationRecord message, length delimited. Does not implicitly {@link google.monitoring.v3.MutationRecord.verify|verify} messages. + * Encodes the specified UpdateAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateAlertPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static - * @param {google.monitoring.v3.IMutationRecord} message MutationRecord message or plain object to encode + * @param {google.monitoring.v3.IUpdateAlertPolicyRequest} message UpdateAlertPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MutationRecord.encodeDelimited = function encodeDelimited(message, writer) { + UpdateAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MutationRecord message from the specified reader or buffer. + * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.MutationRecord} MutationRecord + * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MutationRecord.decode = function decode(reader, length) { + UpdateAlertPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.MutationRecord(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateAlertPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.mutateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; case 2: - message.mutatedBy = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4806,359 +4614,126 @@ }; /** - * Decodes a MutationRecord message from the specified reader or buffer, length delimited. + * Decodes an UpdateAlertPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.MutationRecord} MutationRecord + * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MutationRecord.decodeDelimited = function decodeDelimited(reader) { + UpdateAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MutationRecord message. + * Verifies an UpdateAlertPolicyRequest message. * @function verify - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MutationRecord.verify = function verify(message) { + UpdateAlertPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mutateTime != null && message.hasOwnProperty("mutateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.mutateTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "mutateTime." + error; + return "updateMask." + error; + } + if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) { + var error = $root.google.monitoring.v3.AlertPolicy.verify(message.alertPolicy); + if (error) + return "alertPolicy." + error; } - if (message.mutatedBy != null && message.hasOwnProperty("mutatedBy")) - if (!$util.isString(message.mutatedBy)) - return "mutatedBy: string expected"; return null; }; /** - * Creates a MutationRecord message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.MutationRecord} MutationRecord + * @returns {google.monitoring.v3.UpdateAlertPolicyRequest} UpdateAlertPolicyRequest */ - MutationRecord.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.MutationRecord) + UpdateAlertPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateAlertPolicyRequest) return object; - var message = new $root.google.monitoring.v3.MutationRecord(); - if (object.mutateTime != null) { - if (typeof object.mutateTime !== "object") - throw TypeError(".google.monitoring.v3.MutationRecord.mutateTime: object expected"); - message.mutateTime = $root.google.protobuf.Timestamp.fromObject(object.mutateTime); + var message = new $root.google.monitoring.v3.UpdateAlertPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.monitoring.v3.UpdateAlertPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.alertPolicy != null) { + if (typeof object.alertPolicy !== "object") + throw TypeError(".google.monitoring.v3.UpdateAlertPolicyRequest.alertPolicy: object expected"); + message.alertPolicy = $root.google.monitoring.v3.AlertPolicy.fromObject(object.alertPolicy); } - if (object.mutatedBy != null) - message.mutatedBy = String(object.mutatedBy); return message; }; /** - * Creates a plain object from a MutationRecord message. Also converts values to other types if specified. + * Creates a plain object from an UpdateAlertPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @static - * @param {google.monitoring.v3.MutationRecord} message MutationRecord + * @param {google.monitoring.v3.UpdateAlertPolicyRequest} message UpdateAlertPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MutationRecord.toObject = function toObject(message, options) { + UpdateAlertPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.mutateTime = null; - object.mutatedBy = ""; + object.updateMask = null; + object.alertPolicy = null; } - if (message.mutateTime != null && message.hasOwnProperty("mutateTime")) - object.mutateTime = $root.google.protobuf.Timestamp.toObject(message.mutateTime, options); - if (message.mutatedBy != null && message.hasOwnProperty("mutatedBy")) - object.mutatedBy = message.mutatedBy; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.alertPolicy != null && message.hasOwnProperty("alertPolicy")) + object.alertPolicy = $root.google.monitoring.v3.AlertPolicy.toObject(message.alertPolicy, options); return object; }; /** - * Converts this MutationRecord to JSON. + * Converts this UpdateAlertPolicyRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.MutationRecord + * @memberof google.monitoring.v3.UpdateAlertPolicyRequest * @instance * @returns {Object.} JSON object */ - MutationRecord.prototype.toJSON = function toJSON() { + UpdateAlertPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MutationRecord; - })(); - - v3.GroupService = (function() { - - /** - * Constructs a new GroupService service. - * @memberof google.monitoring.v3 - * @classdesc Represents a GroupService - * @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 GroupService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (GroupService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GroupService; - - /** - * Creates new GroupService service using the specified rpc implementation. - * @function create - * @memberof google.monitoring.v3.GroupService - * @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 {GroupService} RPC service. Useful where requests and/or responses are streamed. - */ - GroupService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.monitoring.v3.GroupService#listGroups}. - * @memberof google.monitoring.v3.GroupService - * @typedef ListGroupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListGroupsResponse} [response] ListGroupsResponse - */ - - /** - * Calls ListGroups. - * @function listGroups - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IListGroupsRequest} request ListGroupsRequest message or plain object - * @param {google.monitoring.v3.GroupService.ListGroupsCallback} callback Node-style callback called with the error, if any, and ListGroupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(GroupService.prototype.listGroups = function listGroups(request, callback) { - return this.rpcCall(listGroups, $root.google.monitoring.v3.ListGroupsRequest, $root.google.monitoring.v3.ListGroupsResponse, request, callback); - }, "name", { value: "ListGroups" }); - - /** - * Calls ListGroups. - * @function listGroups - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IListGroupsRequest} request ListGroupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.GroupService#getGroup}. - * @memberof google.monitoring.v3.GroupService - * @typedef GetGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.Group} [response] Group - */ - - /** - * Calls GetGroup. - * @function getGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IGetGroupRequest} request GetGroupRequest message or plain object - * @param {google.monitoring.v3.GroupService.GetGroupCallback} callback Node-style callback called with the error, if any, and Group - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(GroupService.prototype.getGroup = function getGroup(request, callback) { - return this.rpcCall(getGroup, $root.google.monitoring.v3.GetGroupRequest, $root.google.monitoring.v3.Group, request, callback); - }, "name", { value: "GetGroup" }); - - /** - * Calls GetGroup. - * @function getGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IGetGroupRequest} request GetGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.GroupService#createGroup}. - * @memberof google.monitoring.v3.GroupService - * @typedef CreateGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.Group} [response] Group - */ - - /** - * Calls CreateGroup. - * @function createGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.ICreateGroupRequest} request CreateGroupRequest message or plain object - * @param {google.monitoring.v3.GroupService.CreateGroupCallback} callback Node-style callback called with the error, if any, and Group - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(GroupService.prototype.createGroup = function createGroup(request, callback) { - return this.rpcCall(createGroup, $root.google.monitoring.v3.CreateGroupRequest, $root.google.monitoring.v3.Group, request, callback); - }, "name", { value: "CreateGroup" }); - - /** - * Calls CreateGroup. - * @function createGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.ICreateGroupRequest} request CreateGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.GroupService#updateGroup}. - * @memberof google.monitoring.v3.GroupService - * @typedef UpdateGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.Group} [response] Group - */ - - /** - * Calls UpdateGroup. - * @function updateGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IUpdateGroupRequest} request UpdateGroupRequest message or plain object - * @param {google.monitoring.v3.GroupService.UpdateGroupCallback} callback Node-style callback called with the error, if any, and Group - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(GroupService.prototype.updateGroup = function updateGroup(request, callback) { - return this.rpcCall(updateGroup, $root.google.monitoring.v3.UpdateGroupRequest, $root.google.monitoring.v3.Group, request, callback); - }, "name", { value: "UpdateGroup" }); - - /** - * Calls UpdateGroup. - * @function updateGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IUpdateGroupRequest} request UpdateGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.GroupService#deleteGroup}. - * @memberof google.monitoring.v3.GroupService - * @typedef DeleteGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteGroup. - * @function deleteGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IDeleteGroupRequest} request DeleteGroupRequest message or plain object - * @param {google.monitoring.v3.GroupService.DeleteGroupCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(GroupService.prototype.deleteGroup = function deleteGroup(request, callback) { - return this.rpcCall(deleteGroup, $root.google.monitoring.v3.DeleteGroupRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteGroup" }); - - /** - * Calls DeleteGroup. - * @function deleteGroup - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IDeleteGroupRequest} request DeleteGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.GroupService#listGroupMembers}. - * @memberof google.monitoring.v3.GroupService - * @typedef ListGroupMembersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListGroupMembersResponse} [response] ListGroupMembersResponse - */ - - /** - * Calls ListGroupMembers. - * @function listGroupMembers - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IListGroupMembersRequest} request ListGroupMembersRequest message or plain object - * @param {google.monitoring.v3.GroupService.ListGroupMembersCallback} callback Node-style callback called with the error, if any, and ListGroupMembersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(GroupService.prototype.listGroupMembers = function listGroupMembers(request, callback) { - return this.rpcCall(listGroupMembers, $root.google.monitoring.v3.ListGroupMembersRequest, $root.google.monitoring.v3.ListGroupMembersResponse, request, callback); - }, "name", { value: "ListGroupMembers" }); - - /** - * Calls ListGroupMembers. - * @function listGroupMembers - * @memberof google.monitoring.v3.GroupService - * @instance - * @param {google.monitoring.v3.IListGroupMembersRequest} request ListGroupMembersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return GroupService; + return UpdateAlertPolicyRequest; })(); - v3.ListGroupsRequest = (function() { + v3.DeleteAlertPolicyRequest = (function() { /** - * Properties of a ListGroupsRequest. + * Properties of a DeleteAlertPolicyRequest. * @memberof google.monitoring.v3 - * @interface IListGroupsRequest - * @property {string|null} [name] ListGroupsRequest name - * @property {string|null} [childrenOfGroup] ListGroupsRequest childrenOfGroup - * @property {string|null} [ancestorsOfGroup] ListGroupsRequest ancestorsOfGroup - * @property {string|null} [descendantsOfGroup] ListGroupsRequest descendantsOfGroup - * @property {number|null} [pageSize] ListGroupsRequest pageSize - * @property {string|null} [pageToken] ListGroupsRequest pageToken + * @interface IDeleteAlertPolicyRequest + * @property {string|null} [name] DeleteAlertPolicyRequest name */ /** - * Constructs a new ListGroupsRequest. + * Constructs a new DeleteAlertPolicyRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListGroupsRequest. - * @implements IListGroupsRequest + * @classdesc Represents a DeleteAlertPolicyRequest. + * @implements IDeleteAlertPolicyRequest * @constructor - * @param {google.monitoring.v3.IListGroupsRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IDeleteAlertPolicyRequest=} [properties] Properties to set */ - function ListGroupsRequest(properties) { + function DeleteAlertPolicyRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5166,154 +4741,75 @@ } /** - * ListGroupsRequest name. + * DeleteAlertPolicyRequest name. * @member {string} name - * @memberof google.monitoring.v3.ListGroupsRequest - * @instance - */ - ListGroupsRequest.prototype.name = ""; - - /** - * ListGroupsRequest childrenOfGroup. - * @member {string} childrenOfGroup - * @memberof google.monitoring.v3.ListGroupsRequest - * @instance - */ - ListGroupsRequest.prototype.childrenOfGroup = ""; - - /** - * ListGroupsRequest ancestorsOfGroup. - * @member {string} ancestorsOfGroup - * @memberof google.monitoring.v3.ListGroupsRequest - * @instance - */ - ListGroupsRequest.prototype.ancestorsOfGroup = ""; - - /** - * ListGroupsRequest descendantsOfGroup. - * @member {string} descendantsOfGroup - * @memberof google.monitoring.v3.ListGroupsRequest - * @instance - */ - ListGroupsRequest.prototype.descendantsOfGroup = ""; - - /** - * ListGroupsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListGroupsRequest - * @instance - */ - ListGroupsRequest.prototype.pageSize = 0; - - /** - * ListGroupsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListGroupsRequest - * @instance - */ - ListGroupsRequest.prototype.pageToken = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ListGroupsRequest filter. - * @member {"childrenOfGroup"|"ancestorsOfGroup"|"descendantsOfGroup"|undefined} filter - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @instance */ - Object.defineProperty(ListGroupsRequest.prototype, "filter", { - get: $util.oneOfGetter($oneOfFields = ["childrenOfGroup", "ancestorsOfGroup", "descendantsOfGroup"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteAlertPolicyRequest.prototype.name = ""; /** - * Creates a new ListGroupsRequest instance using the specified properties. + * Creates a new DeleteAlertPolicyRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static - * @param {google.monitoring.v3.IListGroupsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest instance + * @param {google.monitoring.v3.IDeleteAlertPolicyRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest instance */ - ListGroupsRequest.create = function create(properties) { - return new ListGroupsRequest(properties); + DeleteAlertPolicyRequest.create = function create(properties) { + return new DeleteAlertPolicyRequest(properties); }; /** - * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. + * Encodes the specified DeleteAlertPolicyRequest message. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static - * @param {google.monitoring.v3.IListGroupsRequest} message ListGroupsRequest message or plain object to encode + * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} message DeleteAlertPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupsRequest.encode = function encode(message, writer) { + DeleteAlertPolicyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.childrenOfGroup != null && message.hasOwnProperty("childrenOfGroup")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childrenOfGroup); - if (message.ancestorsOfGroup != null && message.hasOwnProperty("ancestorsOfGroup")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestorsOfGroup); - if (message.descendantsOfGroup != null && message.hasOwnProperty("descendantsOfGroup")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.descendantsOfGroup); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. + * Encodes the specified DeleteAlertPolicyRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteAlertPolicyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static - * @param {google.monitoring.v3.IListGroupsRequest} message ListGroupsRequest message or plain object to encode + * @param {google.monitoring.v3.IDeleteAlertPolicyRequest} message DeleteAlertPolicyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteAlertPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGroupsRequest message from the specified reader or buffer. + * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest + * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupsRequest.decode = function decode(reader, length) { + DeleteAlertPolicyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteAlertPolicyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 7: - message.name = reader.string(); - break; - case 2: - message.childrenOfGroup = reader.string(); - break; case 3: - message.ancestorsOfGroup = reader.string(); - break; - case 4: - message.descendantsOfGroup = reader.string(); - break; - case 5: - message.pageSize = reader.int32(); - break; - case 6: - message.pageToken = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -5324,167 +4820,108 @@ }; /** - * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteAlertPolicyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest + * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteAlertPolicyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGroupsRequest message. + * Verifies a DeleteAlertPolicyRequest message. * @function verify - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGroupsRequest.verify = function verify(message) { + DeleteAlertPolicyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.childrenOfGroup != null && message.hasOwnProperty("childrenOfGroup")) { - properties.filter = 1; - if (!$util.isString(message.childrenOfGroup)) - return "childrenOfGroup: string expected"; - } - if (message.ancestorsOfGroup != null && message.hasOwnProperty("ancestorsOfGroup")) { - if (properties.filter === 1) - return "filter: multiple values"; - properties.filter = 1; - if (!$util.isString(message.ancestorsOfGroup)) - return "ancestorsOfGroup: string expected"; - } - if (message.descendantsOfGroup != null && message.hasOwnProperty("descendantsOfGroup")) { - if (properties.filter === 1) - return "filter: multiple values"; - properties.filter = 1; - if (!$util.isString(message.descendantsOfGroup)) - return "descendantsOfGroup: string expected"; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; return null; }; /** - * Creates a ListGroupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAlertPolicyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest + * @returns {google.monitoring.v3.DeleteAlertPolicyRequest} DeleteAlertPolicyRequest */ - ListGroupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListGroupsRequest) + DeleteAlertPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteAlertPolicyRequest) return object; - var message = new $root.google.monitoring.v3.ListGroupsRequest(); + var message = new $root.google.monitoring.v3.DeleteAlertPolicyRequest(); if (object.name != null) message.name = String(object.name); - if (object.childrenOfGroup != null) - message.childrenOfGroup = String(object.childrenOfGroup); - if (object.ancestorsOfGroup != null) - message.ancestorsOfGroup = String(object.ancestorsOfGroup); - if (object.descendantsOfGroup != null) - message.descendantsOfGroup = String(object.descendantsOfGroup); - 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 ListGroupsRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteAlertPolicyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @static - * @param {google.monitoring.v3.ListGroupsRequest} message ListGroupsRequest + * @param {google.monitoring.v3.DeleteAlertPolicyRequest} message DeleteAlertPolicyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGroupsRequest.toObject = function toObject(message, options) { + DeleteAlertPolicyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; + if (options.defaults) object.name = ""; - } - if (message.childrenOfGroup != null && message.hasOwnProperty("childrenOfGroup")) { - object.childrenOfGroup = message.childrenOfGroup; - if (options.oneofs) - object.filter = "childrenOfGroup"; - } - if (message.ancestorsOfGroup != null && message.hasOwnProperty("ancestorsOfGroup")) { - object.ancestorsOfGroup = message.ancestorsOfGroup; - if (options.oneofs) - object.filter = "ancestorsOfGroup"; - } - if (message.descendantsOfGroup != null && message.hasOwnProperty("descendantsOfGroup")) { - object.descendantsOfGroup = message.descendantsOfGroup; - if (options.oneofs) - object.filter = "descendantsOfGroup"; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** - * Converts this ListGroupsRequest to JSON. + * Converts this DeleteAlertPolicyRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListGroupsRequest + * @memberof google.monitoring.v3.DeleteAlertPolicyRequest * @instance * @returns {Object.} JSON object */ - ListGroupsRequest.prototype.toJSON = function toJSON() { + DeleteAlertPolicyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGroupsRequest; + return DeleteAlertPolicyRequest; })(); - v3.ListGroupsResponse = (function() { + v3.DroppedLabels = (function() { /** - * Properties of a ListGroupsResponse. + * Properties of a DroppedLabels. * @memberof google.monitoring.v3 - * @interface IListGroupsResponse - * @property {Array.|null} [group] ListGroupsResponse group - * @property {string|null} [nextPageToken] ListGroupsResponse nextPageToken + * @interface IDroppedLabels + * @property {Object.|null} [label] DroppedLabels label */ /** - * Constructs a new ListGroupsResponse. + * Constructs a new DroppedLabels. * @memberof google.monitoring.v3 - * @classdesc Represents a ListGroupsResponse. - * @implements IListGroupsResponse + * @classdesc Represents a DroppedLabels. + * @implements IDroppedLabels * @constructor - * @param {google.monitoring.v3.IListGroupsResponse=} [properties] Properties to set + * @param {google.monitoring.v3.IDroppedLabels=} [properties] Properties to set */ - function ListGroupsResponse(properties) { - this.group = []; + function DroppedLabels(properties) { + this.label = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5492,91 +4929,81 @@ } /** - * ListGroupsResponse group. - * @member {Array.} group - * @memberof google.monitoring.v3.ListGroupsResponse + * DroppedLabels label. + * @member {Object.} label + * @memberof google.monitoring.v3.DroppedLabels * @instance */ - ListGroupsResponse.prototype.group = $util.emptyArray; - - /** - * ListGroupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListGroupsResponse - * @instance - */ - ListGroupsResponse.prototype.nextPageToken = ""; + DroppedLabels.prototype.label = $util.emptyObject; /** - * Creates a new ListGroupsResponse instance using the specified properties. + * Creates a new DroppedLabels instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static - * @param {google.monitoring.v3.IListGroupsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse instance + * @param {google.monitoring.v3.IDroppedLabels=} [properties] Properties to set + * @returns {google.monitoring.v3.DroppedLabels} DroppedLabels instance */ - ListGroupsResponse.create = function create(properties) { - return new ListGroupsResponse(properties); + DroppedLabels.create = function create(properties) { + return new DroppedLabels(properties); }; /** - * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. + * Encodes the specified DroppedLabels message. Does not implicitly {@link google.monitoring.v3.DroppedLabels.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static - * @param {google.monitoring.v3.IListGroupsResponse} message ListGroupsResponse message or plain object to encode + * @param {google.monitoring.v3.IDroppedLabels} message DroppedLabels message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupsResponse.encode = function encode(message, writer) { + DroppedLabels.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.group != null && message.group.length) - for (var i = 0; i < message.group.length; ++i) - $root.google.monitoring.v3.Group.encode(message.group[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.label != null && message.hasOwnProperty("label")) + for (var keys = Object.keys(message.label), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.label[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. + * Encodes the specified DroppedLabels message, length delimited. Does not implicitly {@link google.monitoring.v3.DroppedLabels.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static - * @param {google.monitoring.v3.IListGroupsResponse} message ListGroupsResponse message or plain object to encode + * @param {google.monitoring.v3.IDroppedLabels} message DroppedLabels message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + DroppedLabels.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGroupsResponse message from the specified reader or buffer. + * Decodes a DroppedLabels message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse + * @returns {google.monitoring.v3.DroppedLabels} DroppedLabels * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupsResponse.decode = function decode(reader, length) { + DroppedLabels.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DroppedLabels(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.group && message.group.length)) - message.group = []; - message.group.push($root.google.monitoring.v3.Group.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + reader.skip().pos++; + if (message.label === $util.emptyObject) + message.label = {}; + key = reader.string(); + reader.pos++; + message.label[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -5587,133 +5014,125 @@ }; /** - * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. + * Decodes a DroppedLabels message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse + * @returns {google.monitoring.v3.DroppedLabels} DroppedLabels * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + DroppedLabels.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGroupsResponse message. + * Verifies a DroppedLabels message. * @function verify - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGroupsResponse.verify = function verify(message) { + DroppedLabels.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.group != null && message.hasOwnProperty("group")) { - if (!Array.isArray(message.group)) - return "group: array expected"; - for (var i = 0; i < message.group.length; ++i) { - var error = $root.google.monitoring.v3.Group.verify(message.group[i]); - if (error) - return "group." + error; - } + if (message.label != null && message.hasOwnProperty("label")) { + if (!$util.isObject(message.label)) + return "label: object expected"; + var key = Object.keys(message.label); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.label[key[i]])) + return "label: string{k:string} expected"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListGroupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DroppedLabels message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse + * @returns {google.monitoring.v3.DroppedLabels} DroppedLabels */ - ListGroupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListGroupsResponse) + DroppedLabels.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DroppedLabels) return object; - var message = new $root.google.monitoring.v3.ListGroupsResponse(); - if (object.group) { - if (!Array.isArray(object.group)) - throw TypeError(".google.monitoring.v3.ListGroupsResponse.group: array expected"); - message.group = []; - for (var i = 0; i < object.group.length; ++i) { - if (typeof object.group[i] !== "object") - throw TypeError(".google.monitoring.v3.ListGroupsResponse.group: object expected"); - message.group[i] = $root.google.monitoring.v3.Group.fromObject(object.group[i]); - } + var message = new $root.google.monitoring.v3.DroppedLabels(); + if (object.label) { + if (typeof object.label !== "object") + throw TypeError(".google.monitoring.v3.DroppedLabels.label: object expected"); + message.label = {}; + for (var keys = Object.keys(object.label), i = 0; i < keys.length; ++i) + message.label[keys[i]] = String(object.label[keys[i]]); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. + * Creates a plain object from a DroppedLabels message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @static - * @param {google.monitoring.v3.ListGroupsResponse} message ListGroupsResponse + * @param {google.monitoring.v3.DroppedLabels} message DroppedLabels * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGroupsResponse.toObject = function toObject(message, options) { + DroppedLabels.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.group = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.group && message.group.length) { - object.group = []; - for (var j = 0; j < message.group.length; ++j) - object.group[j] = $root.google.monitoring.v3.Group.toObject(message.group[j], options); + if (options.objects || options.defaults) + object.label = {}; + var keys2; + if (message.label && (keys2 = Object.keys(message.label)).length) { + object.label = {}; + for (var j = 0; j < keys2.length; ++j) + object.label[keys2[j]] = message.label[keys2[j]]; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListGroupsResponse to JSON. + * Converts this DroppedLabels to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListGroupsResponse + * @memberof google.monitoring.v3.DroppedLabels * @instance * @returns {Object.} JSON object */ - ListGroupsResponse.prototype.toJSON = function toJSON() { + DroppedLabels.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGroupsResponse; + return DroppedLabels; })(); - v3.GetGroupRequest = (function() { + v3.Group = (function() { /** - * Properties of a GetGroupRequest. + * Properties of a Group. * @memberof google.monitoring.v3 - * @interface IGetGroupRequest - * @property {string|null} [name] GetGroupRequest name + * @interface IGroup + * @property {string|null} [name] Group name + * @property {string|null} [displayName] Group displayName + * @property {string|null} [parentName] Group parentName + * @property {string|null} [filter] Group filter + * @property {boolean|null} [isCluster] Group isCluster */ /** - * Constructs a new GetGroupRequest. + * Constructs a new Group. * @memberof google.monitoring.v3 - * @classdesc Represents a GetGroupRequest. - * @implements IGetGroupRequest + * @classdesc Represents a Group. + * @implements IGroup * @constructor - * @param {google.monitoring.v3.IGetGroupRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IGroup=} [properties] Properties to set */ - function GetGroupRequest(properties) { + function Group(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5721,76 +5140,128 @@ } /** - * GetGroupRequest name. + * Group name. * @member {string} name - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @instance */ - GetGroupRequest.prototype.name = ""; + Group.prototype.name = ""; /** - * Creates a new GetGroupRequest instance using the specified properties. + * Group displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.Group + * @instance + */ + Group.prototype.displayName = ""; + + /** + * Group parentName. + * @member {string} parentName + * @memberof google.monitoring.v3.Group + * @instance + */ + Group.prototype.parentName = ""; + + /** + * Group filter. + * @member {string} filter + * @memberof google.monitoring.v3.Group + * @instance + */ + Group.prototype.filter = ""; + + /** + * Group isCluster. + * @member {boolean} isCluster + * @memberof google.monitoring.v3.Group + * @instance + */ + Group.prototype.isCluster = false; + + /** + * Creates a new Group instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static - * @param {google.monitoring.v3.IGetGroupRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest instance + * @param {google.monitoring.v3.IGroup=} [properties] Properties to set + * @returns {google.monitoring.v3.Group} Group instance */ - GetGroupRequest.create = function create(properties) { - return new GetGroupRequest(properties); + Group.create = function create(properties) { + return new Group(properties); }; /** - * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. + * Encodes the specified Group message. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static - * @param {google.monitoring.v3.IGetGroupRequest} message GetGroupRequest message or plain object to encode + * @param {google.monitoring.v3.IGroup} message Group message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetGroupRequest.encode = function encode(message, writer) { + Group.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.parentName != null && message.hasOwnProperty("parentName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parentName); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.isCluster != null && message.hasOwnProperty("isCluster")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isCluster); return writer; }; /** - * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static - * @param {google.monitoring.v3.IGetGroupRequest} message GetGroupRequest message or plain object to encode + * @param {google.monitoring.v3.IGroup} message Group message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + Group.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetGroupRequest message from the specified reader or buffer. + * Decodes a Group message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest + * @returns {google.monitoring.v3.Group} Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetGroupRequest.decode = function decode(reader, length) { + Group.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetGroupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Group(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: + case 1: message.name = reader.string(); break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.parentName = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.isCluster = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -5800,345 +5271,378 @@ }; /** - * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. + * Decodes a Group message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest + * @returns {google.monitoring.v3.Group} Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetGroupRequest.decodeDelimited = function decodeDelimited(reader) { + Group.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetGroupRequest message. + * Verifies a Group message. * @function verify - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetGroupRequest.verify = function verify(message) { + Group.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parentName != null && message.hasOwnProperty("parentName")) + if (!$util.isString(message.parentName)) + return "parentName: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.isCluster != null && message.hasOwnProperty("isCluster")) + if (typeof message.isCluster !== "boolean") + return "isCluster: boolean expected"; return null; }; /** - * Creates a GetGroupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Group message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest + * @returns {google.monitoring.v3.Group} Group */ - GetGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetGroupRequest) + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Group) return object; - var message = new $root.google.monitoring.v3.GetGroupRequest(); + var message = new $root.google.monitoring.v3.Group(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parentName != null) + message.parentName = String(object.parentName); + if (object.filter != null) + message.filter = String(object.filter); + if (object.isCluster != null) + message.isCluster = Boolean(object.isCluster); return message; }; /** - * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. + * Creates a plain object from a Group message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @static - * @param {google.monitoring.v3.GetGroupRequest} message GetGroupRequest + * @param {google.monitoring.v3.Group} message Group * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetGroupRequest.toObject = function toObject(message, options) { + Group.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.displayName = ""; + object.parentName = ""; + object.filter = ""; + object.isCluster = false; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.parentName != null && message.hasOwnProperty("parentName")) + object.parentName = message.parentName; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.isCluster != null && message.hasOwnProperty("isCluster")) + object.isCluster = message.isCluster; return object; }; /** - * Converts this GetGroupRequest to JSON. + * Converts this Group to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetGroupRequest + * @memberof google.monitoring.v3.Group * @instance * @returns {Object.} JSON object */ - GetGroupRequest.prototype.toJSON = function toJSON() { + Group.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetGroupRequest; + return Group; })(); - v3.CreateGroupRequest = (function() { + v3.GroupService = (function() { /** - * Properties of a CreateGroupRequest. + * Constructs a new GroupService service. * @memberof google.monitoring.v3 - * @interface ICreateGroupRequest - * @property {string|null} [name] CreateGroupRequest name - * @property {google.monitoring.v3.IGroup|null} [group] CreateGroupRequest group - * @property {boolean|null} [validateOnly] CreateGroupRequest validateOnly + * @classdesc Represents a GroupService + * @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 GroupService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GroupService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GroupService; /** - * Constructs a new CreateGroupRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a CreateGroupRequest. - * @implements ICreateGroupRequest - * @constructor - * @param {google.monitoring.v3.ICreateGroupRequest=} [properties] Properties to set + * Creates new GroupService service using the specified rpc implementation. + * @function create + * @memberof google.monitoring.v3.GroupService + * @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 {GroupService} RPC service. Useful where requests and/or responses are streamed. */ - function CreateGroupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + GroupService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * CreateGroupRequest name. - * @member {string} name - * @memberof google.monitoring.v3.CreateGroupRequest - * @instance + * Callback as used by {@link google.monitoring.v3.GroupService#listGroups}. + * @memberof google.monitoring.v3.GroupService + * @typedef ListGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListGroupsResponse} [response] ListGroupsResponse */ - CreateGroupRequest.prototype.name = ""; /** - * CreateGroupRequest group. - * @member {google.monitoring.v3.IGroup|null|undefined} group - * @memberof google.monitoring.v3.CreateGroupRequest + * Calls ListGroups. + * @function listGroups + * @memberof google.monitoring.v3.GroupService * @instance + * @param {google.monitoring.v3.IListGroupsRequest} request ListGroupsRequest message or plain object + * @param {google.monitoring.v3.GroupService.ListGroupsCallback} callback Node-style callback called with the error, if any, and ListGroupsResponse + * @returns {undefined} + * @variation 1 */ - CreateGroupRequest.prototype.group = null; + Object.defineProperty(GroupService.prototype.listGroups = function listGroups(request, callback) { + return this.rpcCall(listGroups, $root.google.monitoring.v3.ListGroupsRequest, $root.google.monitoring.v3.ListGroupsResponse, request, callback); + }, "name", { value: "ListGroups" }); /** - * CreateGroupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.monitoring.v3.CreateGroupRequest + * Calls ListGroups. + * @function listGroups + * @memberof google.monitoring.v3.GroupService * @instance + * @param {google.monitoring.v3.IListGroupsRequest} request ListGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateGroupRequest.prototype.validateOnly = false; /** - * Creates a new CreateGroupRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {google.monitoring.v3.ICreateGroupRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest instance + * Callback as used by {@link google.monitoring.v3.GroupService#getGroup}. + * @memberof google.monitoring.v3.GroupService + * @typedef GetGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Group} [response] Group */ - CreateGroupRequest.create = function create(properties) { - return new CreateGroupRequest(properties); - }; /** - * Encodes the specified CreateGroupRequest message. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {google.monitoring.v3.ICreateGroupRequest} message CreateGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetGroup. + * @function getGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IGetGroupRequest} request GetGroupRequest message or plain object + * @param {google.monitoring.v3.GroupService.GetGroupCallback} callback Node-style callback called with the error, if any, and Group + * @returns {undefined} + * @variation 1 */ - CreateGroupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.group != null && message.hasOwnProperty("group")) - $root.google.monitoring.v3.Group.encode(message.group, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; + Object.defineProperty(GroupService.prototype.getGroup = function getGroup(request, callback) { + return this.rpcCall(getGroup, $root.google.monitoring.v3.GetGroupRequest, $root.google.monitoring.v3.Group, request, callback); + }, "name", { value: "GetGroup" }); /** - * Encodes the specified CreateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {google.monitoring.v3.ICreateGroupRequest} message CreateGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetGroup. + * @function getGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IGetGroupRequest} request GetGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a CreateGroupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.GroupService#createGroup}. + * @memberof google.monitoring.v3.GroupService + * @typedef CreateGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Group} [response] Group */ - CreateGroupRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateGroupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; - case 2: - message.group = $root.google.monitoring.v3.Group.decode(reader, reader.uint32()); - break; - case 3: - message.validateOnly = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a CreateGroupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateGroup. + * @function createGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.ICreateGroupRequest} request CreateGroupRequest message or plain object + * @param {google.monitoring.v3.GroupService.CreateGroupCallback} callback Node-style callback called with the error, if any, and Group + * @returns {undefined} + * @variation 1 */ - CreateGroupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(GroupService.prototype.createGroup = function createGroup(request, callback) { + return this.rpcCall(createGroup, $root.google.monitoring.v3.CreateGroupRequest, $root.google.monitoring.v3.Group, request, callback); + }, "name", { value: "CreateGroup" }); /** - * Verifies a CreateGroupRequest message. - * @function verify - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateGroup. + * @function createGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.ICreateGroupRequest} request CreateGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateGroupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.group != null && message.hasOwnProperty("group")) { - var error = $root.google.monitoring.v3.Group.verify(message.group); - if (error) - return "group." + error; - } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; /** - * Creates a CreateGroupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest + * Callback as used by {@link google.monitoring.v3.GroupService#updateGroup}. + * @memberof google.monitoring.v3.GroupService + * @typedef UpdateGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Group} [response] Group */ - CreateGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateGroupRequest) - return object; - var message = new $root.google.monitoring.v3.CreateGroupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.group != null) { - if (typeof object.group !== "object") - throw TypeError(".google.monitoring.v3.CreateGroupRequest.group: object expected"); - message.group = $root.google.monitoring.v3.Group.fromObject(object.group); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; /** - * Creates a plain object from a CreateGroupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.CreateGroupRequest - * @static - * @param {google.monitoring.v3.CreateGroupRequest} message CreateGroupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls UpdateGroup. + * @function updateGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IUpdateGroupRequest} request UpdateGroupRequest message or plain object + * @param {google.monitoring.v3.GroupService.UpdateGroupCallback} callback Node-style callback called with the error, if any, and Group + * @returns {undefined} + * @variation 1 */ - CreateGroupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.group = null; - object.validateOnly = false; - object.name = ""; - } - if (message.group != null && message.hasOwnProperty("group")) - object.group = $root.google.monitoring.v3.Group.toObject(message.group, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + Object.defineProperty(GroupService.prototype.updateGroup = function updateGroup(request, callback) { + return this.rpcCall(updateGroup, $root.google.monitoring.v3.UpdateGroupRequest, $root.google.monitoring.v3.Group, request, callback); + }, "name", { value: "UpdateGroup" }); /** - * Converts this CreateGroupRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.CreateGroupRequest + * Calls UpdateGroup. + * @function updateGroup + * @memberof google.monitoring.v3.GroupService * @instance - * @returns {Object.} JSON object + * @param {google.monitoring.v3.IUpdateGroupRequest} request UpdateGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateGroupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return CreateGroupRequest; + /** + * Callback as used by {@link google.monitoring.v3.GroupService#deleteGroup}. + * @memberof google.monitoring.v3.GroupService + * @typedef DeleteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteGroup. + * @function deleteGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IDeleteGroupRequest} request DeleteGroupRequest message or plain object + * @param {google.monitoring.v3.GroupService.DeleteGroupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GroupService.prototype.deleteGroup = function deleteGroup(request, callback) { + return this.rpcCall(deleteGroup, $root.google.monitoring.v3.DeleteGroupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteGroup" }); + + /** + * Calls DeleteGroup. + * @function deleteGroup + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IDeleteGroupRequest} request DeleteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.GroupService#listGroupMembers}. + * @memberof google.monitoring.v3.GroupService + * @typedef ListGroupMembersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListGroupMembersResponse} [response] ListGroupMembersResponse + */ + + /** + * Calls ListGroupMembers. + * @function listGroupMembers + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IListGroupMembersRequest} request ListGroupMembersRequest message or plain object + * @param {google.monitoring.v3.GroupService.ListGroupMembersCallback} callback Node-style callback called with the error, if any, and ListGroupMembersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GroupService.prototype.listGroupMembers = function listGroupMembers(request, callback) { + return this.rpcCall(listGroupMembers, $root.google.monitoring.v3.ListGroupMembersRequest, $root.google.monitoring.v3.ListGroupMembersResponse, request, callback); + }, "name", { value: "ListGroupMembers" }); + + /** + * Calls ListGroupMembers. + * @function listGroupMembers + * @memberof google.monitoring.v3.GroupService + * @instance + * @param {google.monitoring.v3.IListGroupMembersRequest} request ListGroupMembersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GroupService; })(); - v3.UpdateGroupRequest = (function() { + v3.ListGroupsRequest = (function() { /** - * Properties of an UpdateGroupRequest. + * Properties of a ListGroupsRequest. * @memberof google.monitoring.v3 - * @interface IUpdateGroupRequest - * @property {google.monitoring.v3.IGroup|null} [group] UpdateGroupRequest group - * @property {boolean|null} [validateOnly] UpdateGroupRequest validateOnly + * @interface IListGroupsRequest + * @property {string|null} [name] ListGroupsRequest name + * @property {string|null} [childrenOfGroup] ListGroupsRequest childrenOfGroup + * @property {string|null} [ancestorsOfGroup] ListGroupsRequest ancestorsOfGroup + * @property {string|null} [descendantsOfGroup] ListGroupsRequest descendantsOfGroup + * @property {number|null} [pageSize] ListGroupsRequest pageSize + * @property {string|null} [pageToken] ListGroupsRequest pageToken */ /** - * Constructs a new UpdateGroupRequest. + * Constructs a new ListGroupsRequest. * @memberof google.monitoring.v3 - * @classdesc Represents an UpdateGroupRequest. - * @implements IUpdateGroupRequest + * @classdesc Represents a ListGroupsRequest. + * @implements IListGroupsRequest * @constructor - * @param {google.monitoring.v3.IUpdateGroupRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListGroupsRequest=} [properties] Properties to set */ - function UpdateGroupRequest(properties) { + function ListGroupsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6146,88 +5650,154 @@ } /** - * UpdateGroupRequest group. - * @member {google.monitoring.v3.IGroup|null|undefined} group - * @memberof google.monitoring.v3.UpdateGroupRequest + * ListGroupsRequest name. + * @member {string} name + * @memberof google.monitoring.v3.ListGroupsRequest * @instance */ - UpdateGroupRequest.prototype.group = null; + ListGroupsRequest.prototype.name = ""; /** - * UpdateGroupRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.monitoring.v3.UpdateGroupRequest + * ListGroupsRequest childrenOfGroup. + * @member {string} childrenOfGroup + * @memberof google.monitoring.v3.ListGroupsRequest * @instance */ - UpdateGroupRequest.prototype.validateOnly = false; + ListGroupsRequest.prototype.childrenOfGroup = ""; /** - * Creates a new UpdateGroupRequest instance using the specified properties. + * ListGroupsRequest ancestorsOfGroup. + * @member {string} ancestorsOfGroup + * @memberof google.monitoring.v3.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.ancestorsOfGroup = ""; + + /** + * ListGroupsRequest descendantsOfGroup. + * @member {string} descendantsOfGroup + * @memberof google.monitoring.v3.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.descendantsOfGroup = ""; + + /** + * ListGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.pageSize = 0; + + /** + * ListGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.pageToken = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGroupsRequest filter. + * @member {"childrenOfGroup"|"ancestorsOfGroup"|"descendantsOfGroup"|undefined} filter + * @memberof google.monitoring.v3.ListGroupsRequest + * @instance + */ + Object.defineProperty(ListGroupsRequest.prototype, "filter", { + get: $util.oneOfGetter($oneOfFields = ["childrenOfGroup", "ancestorsOfGroup", "descendantsOfGroup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGroupsRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static - * @param {google.monitoring.v3.IUpdateGroupRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest instance + * @param {google.monitoring.v3.IListGroupsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest instance */ - UpdateGroupRequest.create = function create(properties) { - return new UpdateGroupRequest(properties); + ListGroupsRequest.create = function create(properties) { + return new ListGroupsRequest(properties); }; /** - * Encodes the specified UpdateGroupRequest message. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. + * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static - * @param {google.monitoring.v3.IUpdateGroupRequest} message UpdateGroupRequest message or plain object to encode + * @param {google.monitoring.v3.IListGroupsRequest} message ListGroupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateGroupRequest.encode = function encode(message, writer) { + ListGroupsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.group != null && message.hasOwnProperty("group")) - $root.google.monitoring.v3.Group.encode(message.group, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.childrenOfGroup != null && message.hasOwnProperty("childrenOfGroup")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childrenOfGroup); + if (message.ancestorsOfGroup != null && message.hasOwnProperty("ancestorsOfGroup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestorsOfGroup); + if (message.descendantsOfGroup != null && message.hasOwnProperty("descendantsOfGroup")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.descendantsOfGroup); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); return writer; }; /** - * Encodes the specified UpdateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. + * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static - * @param {google.monitoring.v3.IUpdateGroupRequest} message UpdateGroupRequest message or plain object to encode + * @param {google.monitoring.v3.IListGroupsRequest} message ListGroupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateGroupRequest message from the specified reader or buffer. + * Decodes a ListGroupsRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest + * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateGroupRequest.decode = function decode(reader, length) { + ListGroupsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateGroupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 7: + message.name = reader.string(); + break; case 2: - message.group = $root.google.monitoring.v3.Group.decode(reader, reader.uint32()); + message.childrenOfGroup = reader.string(); break; case 3: - message.validateOnly = reader.bool(); + message.ancestorsOfGroup = reader.string(); + break; + case 4: + message.descendantsOfGroup = reader.string(); + break; + case 5: + message.pageSize = reader.int32(); + break; + case 6: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6238,122 +5808,167 @@ }; /** - * Decodes an UpdateGroupRequest message from the specified reader or buffer, length delimited. + * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest + * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateGroupRequest.decodeDelimited = function decodeDelimited(reader) { + ListGroupsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateGroupRequest message. + * Verifies a ListGroupsRequest message. * @function verify - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateGroupRequest.verify = function verify(message) { + ListGroupsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.group != null && message.hasOwnProperty("group")) { - var error = $root.google.monitoring.v3.Group.verify(message.group); - if (error) - return "group." + error; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.childrenOfGroup != null && message.hasOwnProperty("childrenOfGroup")) { + properties.filter = 1; + if (!$util.isString(message.childrenOfGroup)) + return "childrenOfGroup: string expected"; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; + if (message.ancestorsOfGroup != null && message.hasOwnProperty("ancestorsOfGroup")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isString(message.ancestorsOfGroup)) + return "ancestorsOfGroup: string expected"; + } + if (message.descendantsOfGroup != null && message.hasOwnProperty("descendantsOfGroup")) { + if (properties.filter === 1) + return "filter: multiple values"; + properties.filter = 1; + if (!$util.isString(message.descendantsOfGroup)) + return "descendantsOfGroup: string expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an UpdateGroupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListGroupsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest + * @returns {google.monitoring.v3.ListGroupsRequest} ListGroupsRequest */ - UpdateGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.UpdateGroupRequest) + ListGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListGroupsRequest) return object; - var message = new $root.google.monitoring.v3.UpdateGroupRequest(); - if (object.group != null) { - if (typeof object.group !== "object") - throw TypeError(".google.monitoring.v3.UpdateGroupRequest.group: object expected"); - message.group = $root.google.monitoring.v3.Group.fromObject(object.group); - } - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); + var message = new $root.google.monitoring.v3.ListGroupsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.childrenOfGroup != null) + message.childrenOfGroup = String(object.childrenOfGroup); + if (object.ancestorsOfGroup != null) + message.ancestorsOfGroup = String(object.ancestorsOfGroup); + if (object.descendantsOfGroup != null) + message.descendantsOfGroup = String(object.descendantsOfGroup); + 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 an UpdateGroupRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListGroupsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @static - * @param {google.monitoring.v3.UpdateGroupRequest} message UpdateGroupRequest + * @param {google.monitoring.v3.ListGroupsRequest} message ListGroupsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateGroupRequest.toObject = function toObject(message, options) { + ListGroupsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.group = null; - object.validateOnly = false; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; } - if (message.group != null && message.hasOwnProperty("group")) - object.group = $root.google.monitoring.v3.Group.toObject(message.group, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; + if (message.childrenOfGroup != null && message.hasOwnProperty("childrenOfGroup")) { + object.childrenOfGroup = message.childrenOfGroup; + if (options.oneofs) + object.filter = "childrenOfGroup"; + } + if (message.ancestorsOfGroup != null && message.hasOwnProperty("ancestorsOfGroup")) { + object.ancestorsOfGroup = message.ancestorsOfGroup; + if (options.oneofs) + object.filter = "ancestorsOfGroup"; + } + if (message.descendantsOfGroup != null && message.hasOwnProperty("descendantsOfGroup")) { + object.descendantsOfGroup = message.descendantsOfGroup; + if (options.oneofs) + object.filter = "descendantsOfGroup"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateGroupRequest to JSON. + * Converts this ListGroupsRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.UpdateGroupRequest + * @memberof google.monitoring.v3.ListGroupsRequest * @instance * @returns {Object.} JSON object */ - UpdateGroupRequest.prototype.toJSON = function toJSON() { + ListGroupsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateGroupRequest; + return ListGroupsRequest; })(); - v3.DeleteGroupRequest = (function() { + v3.ListGroupsResponse = (function() { /** - * Properties of a DeleteGroupRequest. + * Properties of a ListGroupsResponse. * @memberof google.monitoring.v3 - * @interface IDeleteGroupRequest - * @property {string|null} [name] DeleteGroupRequest name - * @property {boolean|null} [recursive] DeleteGroupRequest recursive + * @interface IListGroupsResponse + * @property {Array.|null} [group] ListGroupsResponse group + * @property {string|null} [nextPageToken] ListGroupsResponse nextPageToken */ /** - * Constructs a new DeleteGroupRequest. + * Constructs a new ListGroupsResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteGroupRequest. - * @implements IDeleteGroupRequest + * @classdesc Represents a ListGroupsResponse. + * @implements IListGroupsResponse * @constructor - * @param {google.monitoring.v3.IDeleteGroupRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListGroupsResponse=} [properties] Properties to set */ - function DeleteGroupRequest(properties) { + function ListGroupsResponse(properties) { + this.group = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6361,88 +5976,91 @@ } /** - * DeleteGroupRequest name. - * @member {string} name - * @memberof google.monitoring.v3.DeleteGroupRequest + * ListGroupsResponse group. + * @member {Array.} group + * @memberof google.monitoring.v3.ListGroupsResponse * @instance */ - DeleteGroupRequest.prototype.name = ""; + ListGroupsResponse.prototype.group = $util.emptyArray; /** - * DeleteGroupRequest recursive. - * @member {boolean} recursive - * @memberof google.monitoring.v3.DeleteGroupRequest + * ListGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListGroupsResponse * @instance */ - DeleteGroupRequest.prototype.recursive = false; + ListGroupsResponse.prototype.nextPageToken = ""; /** - * Creates a new DeleteGroupRequest instance using the specified properties. + * Creates a new ListGroupsResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static - * @param {google.monitoring.v3.IDeleteGroupRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest instance + * @param {google.monitoring.v3.IListGroupsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse instance */ - DeleteGroupRequest.create = function create(properties) { - return new DeleteGroupRequest(properties); + ListGroupsResponse.create = function create(properties) { + return new ListGroupsResponse(properties); }; /** - * Encodes the specified DeleteGroupRequest message. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. + * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static - * @param {google.monitoring.v3.IDeleteGroupRequest} message DeleteGroupRequest message or plain object to encode + * @param {google.monitoring.v3.IListGroupsResponse} message ListGroupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGroupRequest.encode = function encode(message, writer) { + ListGroupsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - if (message.recursive != null && message.hasOwnProperty("recursive")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.recursive); + if (message.group != null && message.group.length) + for (var i = 0; i < message.group.length; ++i) + $root.google.monitoring.v3.Group.encode(message.group[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified DeleteGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. + * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static - * @param {google.monitoring.v3.IDeleteGroupRequest} message DeleteGroupRequest message or plain object to encode + * @param {google.monitoring.v3.IListGroupsResponse} message ListGroupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteGroupRequest message from the specified reader or buffer. + * Decodes a ListGroupsResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest + * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGroupRequest.decode = function decode(reader, length) { + ListGroupsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteGroupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); + case 1: + if (!(message.group && message.group.length)) + message.group = []; + message.group.push($root.google.monitoring.v3.Group.decode(reader, reader.uint32())); break; - case 4: - message.recursive = reader.bool(); + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6453,120 +6071,133 @@ }; /** - * Decodes a DeleteGroupRequest message from the specified reader or buffer, length delimited. + * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest + * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + ListGroupsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteGroupRequest message. + * Verifies a ListGroupsResponse message. * @function verify - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteGroupRequest.verify = function verify(message) { + ListGroupsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.recursive != null && message.hasOwnProperty("recursive")) - if (typeof message.recursive !== "boolean") - return "recursive: boolean expected"; + if (message.group != null && message.hasOwnProperty("group")) { + if (!Array.isArray(message.group)) + return "group: array expected"; + for (var i = 0; i < message.group.length; ++i) { + var error = $root.google.monitoring.v3.Group.verify(message.group[i]); + if (error) + return "group." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a DeleteGroupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListGroupsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest + * @returns {google.monitoring.v3.ListGroupsResponse} ListGroupsResponse */ - DeleteGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteGroupRequest) + ListGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListGroupsResponse) return object; - var message = new $root.google.monitoring.v3.DeleteGroupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.recursive != null) - message.recursive = Boolean(object.recursive); + var message = new $root.google.monitoring.v3.ListGroupsResponse(); + if (object.group) { + if (!Array.isArray(object.group)) + throw TypeError(".google.monitoring.v3.ListGroupsResponse.group: array expected"); + message.group = []; + for (var i = 0; i < object.group.length; ++i) { + if (typeof object.group[i] !== "object") + throw TypeError(".google.monitoring.v3.ListGroupsResponse.group: object expected"); + message.group[i] = $root.google.monitoring.v3.Group.fromObject(object.group[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a DeleteGroupRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @static - * @param {google.monitoring.v3.DeleteGroupRequest} message DeleteGroupRequest + * @param {google.monitoring.v3.ListGroupsResponse} message ListGroupsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteGroupRequest.toObject = function toObject(message, options) { + ListGroupsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.recursive = false; + if (options.arrays || options.defaults) + object.group = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.group && message.group.length) { + object.group = []; + for (var j = 0; j < message.group.length; ++j) + object.group[j] = $root.google.monitoring.v3.Group.toObject(message.group[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.recursive != null && message.hasOwnProperty("recursive")) - object.recursive = message.recursive; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this DeleteGroupRequest to JSON. + * Converts this ListGroupsResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.DeleteGroupRequest + * @memberof google.monitoring.v3.ListGroupsResponse * @instance * @returns {Object.} JSON object */ - DeleteGroupRequest.prototype.toJSON = function toJSON() { + ListGroupsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteGroupRequest; + return ListGroupsResponse; })(); - v3.ListGroupMembersRequest = (function() { + v3.GetGroupRequest = (function() { /** - * Properties of a ListGroupMembersRequest. + * Properties of a GetGroupRequest. * @memberof google.monitoring.v3 - * @interface IListGroupMembersRequest - * @property {string|null} [name] ListGroupMembersRequest name - * @property {number|null} [pageSize] ListGroupMembersRequest pageSize - * @property {string|null} [pageToken] ListGroupMembersRequest pageToken - * @property {string|null} [filter] ListGroupMembersRequest filter - * @property {google.monitoring.v3.ITimeInterval|null} [interval] ListGroupMembersRequest interval + * @interface IGetGroupRequest + * @property {string|null} [name] GetGroupRequest name */ /** - * Constructs a new ListGroupMembersRequest. + * Constructs a new GetGroupRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListGroupMembersRequest. - * @implements IListGroupMembersRequest + * @classdesc Represents a GetGroupRequest. + * @implements IGetGroupRequest * @constructor - * @param {google.monitoring.v3.IListGroupMembersRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IGetGroupRequest=} [properties] Properties to set */ - function ListGroupMembersRequest(properties) { + function GetGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6574,127 +6205,75 @@ } /** - * ListGroupMembersRequest name. + * GetGroupRequest name. * @member {string} name - * @memberof google.monitoring.v3.ListGroupMembersRequest - * @instance - */ - ListGroupMembersRequest.prototype.name = ""; - - /** - * ListGroupMembersRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListGroupMembersRequest - * @instance - */ - ListGroupMembersRequest.prototype.pageSize = 0; - - /** - * ListGroupMembersRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListGroupMembersRequest - * @instance - */ - ListGroupMembersRequest.prototype.pageToken = ""; - - /** - * ListGroupMembersRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListGroupMembersRequest - * @instance - */ - ListGroupMembersRequest.prototype.filter = ""; - - /** - * ListGroupMembersRequest interval. - * @member {google.monitoring.v3.ITimeInterval|null|undefined} interval - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @instance */ - ListGroupMembersRequest.prototype.interval = null; + GetGroupRequest.prototype.name = ""; /** - * Creates a new ListGroupMembersRequest instance using the specified properties. + * Creates a new GetGroupRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static - * @param {google.monitoring.v3.IListGroupMembersRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest instance + * @param {google.monitoring.v3.IGetGroupRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest instance */ - ListGroupMembersRequest.create = function create(properties) { - return new ListGroupMembersRequest(properties); + GetGroupRequest.create = function create(properties) { + return new GetGroupRequest(properties); }; /** - * Encodes the specified ListGroupMembersRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. + * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static - * @param {google.monitoring.v3.IListGroupMembersRequest} message ListGroupMembersRequest message or plain object to encode + * @param {google.monitoring.v3.IGetGroupRequest} message GetGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupMembersRequest.encode = function encode(message, writer) { + GetGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.interval != null && message.hasOwnProperty("interval")) - $root.google.monitoring.v3.TimeInterval.encode(message.interval, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified ListGroupMembersRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. + * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static - * @param {google.monitoring.v3.IListGroupMembersRequest} message ListGroupMembersRequest message or plain object to encode + * @param {google.monitoring.v3.IGetGroupRequest} message GetGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupMembersRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGroupMembersRequest message from the specified reader or buffer. + * Decodes a GetGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest + * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupMembersRequest.decode = function decode(reader, length) { + GetGroupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupMembersRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 7: - message.name = reader.string(); - break; case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; - case 5: - message.filter = reader.string(); - break; - case 6: - message.interval = $root.google.monitoring.v3.TimeInterval.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6705,148 +6284,109 @@ }; /** - * Decodes a ListGroupMembersRequest message from the specified reader or buffer, length delimited. + * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest + * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupMembersRequest.decodeDelimited = function decodeDelimited(reader) { + GetGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGroupMembersRequest message. + * Verifies a GetGroupRequest message. * @function verify - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGroupMembersRequest.verify = function verify(message) { + GetGroupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.monitoring.v3.TimeInterval.verify(message.interval); - if (error) - return "interval." + error; - } return null; }; /** - * Creates a ListGroupMembersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest + * @returns {google.monitoring.v3.GetGroupRequest} GetGroupRequest */ - ListGroupMembersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListGroupMembersRequest) + GetGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetGroupRequest) return object; - var message = new $root.google.monitoring.v3.ListGroupMembersRequest(); + var message = new $root.google.monitoring.v3.GetGroupRequest(); if (object.name != null) message.name = String(object.name); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.monitoring.v3.ListGroupMembersRequest.interval: object expected"); - message.interval = $root.google.monitoring.v3.TimeInterval.fromObject(object.interval); - } return message; }; /** - * Creates a plain object from a ListGroupMembersRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @static - * @param {google.monitoring.v3.ListGroupMembersRequest} message ListGroupMembersRequest + * @param {google.monitoring.v3.GetGroupRequest} message GetGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGroupMembersRequest.toObject = function toObject(message, options) { + GetGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.interval = null; + if (options.defaults) object.name = ""; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.monitoring.v3.TimeInterval.toObject(message.interval, options); if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** - * Converts this ListGroupMembersRequest to JSON. + * Converts this GetGroupRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListGroupMembersRequest + * @memberof google.monitoring.v3.GetGroupRequest * @instance * @returns {Object.} JSON object */ - ListGroupMembersRequest.prototype.toJSON = function toJSON() { + GetGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGroupMembersRequest; + return GetGroupRequest; })(); - v3.ListGroupMembersResponse = (function() { + v3.CreateGroupRequest = (function() { /** - * Properties of a ListGroupMembersResponse. + * Properties of a CreateGroupRequest. * @memberof google.monitoring.v3 - * @interface IListGroupMembersResponse - * @property {Array.|null} [members] ListGroupMembersResponse members - * @property {string|null} [nextPageToken] ListGroupMembersResponse nextPageToken - * @property {number|null} [totalSize] ListGroupMembersResponse totalSize + * @interface ICreateGroupRequest + * @property {string|null} [name] CreateGroupRequest name + * @property {google.monitoring.v3.IGroup|null} [group] CreateGroupRequest group + * @property {boolean|null} [validateOnly] CreateGroupRequest validateOnly */ /** - * Constructs a new ListGroupMembersResponse. + * Constructs a new CreateGroupRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListGroupMembersResponse. - * @implements IListGroupMembersResponse + * @classdesc Represents a CreateGroupRequest. + * @implements ICreateGroupRequest * @constructor - * @param {google.monitoring.v3.IListGroupMembersResponse=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateGroupRequest=} [properties] Properties to set */ - function ListGroupMembersResponse(properties) { - this.members = []; + function CreateGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6854,104 +6394,101 @@ } /** - * ListGroupMembersResponse members. - * @member {Array.} members - * @memberof google.monitoring.v3.ListGroupMembersResponse + * CreateGroupRequest name. + * @member {string} name + * @memberof google.monitoring.v3.CreateGroupRequest * @instance */ - ListGroupMembersResponse.prototype.members = $util.emptyArray; + CreateGroupRequest.prototype.name = ""; /** - * ListGroupMembersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListGroupMembersResponse + * CreateGroupRequest group. + * @member {google.monitoring.v3.IGroup|null|undefined} group + * @memberof google.monitoring.v3.CreateGroupRequest * @instance */ - ListGroupMembersResponse.prototype.nextPageToken = ""; + CreateGroupRequest.prototype.group = null; /** - * ListGroupMembersResponse totalSize. - * @member {number} totalSize - * @memberof google.monitoring.v3.ListGroupMembersResponse + * CreateGroupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.monitoring.v3.CreateGroupRequest * @instance */ - ListGroupMembersResponse.prototype.totalSize = 0; + CreateGroupRequest.prototype.validateOnly = false; /** - * Creates a new ListGroupMembersResponse instance using the specified properties. + * Creates a new CreateGroupRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static - * @param {google.monitoring.v3.IListGroupMembersResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse instance + * @param {google.monitoring.v3.ICreateGroupRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest instance */ - ListGroupMembersResponse.create = function create(properties) { - return new ListGroupMembersResponse(properties); + CreateGroupRequest.create = function create(properties) { + return new CreateGroupRequest(properties); }; /** - * Encodes the specified ListGroupMembersResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. + * Encodes the specified CreateGroupRequest message. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static - * @param {google.monitoring.v3.IListGroupMembersResponse} message ListGroupMembersResponse message or plain object to encode + * @param {google.monitoring.v3.ICreateGroupRequest} message CreateGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupMembersResponse.encode = function encode(message, writer) { + CreateGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - $root.google.api.MonitoredResource.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.group != null && message.hasOwnProperty("group")) + $root.google.monitoring.v3.Group.encode(message.group, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; /** - * Encodes the specified ListGroupMembersResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. + * Encodes the specified CreateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static - * @param {google.monitoring.v3.IListGroupMembersResponse} message ListGroupMembersResponse message or plain object to encode + * @param {google.monitoring.v3.ICreateGroupRequest} message CreateGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListGroupMembersResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListGroupMembersResponse message from the specified reader or buffer. + * Decodes a CreateGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse + * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupMembersResponse.decode = function decode(reader, length) { + CreateGroupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupMembersResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push($root.google.api.MonitoredResource.decode(reader, reader.uint32())); + case 4: + message.name = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.group = $root.google.monitoring.v3.Group.decode(reader, reader.uint32()); break; case 3: - message.totalSize = reader.int32(); + message.validateOnly = reader.bool(); break; default: reader.skipType(tag & 7); @@ -6962,146 +6499,130 @@ }; /** - * Decodes a ListGroupMembersResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse + * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListGroupMembersResponse.decodeDelimited = function decodeDelimited(reader) { + CreateGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListGroupMembersResponse message. + * Verifies a CreateGroupRequest message. * @function verify - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListGroupMembersResponse.verify = function verify(message) { + CreateGroupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) { - var error = $root.google.api.MonitoredResource.verify(message.members[i]); - if (error) - return "members." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.group != null && message.hasOwnProperty("group")) { + var error = $root.google.monitoring.v3.Group.verify(message.group); + if (error) + return "group." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a ListGroupMembersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse + * @returns {google.monitoring.v3.CreateGroupRequest} CreateGroupRequest */ - ListGroupMembersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListGroupMembersResponse) + CreateGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateGroupRequest) return object; - var message = new $root.google.monitoring.v3.ListGroupMembersResponse(); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.monitoring.v3.ListGroupMembersResponse.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) { - if (typeof object.members[i] !== "object") - throw TypeError(".google.monitoring.v3.ListGroupMembersResponse.members: object expected"); - message.members[i] = $root.google.api.MonitoredResource.fromObject(object.members[i]); - } + var message = new $root.google.monitoring.v3.CreateGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.group != null) { + if (typeof object.group !== "object") + throw TypeError(".google.monitoring.v3.CreateGroupRequest.group: object expected"); + message.group = $root.google.monitoring.v3.Group.fromObject(object.group); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a ListGroupMembersResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @static - * @param {google.monitoring.v3.ListGroupMembersResponse} message ListGroupMembersResponse + * @param {google.monitoring.v3.CreateGroupRequest} message CreateGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListGroupMembersResponse.toObject = function toObject(message, options) { + CreateGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.members = []; if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = $root.google.api.MonitoredResource.toObject(message.members[j], options); + object.group = null; + object.validateOnly = false; + object.name = ""; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.group != null && message.hasOwnProperty("group")) + object.group = $root.google.monitoring.v3.Group.toObject(message.group, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListGroupMembersResponse to JSON. + * Converts this CreateGroupRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListGroupMembersResponse + * @memberof google.monitoring.v3.CreateGroupRequest * @instance * @returns {Object.} JSON object */ - ListGroupMembersResponse.prototype.toJSON = function toJSON() { + CreateGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListGroupMembersResponse; + return CreateGroupRequest; })(); - v3.Group = (function() { + v3.UpdateGroupRequest = (function() { /** - * Properties of a Group. + * Properties of an UpdateGroupRequest. * @memberof google.monitoring.v3 - * @interface IGroup - * @property {string|null} [name] Group name - * @property {string|null} [displayName] Group displayName - * @property {string|null} [parentName] Group parentName - * @property {string|null} [filter] Group filter - * @property {boolean|null} [isCluster] Group isCluster + * @interface IUpdateGroupRequest + * @property {google.monitoring.v3.IGroup|null} [group] UpdateGroupRequest group + * @property {boolean|null} [validateOnly] UpdateGroupRequest validateOnly */ /** - * Constructs a new Group. + * Constructs a new UpdateGroupRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a Group. - * @implements IGroup + * @classdesc Represents an UpdateGroupRequest. + * @implements IUpdateGroupRequest * @constructor - * @param {google.monitoring.v3.IGroup=} [properties] Properties to set + * @param {google.monitoring.v3.IUpdateGroupRequest=} [properties] Properties to set */ - function Group(properties) { + function UpdateGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7109,127 +6630,303 @@ } /** - * Group name. - * @member {string} name - * @memberof google.monitoring.v3.Group + * UpdateGroupRequest group. + * @member {google.monitoring.v3.IGroup|null|undefined} group + * @memberof google.monitoring.v3.UpdateGroupRequest * @instance */ - Group.prototype.name = ""; + UpdateGroupRequest.prototype.group = null; /** - * Group displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.Group + * UpdateGroupRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.monitoring.v3.UpdateGroupRequest * @instance */ - Group.prototype.displayName = ""; + UpdateGroupRequest.prototype.validateOnly = false; /** - * Group parentName. - * @member {string} parentName - * @memberof google.monitoring.v3.Group + * Creates a new UpdateGroupRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {google.monitoring.v3.IUpdateGroupRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest instance + */ + UpdateGroupRequest.create = function create(properties) { + return new UpdateGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateGroupRequest message. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {google.monitoring.v3.IUpdateGroupRequest} message UpdateGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && message.hasOwnProperty("group")) + $root.google.monitoring.v3.Group.encode(message.group, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {google.monitoring.v3.IUpdateGroupRequest} message UpdateGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.group = $root.google.monitoring.v3.Group.decode(reader, reader.uint32()); + break; + case 3: + message.validateOnly = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGroupRequest message. + * @function verify + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.group != null && message.hasOwnProperty("group")) { + var error = $root.google.monitoring.v3.Group.verify(message.group); + if (error) + return "group." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.UpdateGroupRequest} UpdateGroupRequest + */ + UpdateGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateGroupRequest) + return object; + var message = new $root.google.monitoring.v3.UpdateGroupRequest(); + if (object.group != null) { + if (typeof object.group !== "object") + throw TypeError(".google.monitoring.v3.UpdateGroupRequest.group: object expected"); + message.group = $root.google.monitoring.v3.Group.fromObject(object.group); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.UpdateGroupRequest + * @static + * @param {google.monitoring.v3.UpdateGroupRequest} message UpdateGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.group = null; + object.validateOnly = false; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = $root.google.monitoring.v3.Group.toObject(message.group, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateGroupRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.UpdateGroupRequest * @instance + * @returns {Object.} JSON object */ - Group.prototype.parentName = ""; + UpdateGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateGroupRequest; + })(); + + v3.DeleteGroupRequest = (function() { /** - * Group filter. - * @member {string} filter - * @memberof google.monitoring.v3.Group + * Properties of a DeleteGroupRequest. + * @memberof google.monitoring.v3 + * @interface IDeleteGroupRequest + * @property {string|null} [name] DeleteGroupRequest name + * @property {boolean|null} [recursive] DeleteGroupRequest recursive + */ + + /** + * Constructs a new DeleteGroupRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a DeleteGroupRequest. + * @implements IDeleteGroupRequest + * @constructor + * @param {google.monitoring.v3.IDeleteGroupRequest=} [properties] Properties to set + */ + function DeleteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGroupRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteGroupRequest * @instance */ - Group.prototype.filter = ""; + DeleteGroupRequest.prototype.name = ""; /** - * Group isCluster. - * @member {boolean} isCluster - * @memberof google.monitoring.v3.Group + * DeleteGroupRequest recursive. + * @member {boolean} recursive + * @memberof google.monitoring.v3.DeleteGroupRequest * @instance */ - Group.prototype.isCluster = false; + DeleteGroupRequest.prototype.recursive = false; /** - * Creates a new Group instance using the specified properties. + * Creates a new DeleteGroupRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static - * @param {google.monitoring.v3.IGroup=} [properties] Properties to set - * @returns {google.monitoring.v3.Group} Group instance + * @param {google.monitoring.v3.IDeleteGroupRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest instance */ - Group.create = function create(properties) { - return new Group(properties); + DeleteGroupRequest.create = function create(properties) { + return new DeleteGroupRequest(properties); }; /** - * Encodes the specified Group message. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. + * Encodes the specified DeleteGroupRequest message. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static - * @param {google.monitoring.v3.IGroup} message Group message or plain object to encode + * @param {google.monitoring.v3.IDeleteGroupRequest} message DeleteGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Group.encode = function encode(message, writer) { + DeleteGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.parentName != null && message.hasOwnProperty("parentName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parentName); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.isCluster != null && message.hasOwnProperty("isCluster")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isCluster); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.recursive != null && message.hasOwnProperty("recursive")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.recursive); return writer; }; /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.monitoring.v3.Group.verify|verify} messages. + * Encodes the specified DeleteGroupRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static - * @param {google.monitoring.v3.IGroup} message Group message or plain object to encode + * @param {google.monitoring.v3.IDeleteGroupRequest} message DeleteGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Group.encodeDelimited = function encodeDelimited(message, writer) { + DeleteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Group message from the specified reader or buffer. + * Decodes a DeleteGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Group} Group + * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Group.decode = function decode(reader, length) { + DeleteGroupRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Group(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; case 3: - message.parentName = reader.string(); - break; - case 5: - message.filter = reader.string(); + message.name = reader.string(); break; - case 6: - message.isCluster = reader.bool(); + case 4: + message.recursive = reader.bool(); break; default: reader.skipType(tag & 7); @@ -7240,558 +6937,249 @@ }; /** - * Decodes a Group message from the specified reader or buffer, length delimited. + * Decodes a DeleteGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Group} Group + * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Group.decodeDelimited = function decodeDelimited(reader) { + DeleteGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Group message. + * Verifies a DeleteGroupRequest message. * @function verify - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Group.verify = function verify(message) { + DeleteGroupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.parentName != null && message.hasOwnProperty("parentName")) - if (!$util.isString(message.parentName)) - return "parentName: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.isCluster != null && message.hasOwnProperty("isCluster")) - if (typeof message.isCluster !== "boolean") - return "isCluster: boolean expected"; + if (message.recursive != null && message.hasOwnProperty("recursive")) + if (typeof message.recursive !== "boolean") + return "recursive: boolean expected"; return null; }; /** - * Creates a Group message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Group} Group + * @returns {google.monitoring.v3.DeleteGroupRequest} DeleteGroupRequest */ - Group.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Group) + DeleteGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteGroupRequest) return object; - var message = new $root.google.monitoring.v3.Group(); + var message = new $root.google.monitoring.v3.DeleteGroupRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.parentName != null) - message.parentName = String(object.parentName); - if (object.filter != null) - message.filter = String(object.filter); - if (object.isCluster != null) - message.isCluster = Boolean(object.isCluster); + if (object.recursive != null) + message.recursive = Boolean(object.recursive); return message; }; /** - * Creates a plain object from a Group message. Also converts values to other types if specified. + * Creates a plain object from a DeleteGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @static - * @param {google.monitoring.v3.Group} message Group + * @param {google.monitoring.v3.DeleteGroupRequest} message DeleteGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Group.toObject = function toObject(message, options) { + DeleteGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.displayName = ""; - object.parentName = ""; - object.filter = ""; - object.isCluster = false; + object.recursive = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.parentName != null && message.hasOwnProperty("parentName")) - object.parentName = message.parentName; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.isCluster != null && message.hasOwnProperty("isCluster")) - object.isCluster = message.isCluster; + if (message.recursive != null && message.hasOwnProperty("recursive")) + object.recursive = message.recursive; return object; }; /** - * Converts this Group to JSON. + * Converts this DeleteGroupRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.Group + * @memberof google.monitoring.v3.DeleteGroupRequest * @instance * @returns {Object.} JSON object */ - Group.prototype.toJSON = function toJSON() { + DeleteGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Group; + return DeleteGroupRequest; })(); - v3.MetricService = (function() { + v3.ListGroupMembersRequest = (function() { /** - * Constructs a new MetricService service. + * Properties of a ListGroupMembersRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a MetricService - * @extends $protobuf.rpc.Service + * @interface IListGroupMembersRequest + * @property {string|null} [name] ListGroupMembersRequest name + * @property {number|null} [pageSize] ListGroupMembersRequest pageSize + * @property {string|null} [pageToken] ListGroupMembersRequest pageToken + * @property {string|null} [filter] ListGroupMembersRequest filter + * @property {google.monitoring.v3.ITimeInterval|null} [interval] ListGroupMembersRequest interval + */ + + /** + * Constructs a new ListGroupMembersRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListGroupMembersRequest. + * @implements IListGroupMembersRequest * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.monitoring.v3.IListGroupMembersRequest=} [properties] Properties to set */ - function MetricService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function ListGroupMembersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (MetricService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricService; - /** - * Creates new MetricService service using the specified rpc implementation. - * @function create - * @memberof google.monitoring.v3.MetricService - * @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 {MetricService} RPC service. Useful where requests and/or responses are streamed. + * ListGroupMembersRequest name. + * @member {string} name + * @memberof google.monitoring.v3.ListGroupMembersRequest + * @instance */ - MetricService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + ListGroupMembersRequest.prototype.name = ""; /** - * Callback as used by {@link google.monitoring.v3.MetricService#listMonitoredResourceDescriptors}. - * @memberof google.monitoring.v3.MetricService - * @typedef ListMonitoredResourceDescriptorsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} [response] ListMonitoredResourceDescriptorsResponse + * ListGroupMembersRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListGroupMembersRequest + * @instance */ + ListGroupMembersRequest.prototype.pageSize = 0; /** - * Calls ListMonitoredResourceDescriptors. - * @function listMonitoredResourceDescriptors - * @memberof google.monitoring.v3.MetricService + * ListGroupMembersRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListGroupMembersRequest * @instance - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object - * @param {google.monitoring.v3.MetricService.ListMonitoredResourceDescriptorsCallback} callback Node-style callback called with the error, if any, and ListMonitoredResourceDescriptorsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(MetricService.prototype.listMonitoredResourceDescriptors = function listMonitoredResourceDescriptors(request, callback) { - return this.rpcCall(listMonitoredResourceDescriptors, $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest, $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse, request, callback); - }, "name", { value: "ListMonitoredResourceDescriptors" }); + ListGroupMembersRequest.prototype.pageToken = ""; /** - * Calls ListMonitoredResourceDescriptors. - * @function listMonitoredResourceDescriptors - * @memberof google.monitoring.v3.MetricService + * ListGroupMembersRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListGroupMembersRequest * @instance - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListGroupMembersRequest.prototype.filter = ""; /** - * Callback as used by {@link google.monitoring.v3.MetricService#getMonitoredResourceDescriptor}. - * @memberof google.monitoring.v3.MetricService - * @typedef GetMonitoredResourceDescriptorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.api.MonitoredResourceDescriptor} [response] MonitoredResourceDescriptor - */ - - /** - * Calls GetMonitoredResourceDescriptor. - * @function getMonitoredResourceDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} request GetMonitoredResourceDescriptorRequest message or plain object - * @param {google.monitoring.v3.MetricService.GetMonitoredResourceDescriptorCallback} callback Node-style callback called with the error, if any, and MonitoredResourceDescriptor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.getMonitoredResourceDescriptor = function getMonitoredResourceDescriptor(request, callback) { - return this.rpcCall(getMonitoredResourceDescriptor, $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest, $root.google.api.MonitoredResourceDescriptor, request, callback); - }, "name", { value: "GetMonitoredResourceDescriptor" }); - - /** - * Calls GetMonitoredResourceDescriptor. - * @function getMonitoredResourceDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} request GetMonitoredResourceDescriptorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.MetricService#listMetricDescriptors}. - * @memberof google.monitoring.v3.MetricService - * @typedef ListMetricDescriptorsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListMetricDescriptorsResponse} [response] ListMetricDescriptorsResponse - */ - - /** - * Calls ListMetricDescriptors. - * @function listMetricDescriptors - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IListMetricDescriptorsRequest} request ListMetricDescriptorsRequest message or plain object - * @param {google.monitoring.v3.MetricService.ListMetricDescriptorsCallback} callback Node-style callback called with the error, if any, and ListMetricDescriptorsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.listMetricDescriptors = function listMetricDescriptors(request, callback) { - return this.rpcCall(listMetricDescriptors, $root.google.monitoring.v3.ListMetricDescriptorsRequest, $root.google.monitoring.v3.ListMetricDescriptorsResponse, request, callback); - }, "name", { value: "ListMetricDescriptors" }); - - /** - * Calls ListMetricDescriptors. - * @function listMetricDescriptors - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IListMetricDescriptorsRequest} request ListMetricDescriptorsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.MetricService#getMetricDescriptor}. - * @memberof google.monitoring.v3.MetricService - * @typedef GetMetricDescriptorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.api.MetricDescriptor} [response] MetricDescriptor - */ - - /** - * Calls GetMetricDescriptor. - * @function getMetricDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IGetMetricDescriptorRequest} request GetMetricDescriptorRequest message or plain object - * @param {google.monitoring.v3.MetricService.GetMetricDescriptorCallback} callback Node-style callback called with the error, if any, and MetricDescriptor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.getMetricDescriptor = function getMetricDescriptor(request, callback) { - return this.rpcCall(getMetricDescriptor, $root.google.monitoring.v3.GetMetricDescriptorRequest, $root.google.api.MetricDescriptor, request, callback); - }, "name", { value: "GetMetricDescriptor" }); - - /** - * Calls GetMetricDescriptor. - * @function getMetricDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IGetMetricDescriptorRequest} request GetMetricDescriptorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.MetricService#createMetricDescriptor}. - * @memberof google.monitoring.v3.MetricService - * @typedef CreateMetricDescriptorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.api.MetricDescriptor} [response] MetricDescriptor - */ - - /** - * Calls CreateMetricDescriptor. - * @function createMetricDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} request CreateMetricDescriptorRequest message or plain object - * @param {google.monitoring.v3.MetricService.CreateMetricDescriptorCallback} callback Node-style callback called with the error, if any, and MetricDescriptor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.createMetricDescriptor = function createMetricDescriptor(request, callback) { - return this.rpcCall(createMetricDescriptor, $root.google.monitoring.v3.CreateMetricDescriptorRequest, $root.google.api.MetricDescriptor, request, callback); - }, "name", { value: "CreateMetricDescriptor" }); - - /** - * Calls CreateMetricDescriptor. - * @function createMetricDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} request CreateMetricDescriptorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.MetricService#deleteMetricDescriptor}. - * @memberof google.monitoring.v3.MetricService - * @typedef DeleteMetricDescriptorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteMetricDescriptor. - * @function deleteMetricDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} request DeleteMetricDescriptorRequest message or plain object - * @param {google.monitoring.v3.MetricService.DeleteMetricDescriptorCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.deleteMetricDescriptor = function deleteMetricDescriptor(request, callback) { - return this.rpcCall(deleteMetricDescriptor, $root.google.monitoring.v3.DeleteMetricDescriptorRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteMetricDescriptor" }); - - /** - * Calls DeleteMetricDescriptor. - * @function deleteMetricDescriptor - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} request DeleteMetricDescriptorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.MetricService#listTimeSeries}. - * @memberof google.monitoring.v3.MetricService - * @typedef ListTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListTimeSeriesResponse} [response] ListTimeSeriesResponse - */ - - /** - * Calls ListTimeSeries. - * @function listTimeSeries - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IListTimeSeriesRequest} request ListTimeSeriesRequest message or plain object - * @param {google.monitoring.v3.MetricService.ListTimeSeriesCallback} callback Node-style callback called with the error, if any, and ListTimeSeriesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.listTimeSeries = function listTimeSeries(request, callback) { - return this.rpcCall(listTimeSeries, $root.google.monitoring.v3.ListTimeSeriesRequest, $root.google.monitoring.v3.ListTimeSeriesResponse, request, callback); - }, "name", { value: "ListTimeSeries" }); - - /** - * Calls ListTimeSeries. - * @function listTimeSeries - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.IListTimeSeriesRequest} request ListTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.MetricService#createTimeSeries}. - * @memberof google.monitoring.v3.MetricService - * @typedef CreateTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CreateTimeSeries. - * @function createTimeSeries - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.ICreateTimeSeriesRequest} request CreateTimeSeriesRequest message or plain object - * @param {google.monitoring.v3.MetricService.CreateTimeSeriesCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricService.prototype.createTimeSeries = function createTimeSeries(request, callback) { - return this.rpcCall(createTimeSeries, $root.google.monitoring.v3.CreateTimeSeriesRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CreateTimeSeries" }); - - /** - * Calls CreateTimeSeries. - * @function createTimeSeries - * @memberof google.monitoring.v3.MetricService - * @instance - * @param {google.monitoring.v3.ICreateTimeSeriesRequest} request CreateTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return MetricService; - })(); - - v3.ListMonitoredResourceDescriptorsRequest = (function() { - - /** - * Properties of a ListMonitoredResourceDescriptorsRequest. - * @memberof google.monitoring.v3 - * @interface IListMonitoredResourceDescriptorsRequest - * @property {string|null} [name] ListMonitoredResourceDescriptorsRequest name - * @property {string|null} [filter] ListMonitoredResourceDescriptorsRequest filter - * @property {number|null} [pageSize] ListMonitoredResourceDescriptorsRequest pageSize - * @property {string|null} [pageToken] ListMonitoredResourceDescriptorsRequest pageToken - */ - - /** - * Constructs a new ListMonitoredResourceDescriptorsRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListMonitoredResourceDescriptorsRequest. - * @implements IListMonitoredResourceDescriptorsRequest - * @constructor - * @param {google.monitoring.v3.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) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListMonitoredResourceDescriptorsRequest name. - * @member {string} name - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest - * @instance - */ - ListMonitoredResourceDescriptorsRequest.prototype.name = ""; - - /** - * ListMonitoredResourceDescriptorsRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest - * @instance - */ - ListMonitoredResourceDescriptorsRequest.prototype.filter = ""; - - /** - * ListMonitoredResourceDescriptorsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest - * @instance - */ - ListMonitoredResourceDescriptorsRequest.prototype.pageSize = 0; - - /** - * ListMonitoredResourceDescriptorsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * ListGroupMembersRequest interval. + * @member {google.monitoring.v3.ITimeInterval|null|undefined} interval + * @memberof google.monitoring.v3.ListGroupMembersRequest * @instance */ - ListMonitoredResourceDescriptorsRequest.prototype.pageToken = ""; + ListGroupMembersRequest.prototype.interval = null; /** - * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. + * Creates a new ListGroupMembersRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest instance + * @param {google.monitoring.v3.IListGroupMembersRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest instance */ - ListMonitoredResourceDescriptorsRequest.create = function create(properties) { - return new ListMonitoredResourceDescriptorsRequest(properties); + ListGroupMembersRequest.create = function create(properties) { + return new ListGroupMembersRequest(properties); }; /** - * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. + * Encodes the specified ListGroupMembersRequest message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * @param {google.monitoring.v3.IListGroupMembersRequest} message ListGroupMembersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMonitoredResourceDescriptorsRequest.encode = function encode(message, writer) { + ListGroupMembersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.pageSize != null && message.hasOwnProperty("pageSize")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); if (message.pageToken != null && message.hasOwnProperty("pageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.interval != null && message.hasOwnProperty("interval")) + $root.google.monitoring.v3.TimeInterval.encode(message.interval, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); return writer; }; /** - * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. + * Encodes the specified ListGroupMembersRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode + * @param {google.monitoring.v3.IListGroupMembersRequest} message ListGroupMembersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMonitoredResourceDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListGroupMembersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer. + * Decodes a ListGroupMembersRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest + * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest * @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) { + ListGroupMembersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupMembersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: + case 7: message.name = reader.string(); break; - case 2: - message.filter = reader.string(); - break; case 3: message.pageSize = reader.int32(); break; case 4: message.pageToken = reader.string(); break; + case 5: + message.filter = reader.string(); + break; + case 6: + message.interval = $root.google.monitoring.v3.TimeInterval.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -7801,134 +7189,148 @@ }; /** - * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListGroupMembersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest + * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest * @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) { + ListGroupMembersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMonitoredResourceDescriptorsRequest message. + * Verifies a ListGroupMembersRequest message. * @function verify - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @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) { + ListGroupMembersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.monitoring.v3.TimeInterval.verify(message.interval); + if (error) + return "interval." + error; + } return null; }; /** - * Creates a ListMonitoredResourceDescriptorsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListGroupMembersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest + * @returns {google.monitoring.v3.ListGroupMembersRequest} ListGroupMembersRequest */ - ListMonitoredResourceDescriptorsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest) + ListGroupMembersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListGroupMembersRequest) return object; - var message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest(); + var message = new $root.google.monitoring.v3.ListGroupMembersRequest(); 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); + if (object.filter != null) + message.filter = String(object.filter); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.monitoring.v3.ListGroupMembersRequest.interval: object expected"); + message.interval = $root.google.monitoring.v3.TimeInterval.fromObject(object.interval); + } return message; }; /** - * Creates a plain object from a ListMonitoredResourceDescriptorsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListGroupMembersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @static - * @param {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest + * @param {google.monitoring.v3.ListGroupMembersRequest} message ListGroupMembersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMonitoredResourceDescriptorsRequest.toObject = function toObject(message, options) { + ListGroupMembersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.filter = ""; object.pageSize = 0; object.pageToken = ""; + object.filter = ""; + object.interval = null; object.name = ""; } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.monitoring.v3.TimeInterval.toObject(message.interval, options); if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** - * Converts this ListMonitoredResourceDescriptorsRequest to JSON. + * Converts this ListGroupMembersRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @memberof google.monitoring.v3.ListGroupMembersRequest * @instance * @returns {Object.} JSON object */ - ListMonitoredResourceDescriptorsRequest.prototype.toJSON = function toJSON() { + ListGroupMembersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListMonitoredResourceDescriptorsRequest; + return ListGroupMembersRequest; })(); - v3.ListMonitoredResourceDescriptorsResponse = (function() { + v3.ListGroupMembersResponse = (function() { /** - * Properties of a ListMonitoredResourceDescriptorsResponse. + * Properties of a ListGroupMembersResponse. * @memberof google.monitoring.v3 - * @interface IListMonitoredResourceDescriptorsResponse - * @property {Array.|null} [resourceDescriptors] ListMonitoredResourceDescriptorsResponse resourceDescriptors - * @property {string|null} [nextPageToken] ListMonitoredResourceDescriptorsResponse nextPageToken + * @interface IListGroupMembersResponse + * @property {Array.|null} [members] ListGroupMembersResponse members + * @property {string|null} [nextPageToken] ListGroupMembersResponse nextPageToken + * @property {number|null} [totalSize] ListGroupMembersResponse totalSize */ /** - * Constructs a new ListMonitoredResourceDescriptorsResponse. + * Constructs a new ListGroupMembersResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a ListMonitoredResourceDescriptorsResponse. - * @implements IListMonitoredResourceDescriptorsResponse + * @classdesc Represents a ListGroupMembersResponse. + * @implements IListGroupMembersResponse * @constructor - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set + * @param {google.monitoring.v3.IListGroupMembersResponse=} [properties] Properties to set */ - function ListMonitoredResourceDescriptorsResponse(properties) { - this.resourceDescriptors = []; + function ListGroupMembersResponse(properties) { + this.members = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7936,92 +7338,105 @@ } /** - * ListMonitoredResourceDescriptorsResponse resourceDescriptors. - * @member {Array.} resourceDescriptors - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * ListGroupMembersResponse members. + * @member {Array.} members + * @memberof google.monitoring.v3.ListGroupMembersResponse * @instance */ - ListMonitoredResourceDescriptorsResponse.prototype.resourceDescriptors = $util.emptyArray; + ListGroupMembersResponse.prototype.members = $util.emptyArray; /** - * ListMonitoredResourceDescriptorsResponse nextPageToken. + * ListGroupMembersResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @instance */ - ListMonitoredResourceDescriptorsResponse.prototype.nextPageToken = ""; + ListGroupMembersResponse.prototype.nextPageToken = ""; /** - * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. + * ListGroupMembersResponse totalSize. + * @member {number} totalSize + * @memberof google.monitoring.v3.ListGroupMembersResponse + * @instance + */ + ListGroupMembersResponse.prototype.totalSize = 0; + + /** + * Creates a new ListGroupMembersResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse instance + * @param {google.monitoring.v3.IListGroupMembersResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse instance */ - ListMonitoredResourceDescriptorsResponse.create = function create(properties) { - return new ListMonitoredResourceDescriptorsResponse(properties); + ListGroupMembersResponse.create = function create(properties) { + return new ListGroupMembersResponse(properties); }; /** - * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. + * Encodes the specified ListGroupMembersResponse message. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * @param {google.monitoring.v3.IListGroupMembersResponse} message ListGroupMembersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMonitoredResourceDescriptorsResponse.encode = function encode(message, writer) { + ListGroupMembersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - 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()).ldelim(); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.google.api.MonitoredResource.encode(message.members[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); return writer; }; /** - * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. + * Encodes the specified ListGroupMembersResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListGroupMembersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static - * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode + * @param {google.monitoring.v3.IListGroupMembersResponse} message ListGroupMembersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMonitoredResourceDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListGroupMembersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer. + * Decodes a ListGroupMembersResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse + * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse * @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) { + ListGroupMembersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListGroupMembersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.resourceDescriptors && message.resourceDescriptors.length)) - message.resourceDescriptors = []; - message.resourceDescriptors.push($root.google.api.MonitoredResourceDescriptor.decode(reader, reader.uint32())); - break; + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.google.api.MonitoredResource.decode(reader, reader.uint32())); + break; case 2: message.nextPageToken = reader.string(); break; + case 3: + message.totalSize = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -8031,133 +7446,143 @@ }; /** - * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListGroupMembersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse + * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse * @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) { + ListGroupMembersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMonitoredResourceDescriptorsResponse message. + * Verifies a ListGroupMembersResponse message. * @function verify - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @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) { + ListGroupMembersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceDescriptors != null && message.hasOwnProperty("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]); + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.google.api.MonitoredResource.verify(message.members[i]); if (error) - return "resourceDescriptors." + error; + return "members." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; return null; }; /** - * Creates a ListMonitoredResourceDescriptorsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListGroupMembersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse + * @returns {google.monitoring.v3.ListGroupMembersResponse} ListGroupMembersResponse */ - ListMonitoredResourceDescriptorsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse) + ListGroupMembersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListGroupMembersResponse) return object; - var message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse(); - if (object.resourceDescriptors) { - if (!Array.isArray(object.resourceDescriptors)) - throw TypeError(".google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: array expected"); - message.resourceDescriptors = []; - for (var i = 0; i < object.resourceDescriptors.length; ++i) { - if (typeof object.resourceDescriptors[i] !== "object") - throw TypeError(".google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: object expected"); - message.resourceDescriptors[i] = $root.google.api.MonitoredResourceDescriptor.fromObject(object.resourceDescriptors[i]); + var message = new $root.google.monitoring.v3.ListGroupMembersResponse(); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.monitoring.v3.ListGroupMembersResponse.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".google.monitoring.v3.ListGroupMembersResponse.members: object expected"); + message.members[i] = $root.google.api.MonitoredResource.fromObject(object.members[i]); } } if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListMonitoredResourceDescriptorsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListGroupMembersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @static - * @param {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse + * @param {google.monitoring.v3.ListGroupMembersResponse} message ListGroupMembersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMonitoredResourceDescriptorsResponse.toObject = function toObject(message, options) { + ListGroupMembersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.resourceDescriptors = []; - if (options.defaults) + object.members = []; + 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); + object.totalSize = 0; + } + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.google.api.MonitoredResource.toObject(message.members[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; return object; }; /** - * Converts this ListMonitoredResourceDescriptorsResponse to JSON. + * Converts this ListGroupMembersResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @memberof google.monitoring.v3.ListGroupMembersResponse * @instance * @returns {Object.} JSON object */ - ListMonitoredResourceDescriptorsResponse.prototype.toJSON = function toJSON() { + ListGroupMembersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListMonitoredResourceDescriptorsResponse; + return ListGroupMembersResponse; })(); - v3.GetMonitoredResourceDescriptorRequest = (function() { + v3.Point = (function() { /** - * Properties of a GetMonitoredResourceDescriptorRequest. + * Properties of a Point. * @memberof google.monitoring.v3 - * @interface IGetMonitoredResourceDescriptorRequest - * @property {string|null} [name] GetMonitoredResourceDescriptorRequest name + * @interface IPoint + * @property {google.monitoring.v3.ITimeInterval|null} [interval] Point interval + * @property {google.monitoring.v3.ITypedValue|null} [value] Point value */ /** - * Constructs a new GetMonitoredResourceDescriptorRequest. + * Constructs a new Point. * @memberof google.monitoring.v3 - * @classdesc Represents a GetMonitoredResourceDescriptorRequest. - * @implements IGetMonitoredResourceDescriptorRequest + * @classdesc Represents a Point. + * @implements IPoint * @constructor - * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IPoint=} [properties] Properties to set */ - function GetMonitoredResourceDescriptorRequest(properties) { + function Point(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8165,75 +7590,88 @@ } /** - * GetMonitoredResourceDescriptorRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * Point interval. + * @member {google.monitoring.v3.ITimeInterval|null|undefined} interval + * @memberof google.monitoring.v3.Point * @instance */ - GetMonitoredResourceDescriptorRequest.prototype.name = ""; + Point.prototype.interval = null; /** - * Creates a new GetMonitoredResourceDescriptorRequest instance using the specified properties. + * Point value. + * @member {google.monitoring.v3.ITypedValue|null|undefined} value + * @memberof google.monitoring.v3.Point + * @instance + */ + Point.prototype.value = null; + + /** + * Creates a new Point instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static - * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest instance + * @param {google.monitoring.v3.IPoint=} [properties] Properties to set + * @returns {google.monitoring.v3.Point} Point instance */ - GetMonitoredResourceDescriptorRequest.create = function create(properties) { - return new GetMonitoredResourceDescriptorRequest(properties); + Point.create = function create(properties) { + return new Point(properties); }; /** - * Encodes the specified GetMonitoredResourceDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. + * Encodes the specified Point message. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static - * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} message GetMonitoredResourceDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.IPoint} message Point message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMonitoredResourceDescriptorRequest.encode = function encode(message, writer) { + Point.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.interval != null && message.hasOwnProperty("interval")) + $root.google.monitoring.v3.TimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.value != null && message.hasOwnProperty("value")) + $root.google.monitoring.v3.TypedValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetMonitoredResourceDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static - * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} message GetMonitoredResourceDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.IPoint} message Point message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMonitoredResourceDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { + Point.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer. + * Decodes a Point message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest + * @returns {google.monitoring.v3.Point} Point * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMonitoredResourceDescriptorRequest.decode = function decode(reader, length) { + Point.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Point(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); + case 1: + message.interval = $root.google.monitoring.v3.TimeInterval.decode(reader, reader.uint32()); + break; + case 2: + message.value = $root.google.monitoring.v3.TypedValue.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8244,110 +7682,132 @@ }; /** - * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a Point message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest + * @returns {google.monitoring.v3.Point} Point * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMonitoredResourceDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { + Point.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetMonitoredResourceDescriptorRequest message. + * Verifies a Point message. * @function verify - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetMonitoredResourceDescriptorRequest.verify = function verify(message) { + Point.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.monitoring.v3.TimeInterval.verify(message.interval); + if (error) + return "interval." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.monitoring.v3.TypedValue.verify(message.value); + if (error) + return "value." + error; + } return null; }; /** - * Creates a GetMonitoredResourceDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Point message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest + * @returns {google.monitoring.v3.Point} Point */ - GetMonitoredResourceDescriptorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest) + Point.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Point) return object; - var message = new $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.monitoring.v3.Point(); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.monitoring.v3.Point.interval: object expected"); + message.interval = $root.google.monitoring.v3.TimeInterval.fromObject(object.interval); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.monitoring.v3.Point.value: object expected"); + message.value = $root.google.monitoring.v3.TypedValue.fromObject(object.value); + } return message; }; /** - * Creates a plain object from a GetMonitoredResourceDescriptorRequest message. Also converts values to other types if specified. + * Creates a plain object from a Point message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @static - * @param {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} message GetMonitoredResourceDescriptorRequest + * @param {google.monitoring.v3.Point} message Point * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetMonitoredResourceDescriptorRequest.toObject = function toObject(message, options) { + Point.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.interval = null; + object.value = null; + } + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.monitoring.v3.TimeInterval.toObject(message.interval, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.monitoring.v3.TypedValue.toObject(message.value, options); return object; }; /** - * Converts this GetMonitoredResourceDescriptorRequest to JSON. + * Converts this Point to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest + * @memberof google.monitoring.v3.Point * @instance * @returns {Object.} JSON object */ - GetMonitoredResourceDescriptorRequest.prototype.toJSON = function toJSON() { + Point.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetMonitoredResourceDescriptorRequest; + return Point; })(); - v3.ListMetricDescriptorsRequest = (function() { + v3.TimeSeries = (function() { /** - * Properties of a ListMetricDescriptorsRequest. + * Properties of a TimeSeries. * @memberof google.monitoring.v3 - * @interface IListMetricDescriptorsRequest - * @property {string|null} [name] ListMetricDescriptorsRequest name - * @property {string|null} [filter] ListMetricDescriptorsRequest filter - * @property {number|null} [pageSize] ListMetricDescriptorsRequest pageSize - * @property {string|null} [pageToken] ListMetricDescriptorsRequest pageToken + * @interface ITimeSeries + * @property {google.api.IMetric|null} [metric] TimeSeries metric + * @property {google.api.IMonitoredResource|null} [resource] TimeSeries resource + * @property {google.api.IMonitoredResourceMetadata|null} [metadata] TimeSeries metadata + * @property {google.api.MetricDescriptor.MetricKind|null} [metricKind] TimeSeries metricKind + * @property {google.api.MetricDescriptor.ValueType|null} [valueType] TimeSeries valueType + * @property {Array.|null} [points] TimeSeries points */ /** - * Constructs a new ListMetricDescriptorsRequest. + * Constructs a new TimeSeries. * @memberof google.monitoring.v3 - * @classdesc Represents a ListMetricDescriptorsRequest. - * @implements IListMetricDescriptorsRequest + * @classdesc Represents a TimeSeries. + * @implements ITimeSeries * @constructor - * @param {google.monitoring.v3.IListMetricDescriptorsRequest=} [properties] Properties to set + * @param {google.monitoring.v3.ITimeSeries=} [properties] Properties to set */ - function ListMetricDescriptorsRequest(properties) { + function TimeSeries(properties) { + this.points = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8355,114 +7815,143 @@ } /** - * ListMetricDescriptorsRequest name. - * @member {string} name - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * TimeSeries metric. + * @member {google.api.IMetric|null|undefined} metric + * @memberof google.monitoring.v3.TimeSeries * @instance */ - ListMetricDescriptorsRequest.prototype.name = ""; + TimeSeries.prototype.metric = null; /** - * ListMetricDescriptorsRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * TimeSeries resource. + * @member {google.api.IMonitoredResource|null|undefined} resource + * @memberof google.monitoring.v3.TimeSeries * @instance */ - ListMetricDescriptorsRequest.prototype.filter = ""; + TimeSeries.prototype.resource = null; /** - * ListMetricDescriptorsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * TimeSeries metadata. + * @member {google.api.IMonitoredResourceMetadata|null|undefined} metadata + * @memberof google.monitoring.v3.TimeSeries * @instance */ - ListMetricDescriptorsRequest.prototype.pageSize = 0; + TimeSeries.prototype.metadata = null; /** - * ListMetricDescriptorsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * TimeSeries metricKind. + * @member {google.api.MetricDescriptor.MetricKind} metricKind + * @memberof google.monitoring.v3.TimeSeries * @instance */ - ListMetricDescriptorsRequest.prototype.pageToken = ""; + TimeSeries.prototype.metricKind = 0; /** - * Creates a new ListMetricDescriptorsRequest instance using the specified properties. + * TimeSeries valueType. + * @member {google.api.MetricDescriptor.ValueType} valueType + * @memberof google.monitoring.v3.TimeSeries + * @instance + */ + TimeSeries.prototype.valueType = 0; + + /** + * TimeSeries points. + * @member {Array.} points + * @memberof google.monitoring.v3.TimeSeries + * @instance + */ + TimeSeries.prototype.points = $util.emptyArray; + + /** + * Creates a new TimeSeries instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static - * @param {google.monitoring.v3.IListMetricDescriptorsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest instance + * @param {google.monitoring.v3.ITimeSeries=} [properties] Properties to set + * @returns {google.monitoring.v3.TimeSeries} TimeSeries instance */ - ListMetricDescriptorsRequest.create = function create(properties) { - return new ListMetricDescriptorsRequest(properties); + TimeSeries.create = function create(properties) { + return new TimeSeries(properties); }; /** - * Encodes the specified ListMetricDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. + * Encodes the specified TimeSeries message. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static - * @param {google.monitoring.v3.IListMetricDescriptorsRequest} message ListMetricDescriptorsRequest message or plain object to encode + * @param {google.monitoring.v3.ITimeSeries} message TimeSeries message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMetricDescriptorsRequest.encode = function encode(message, writer) { + TimeSeries.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.metric != null && message.hasOwnProperty("metric")) + $root.google.api.Metric.encode(message.metric, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resource != null && message.hasOwnProperty("resource")) + $root.google.api.MonitoredResource.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.metricKind); + if (message.valueType != null && message.hasOwnProperty("valueType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); + if (message.points != null && message.points.length) + for (var i = 0; i < message.points.length; ++i) + $root.google.monitoring.v3.Point.encode(message.points[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metadata != null && message.hasOwnProperty("metadata")) + $root.google.api.MonitoredResourceMetadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListMetricDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. + * Encodes the specified TimeSeries message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static - * @param {google.monitoring.v3.IListMetricDescriptorsRequest} message ListMetricDescriptorsRequest message or plain object to encode + * @param {google.monitoring.v3.ITimeSeries} message TimeSeries message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMetricDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + TimeSeries.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer. + * Decodes a TimeSeries message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest + * @returns {google.monitoring.v3.TimeSeries} TimeSeries * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMetricDescriptorsRequest.decode = function decode(reader, length) { + TimeSeries.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMetricDescriptorsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeSeries(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.name = reader.string(); + case 1: + message.metric = $root.google.api.Metric.decode(reader, reader.uint32()); break; case 2: - message.filter = reader.string(); + message.resource = $root.google.api.MonitoredResource.decode(reader, reader.uint32()); + break; + case 7: + message.metadata = $root.google.api.MonitoredResourceMetadata.decode(reader, reader.uint32()); break; case 3: - message.pageSize = reader.int32(); + message.metricKind = reader.int32(); break; case 4: - message.pageToken = reader.string(); + message.valueType = reader.int32(); + break; + case 5: + if (!(message.points && message.points.length)) + message.points = []; + message.points.push($root.google.monitoring.v3.Point.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -8473,551 +7962,544 @@ }; /** - * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer, length delimited. + * Decodes a TimeSeries message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest + * @returns {google.monitoring.v3.TimeSeries} TimeSeries * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMetricDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { + TimeSeries.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMetricDescriptorsRequest message. + * Verifies a TimeSeries message. * @function verify - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMetricDescriptorsRequest.verify = function verify(message) { + TimeSeries.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.metric != null && message.hasOwnProperty("metric")) { + var error = $root.google.api.Metric.verify(message.metric); + if (error) + return "metric." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.api.MonitoredResource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.api.MonitoredResourceMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + switch (message.metricKind) { + default: + return "metricKind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.points != null && message.hasOwnProperty("points")) { + if (!Array.isArray(message.points)) + return "points: array expected"; + for (var i = 0; i < message.points.length; ++i) { + var error = $root.google.monitoring.v3.Point.verify(message.points[i]); + if (error) + return "points." + error; + } + } return null; }; /** - * Creates a ListMetricDescriptorsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TimeSeries message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest + * @returns {google.monitoring.v3.TimeSeries} TimeSeries */ - ListMetricDescriptorsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListMetricDescriptorsRequest) + TimeSeries.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.TimeSeries) return object; - var message = new $root.google.monitoring.v3.ListMetricDescriptorsRequest(); - 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 ListMetricDescriptorsRequest message. Also converts values to other types if specified. + var message = new $root.google.monitoring.v3.TimeSeries(); + if (object.metric != null) { + if (typeof object.metric !== "object") + throw TypeError(".google.monitoring.v3.TimeSeries.metric: object expected"); + message.metric = $root.google.api.Metric.fromObject(object.metric); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.monitoring.v3.TimeSeries.resource: object expected"); + message.resource = $root.google.api.MonitoredResource.fromObject(object.resource); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.monitoring.v3.TimeSeries.metadata: object expected"); + message.metadata = $root.google.api.MonitoredResourceMetadata.fromObject(object.metadata); + } + switch (object.metricKind) { + case "METRIC_KIND_UNSPECIFIED": + case 0: + message.metricKind = 0; + break; + case "GAUGE": + case 1: + message.metricKind = 1; + break; + case "DELTA": + case 2: + message.metricKind = 2; + break; + case "CUMULATIVE": + case 3: + message.metricKind = 3; + break; + } + switch (object.valueType) { + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "BOOL": + case 1: + message.valueType = 1; + break; + case "INT64": + case 2: + message.valueType = 2; + break; + case "DOUBLE": + case 3: + message.valueType = 3; + break; + case "STRING": + case 4: + message.valueType = 4; + break; + case "DISTRIBUTION": + case 5: + message.valueType = 5; + break; + case "MONEY": + case 6: + message.valueType = 6; + break; + } + if (object.points) { + if (!Array.isArray(object.points)) + throw TypeError(".google.monitoring.v3.TimeSeries.points: array expected"); + message.points = []; + for (var i = 0; i < object.points.length; ++i) { + if (typeof object.points[i] !== "object") + throw TypeError(".google.monitoring.v3.TimeSeries.points: object expected"); + message.points[i] = $root.google.monitoring.v3.Point.fromObject(object.points[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimeSeries message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @static - * @param {google.monitoring.v3.ListMetricDescriptorsRequest} message ListMetricDescriptorsRequest + * @param {google.monitoring.v3.TimeSeries} message TimeSeries * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMetricDescriptorsRequest.toObject = function toObject(message, options) { + TimeSeries.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.points = []; if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; + object.metric = null; + object.resource = null; + object.metricKind = options.enums === String ? "METRIC_KIND_UNSPECIFIED" : 0; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.metadata = null; } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = $root.google.api.Metric.toObject(message.metric, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.api.MonitoredResource.toObject(message.resource, options); + if (message.metricKind != null && message.hasOwnProperty("metricKind")) + object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; + if (message.points && message.points.length) { + object.points = []; + for (var j = 0; j < message.points.length; ++j) + object.points[j] = $root.google.monitoring.v3.Point.toObject(message.points[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.api.MonitoredResourceMetadata.toObject(message.metadata, options); return object; }; /** - * Converts this ListMetricDescriptorsRequest to JSON. + * Converts this TimeSeries to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @memberof google.monitoring.v3.TimeSeries * @instance * @returns {Object.} JSON object */ - ListMetricDescriptorsRequest.prototype.toJSON = function toJSON() { + TimeSeries.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListMetricDescriptorsRequest; + return TimeSeries; })(); - v3.ListMetricDescriptorsResponse = (function() { - - /** - * Properties of a ListMetricDescriptorsResponse. - * @memberof google.monitoring.v3 - * @interface IListMetricDescriptorsResponse - * @property {Array.|null} [metricDescriptors] ListMetricDescriptorsResponse metricDescriptors - * @property {string|null} [nextPageToken] ListMetricDescriptorsResponse nextPageToken - */ + v3.MetricService = (function() { /** - * Constructs a new ListMetricDescriptorsResponse. + * Constructs a new MetricService service. * @memberof google.monitoring.v3 - * @classdesc Represents a ListMetricDescriptorsResponse. - * @implements IListMetricDescriptorsResponse + * @classdesc Represents a MetricService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.monitoring.v3.IListMetricDescriptorsResponse=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function ListMetricDescriptorsResponse(properties) { - this.metricDescriptors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function MetricService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * ListMetricDescriptorsResponse metricDescriptors. - * @member {Array.} metricDescriptors - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @instance - */ - ListMetricDescriptorsResponse.prototype.metricDescriptors = $util.emptyArray; - - /** - * ListMetricDescriptorsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @instance - */ - ListMetricDescriptorsResponse.prototype.nextPageToken = ""; + (MetricService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricService; /** - * Creates a new ListMetricDescriptorsResponse instance using the specified properties. + * Creates new MetricService service using the specified rpc implementation. * @function create - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse + * @memberof google.monitoring.v3.MetricService * @static - * @param {google.monitoring.v3.IListMetricDescriptorsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse instance + * @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 {MetricService} RPC service. Useful where requests and/or responses are streamed. */ - ListMetricDescriptorsResponse.create = function create(properties) { - return new ListMetricDescriptorsResponse(properties); + MetricService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified ListMetricDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {google.monitoring.v3.IListMetricDescriptorsResponse} message ListMetricDescriptorsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.monitoring.v3.MetricService#listMonitoredResourceDescriptors}. + * @memberof google.monitoring.v3.MetricService + * @typedef ListMonitoredResourceDescriptorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} [response] ListMonitoredResourceDescriptorsResponse */ - ListMetricDescriptorsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metricDescriptors != null && message.metricDescriptors.length) - for (var i = 0; i < message.metricDescriptors.length; ++i) - $root.google.api.MetricDescriptor.encode(message.metricDescriptors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; /** - * Encodes the specified ListMetricDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {google.monitoring.v3.IListMetricDescriptorsResponse} message ListMetricDescriptorsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListMonitoredResourceDescriptors. + * @function listMonitoredResourceDescriptors + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object + * @param {google.monitoring.v3.MetricService.ListMonitoredResourceDescriptorsCallback} callback Node-style callback called with the error, if any, and ListMonitoredResourceDescriptorsResponse + * @returns {undefined} + * @variation 1 */ - ListMetricDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(MetricService.prototype.listMonitoredResourceDescriptors = function listMonitoredResourceDescriptors(request, callback) { + return this.rpcCall(listMonitoredResourceDescriptors, $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest, $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse, request, callback); + }, "name", { value: "ListMonitoredResourceDescriptors" }); /** - * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListMonitoredResourceDescriptors. + * @function listMonitoredResourceDescriptors + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} request ListMonitoredResourceDescriptorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMetricDescriptorsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMetricDescriptorsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.metricDescriptors && message.metricDescriptors.length)) - message.metricDescriptors = []; - message.metricDescriptors.push($root.google.api.MetricDescriptor.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.MetricService#getMonitoredResourceDescriptor}. + * @memberof google.monitoring.v3.MetricService + * @typedef GetMonitoredResourceDescriptorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.MonitoredResourceDescriptor} [response] MonitoredResourceDescriptor */ - ListMetricDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a ListMetricDescriptorsResponse message. - * @function verify - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetMonitoredResourceDescriptor. + * @function getMonitoredResourceDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} request GetMonitoredResourceDescriptorRequest message or plain object + * @param {google.monitoring.v3.MetricService.GetMonitoredResourceDescriptorCallback} callback Node-style callback called with the error, if any, and MonitoredResourceDescriptor + * @returns {undefined} + * @variation 1 */ - ListMetricDescriptorsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metricDescriptors != null && message.hasOwnProperty("metricDescriptors")) { - if (!Array.isArray(message.metricDescriptors)) - return "metricDescriptors: array expected"; - for (var i = 0; i < message.metricDescriptors.length; ++i) { - var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptors[i]); - if (error) - return "metricDescriptors." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + Object.defineProperty(MetricService.prototype.getMonitoredResourceDescriptor = function getMonitoredResourceDescriptor(request, callback) { + return this.rpcCall(getMonitoredResourceDescriptor, $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest, $root.google.api.MonitoredResourceDescriptor, request, callback); + }, "name", { value: "GetMonitoredResourceDescriptor" }); /** - * Creates a ListMetricDescriptorsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse + * Calls GetMonitoredResourceDescriptor. + * @function getMonitoredResourceDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} request GetMonitoredResourceDescriptorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMetricDescriptorsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListMetricDescriptorsResponse) - return object; - var message = new $root.google.monitoring.v3.ListMetricDescriptorsResponse(); - if (object.metricDescriptors) { - if (!Array.isArray(object.metricDescriptors)) - throw TypeError(".google.monitoring.v3.ListMetricDescriptorsResponse.metricDescriptors: array expected"); - message.metricDescriptors = []; - for (var i = 0; i < object.metricDescriptors.length; ++i) { - if (typeof object.metricDescriptors[i] !== "object") - throw TypeError(".google.monitoring.v3.ListMetricDescriptorsResponse.metricDescriptors: object expected"); - message.metricDescriptors[i] = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptors[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; /** - * Creates a plain object from a ListMetricDescriptorsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse - * @static - * @param {google.monitoring.v3.ListMetricDescriptorsResponse} message ListMetricDescriptorsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.monitoring.v3.MetricService#listMetricDescriptors}. + * @memberof google.monitoring.v3.MetricService + * @typedef ListMetricDescriptorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListMetricDescriptorsResponse} [response] ListMetricDescriptorsResponse */ - ListMetricDescriptorsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.metricDescriptors = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.metricDescriptors && message.metricDescriptors.length) { - object.metricDescriptors = []; - for (var j = 0; j < message.metricDescriptors.length; ++j) - object.metricDescriptors[j] = $root.google.api.MetricDescriptor.toObject(message.metricDescriptors[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; /** - * Converts this ListMetricDescriptorsResponse to JSON. - * @function toJSON - * @memberof google.monitoring.v3.ListMetricDescriptorsResponse + * Calls ListMetricDescriptors. + * @function listMetricDescriptors + * @memberof google.monitoring.v3.MetricService * @instance - * @returns {Object.} JSON object + * @param {google.monitoring.v3.IListMetricDescriptorsRequest} request ListMetricDescriptorsRequest message or plain object + * @param {google.monitoring.v3.MetricService.ListMetricDescriptorsCallback} callback Node-style callback called with the error, if any, and ListMetricDescriptorsResponse + * @returns {undefined} + * @variation 1 */ - ListMetricDescriptorsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListMetricDescriptorsResponse; - })(); + Object.defineProperty(MetricService.prototype.listMetricDescriptors = function listMetricDescriptors(request, callback) { + return this.rpcCall(listMetricDescriptors, $root.google.monitoring.v3.ListMetricDescriptorsRequest, $root.google.monitoring.v3.ListMetricDescriptorsResponse, request, callback); + }, "name", { value: "ListMetricDescriptors" }); - v3.GetMetricDescriptorRequest = (function() { + /** + * Calls ListMetricDescriptors. + * @function listMetricDescriptors + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IListMetricDescriptorsRequest} request ListMetricDescriptorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Properties of a GetMetricDescriptorRequest. - * @memberof google.monitoring.v3 - * @interface IGetMetricDescriptorRequest - * @property {string|null} [name] GetMetricDescriptorRequest name + * Callback as used by {@link google.monitoring.v3.MetricService#getMetricDescriptor}. + * @memberof google.monitoring.v3.MetricService + * @typedef GetMetricDescriptorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.MetricDescriptor} [response] MetricDescriptor */ /** - * Constructs a new GetMetricDescriptorRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a GetMetricDescriptorRequest. - * @implements IGetMetricDescriptorRequest - * @constructor - * @param {google.monitoring.v3.IGetMetricDescriptorRequest=} [properties] Properties to set + * Calls GetMetricDescriptor. + * @function getMetricDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IGetMetricDescriptorRequest} request GetMetricDescriptorRequest message or plain object + * @param {google.monitoring.v3.MetricService.GetMetricDescriptorCallback} callback Node-style callback called with the error, if any, and MetricDescriptor + * @returns {undefined} + * @variation 1 */ - function GetMetricDescriptorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(MetricService.prototype.getMetricDescriptor = function getMetricDescriptor(request, callback) { + return this.rpcCall(getMetricDescriptor, $root.google.monitoring.v3.GetMetricDescriptorRequest, $root.google.api.MetricDescriptor, request, callback); + }, "name", { value: "GetMetricDescriptor" }); /** - * GetMetricDescriptorRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetMetricDescriptorRequest + * Calls GetMetricDescriptor. + * @function getMetricDescriptor + * @memberof google.monitoring.v3.MetricService * @instance + * @param {google.monitoring.v3.IGetMetricDescriptorRequest} request GetMetricDescriptorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMetricDescriptorRequest.prototype.name = ""; /** - * Creates a new GetMetricDescriptorRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {google.monitoring.v3.IGetMetricDescriptorRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest instance + * Callback as used by {@link google.monitoring.v3.MetricService#createMetricDescriptor}. + * @memberof google.monitoring.v3.MetricService + * @typedef CreateMetricDescriptorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.MetricDescriptor} [response] MetricDescriptor */ - GetMetricDescriptorRequest.create = function create(properties) { - return new GetMetricDescriptorRequest(properties); - }; /** - * Encodes the specified GetMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {google.monitoring.v3.IGetMetricDescriptorRequest} message GetMetricDescriptorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateMetricDescriptor. + * @function createMetricDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} request CreateMetricDescriptorRequest message or plain object + * @param {google.monitoring.v3.MetricService.CreateMetricDescriptorCallback} callback Node-style callback called with the error, if any, and MetricDescriptor + * @returns {undefined} + * @variation 1 */ - GetMetricDescriptorRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; + Object.defineProperty(MetricService.prototype.createMetricDescriptor = function createMetricDescriptor(request, callback) { + return this.rpcCall(createMetricDescriptor, $root.google.monitoring.v3.CreateMetricDescriptorRequest, $root.google.api.MetricDescriptor, request, callback); + }, "name", { value: "CreateMetricDescriptor" }); /** - * Encodes the specified GetMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {google.monitoring.v3.IGetMetricDescriptorRequest} message GetMetricDescriptorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateMetricDescriptor. + * @function createMetricDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} request CreateMetricDescriptorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMetricDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.MetricService#deleteMetricDescriptor}. + * @memberof google.monitoring.v3.MetricService + * @typedef DeleteMetricDescriptorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - GetMetricDescriptorRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetMetricDescriptorRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteMetricDescriptor. + * @function deleteMetricDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} request DeleteMetricDescriptorRequest message or plain object + * @param {google.monitoring.v3.MetricService.DeleteMetricDescriptorCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - GetMetricDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(MetricService.prototype.deleteMetricDescriptor = function deleteMetricDescriptor(request, callback) { + return this.rpcCall(deleteMetricDescriptor, $root.google.monitoring.v3.DeleteMetricDescriptorRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMetricDescriptor" }); /** - * Verifies a GetMetricDescriptorRequest message. - * @function verify - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls DeleteMetricDescriptor. + * @function deleteMetricDescriptor + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} request DeleteMetricDescriptorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMetricDescriptorRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; /** - * Creates a GetMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest + * Callback as used by {@link google.monitoring.v3.MetricService#listTimeSeries}. + * @memberof google.monitoring.v3.MetricService + * @typedef ListTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListTimeSeriesResponse} [response] ListTimeSeriesResponse */ - GetMetricDescriptorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetMetricDescriptorRequest) - return object; - var message = new $root.google.monitoring.v3.GetMetricDescriptorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a GetMetricDescriptorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.GetMetricDescriptorRequest - * @static - * @param {google.monitoring.v3.GetMetricDescriptorRequest} message GetMetricDescriptorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ListTimeSeries. + * @function listTimeSeries + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.IListTimeSeriesRequest} request ListTimeSeriesRequest message or plain object + * @param {google.monitoring.v3.MetricService.ListTimeSeriesCallback} callback Node-style callback called with the error, if any, and ListTimeSeriesResponse + * @returns {undefined} + * @variation 1 */ - GetMetricDescriptorRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + Object.defineProperty(MetricService.prototype.listTimeSeries = function listTimeSeries(request, callback) { + return this.rpcCall(listTimeSeries, $root.google.monitoring.v3.ListTimeSeriesRequest, $root.google.monitoring.v3.ListTimeSeriesResponse, request, callback); + }, "name", { value: "ListTimeSeries" }); /** - * Converts this GetMetricDescriptorRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.GetMetricDescriptorRequest + * Calls ListTimeSeries. + * @function listTimeSeries + * @memberof google.monitoring.v3.MetricService * @instance - * @returns {Object.} JSON object + * @param {google.monitoring.v3.IListTimeSeriesRequest} request ListTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMetricDescriptorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return GetMetricDescriptorRequest; + /** + * Callback as used by {@link google.monitoring.v3.MetricService#createTimeSeries}. + * @memberof google.monitoring.v3.MetricService + * @typedef CreateTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CreateTimeSeries. + * @function createTimeSeries + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.ICreateTimeSeriesRequest} request CreateTimeSeriesRequest message or plain object + * @param {google.monitoring.v3.MetricService.CreateTimeSeriesCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetricService.prototype.createTimeSeries = function createTimeSeries(request, callback) { + return this.rpcCall(createTimeSeries, $root.google.monitoring.v3.CreateTimeSeriesRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CreateTimeSeries" }); + + /** + * Calls CreateTimeSeries. + * @function createTimeSeries + * @memberof google.monitoring.v3.MetricService + * @instance + * @param {google.monitoring.v3.ICreateTimeSeriesRequest} request CreateTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MetricService; })(); - v3.CreateMetricDescriptorRequest = (function() { + v3.ListMonitoredResourceDescriptorsRequest = (function() { /** - * Properties of a CreateMetricDescriptorRequest. + * Properties of a ListMonitoredResourceDescriptorsRequest. * @memberof google.monitoring.v3 - * @interface ICreateMetricDescriptorRequest - * @property {string|null} [name] CreateMetricDescriptorRequest name - * @property {google.api.IMetricDescriptor|null} [metricDescriptor] CreateMetricDescriptorRequest metricDescriptor + * @interface IListMonitoredResourceDescriptorsRequest + * @property {string|null} [name] ListMonitoredResourceDescriptorsRequest name + * @property {string|null} [filter] ListMonitoredResourceDescriptorsRequest filter + * @property {number|null} [pageSize] ListMonitoredResourceDescriptorsRequest pageSize + * @property {string|null} [pageToken] ListMonitoredResourceDescriptorsRequest pageToken */ /** - * Constructs a new CreateMetricDescriptorRequest. + * Constructs a new ListMonitoredResourceDescriptorsRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a CreateMetricDescriptorRequest. - * @implements ICreateMetricDescriptorRequest + * @classdesc Represents a ListMonitoredResourceDescriptorsRequest. + * @implements IListMonitoredResourceDescriptorsRequest * @constructor - * @param {google.monitoring.v3.ICreateMetricDescriptorRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set */ - function CreateMetricDescriptorRequest(properties) { + function ListMonitoredResourceDescriptorsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9025,88 +8507,114 @@ } /** - * CreateMetricDescriptorRequest name. + * ListMonitoredResourceDescriptorsRequest name. * @member {string} name - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @instance */ - CreateMetricDescriptorRequest.prototype.name = ""; + ListMonitoredResourceDescriptorsRequest.prototype.name = ""; /** - * CreateMetricDescriptorRequest metricDescriptor. - * @member {google.api.IMetricDescriptor|null|undefined} metricDescriptor - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * ListMonitoredResourceDescriptorsRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @instance */ - CreateMetricDescriptorRequest.prototype.metricDescriptor = null; + ListMonitoredResourceDescriptorsRequest.prototype.filter = ""; /** - * Creates a new CreateMetricDescriptorRequest instance using the specified properties. + * ListMonitoredResourceDescriptorsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @instance + */ + ListMonitoredResourceDescriptorsRequest.prototype.pageSize = 0; + + /** + * ListMonitoredResourceDescriptorsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest + * @instance + */ + ListMonitoredResourceDescriptorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMonitoredResourceDescriptorsRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static - * @param {google.monitoring.v3.ICreateMetricDescriptorRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest instance + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest instance */ - CreateMetricDescriptorRequest.create = function create(properties) { - return new CreateMetricDescriptorRequest(properties); + ListMonitoredResourceDescriptorsRequest.create = function create(properties) { + return new ListMonitoredResourceDescriptorsRequest(properties); }; /** - * Encodes the specified CreateMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. + * Encodes the specified ListMonitoredResourceDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static - * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} message CreateMetricDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMetricDescriptorRequest.encode = function encode(message, writer) { + ListMonitoredResourceDescriptorsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) - $root.google.api.MetricDescriptor.encode(message.metricDescriptor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); return writer; }; /** - * Encodes the specified CreateMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. + * Encodes the specified ListMonitoredResourceDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static - * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} message CreateMetricDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMetricDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMonitoredResourceDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer. + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMetricDescriptorRequest.decode = function decode(reader, length) { + ListMonitoredResourceDescriptorsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateMetricDescriptorRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: + case 5: message.name = reader.string(); break; case 2: - message.metricDescriptor = $root.google.api.MetricDescriptor.decode(reader, reader.uint32()); + message.filter = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9117,121 +8625,134 @@ }; /** - * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMonitoredResourceDescriptorsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMetricDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { + ListMonitoredResourceDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateMetricDescriptorRequest message. + * Verifies a ListMonitoredResourceDescriptorsRequest message. * @function verify - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateMetricDescriptorRequest.verify = function verify(message) { + ListMonitoredResourceDescriptorsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) { - var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptor); - if (error) - return "metricDescriptor." + error; - } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a CreateMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMonitoredResourceDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} ListMonitoredResourceDescriptorsRequest */ - CreateMetricDescriptorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateMetricDescriptorRequest) + ListMonitoredResourceDescriptorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest) return object; - var message = new $root.google.monitoring.v3.CreateMetricDescriptorRequest(); + var message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest(); if (object.name != null) message.name = String(object.name); - if (object.metricDescriptor != null) { - if (typeof object.metricDescriptor !== "object") - throw TypeError(".google.monitoring.v3.CreateMetricDescriptorRequest.metricDescriptor: object expected"); - message.metricDescriptor = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptor); - } + 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 CreateMetricDescriptorRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMonitoredResourceDescriptorsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @static - * @param {google.monitoring.v3.CreateMetricDescriptorRequest} message CreateMetricDescriptorRequest + * @param {google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} message ListMonitoredResourceDescriptorsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateMetricDescriptorRequest.toObject = function toObject(message, options) { + ListMonitoredResourceDescriptorsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.metricDescriptor = null; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; object.name = ""; } - if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) - object.metricDescriptor = $root.google.api.MetricDescriptor.toObject(message.metricDescriptor, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** - * Converts this CreateMetricDescriptorRequest to JSON. + * Converts this ListMonitoredResourceDescriptorsRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsRequest * @instance * @returns {Object.} JSON object */ - CreateMetricDescriptorRequest.prototype.toJSON = function toJSON() { + ListMonitoredResourceDescriptorsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateMetricDescriptorRequest; + return ListMonitoredResourceDescriptorsRequest; })(); - v3.DeleteMetricDescriptorRequest = (function() { + v3.ListMonitoredResourceDescriptorsResponse = (function() { /** - * Properties of a DeleteMetricDescriptorRequest. + * Properties of a ListMonitoredResourceDescriptorsResponse. * @memberof google.monitoring.v3 - * @interface IDeleteMetricDescriptorRequest - * @property {string|null} [name] DeleteMetricDescriptorRequest name + * @interface IListMonitoredResourceDescriptorsResponse + * @property {Array.|null} [resourceDescriptors] ListMonitoredResourceDescriptorsResponse resourceDescriptors + * @property {string|null} [nextPageToken] ListMonitoredResourceDescriptorsResponse nextPageToken */ /** - * Constructs a new DeleteMetricDescriptorRequest. + * Constructs a new ListMonitoredResourceDescriptorsResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteMetricDescriptorRequest. - * @implements IDeleteMetricDescriptorRequest + * @classdesc Represents a ListMonitoredResourceDescriptorsResponse. + * @implements IListMonitoredResourceDescriptorsResponse * @constructor - * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set */ - function DeleteMetricDescriptorRequest(properties) { + function ListMonitoredResourceDescriptorsResponse(properties) { + this.resourceDescriptors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9239,75 +8760,91 @@ } /** - * DeleteMetricDescriptorRequest name. - * @member {string} name - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * ListMonitoredResourceDescriptorsResponse resourceDescriptors. + * @member {Array.} resourceDescriptors + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @instance */ - DeleteMetricDescriptorRequest.prototype.name = ""; + ListMonitoredResourceDescriptorsResponse.prototype.resourceDescriptors = $util.emptyArray; /** - * Creates a new DeleteMetricDescriptorRequest instance using the specified properties. + * ListMonitoredResourceDescriptorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse + * @instance + */ + ListMonitoredResourceDescriptorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMonitoredResourceDescriptorsResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static - * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest instance + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse instance */ - DeleteMetricDescriptorRequest.create = function create(properties) { - return new DeleteMetricDescriptorRequest(properties); + ListMonitoredResourceDescriptorsResponse.create = function create(properties) { + return new ListMonitoredResourceDescriptorsResponse(properties); }; /** - * Encodes the specified DeleteMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. + * Encodes the specified ListMonitoredResourceDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static - * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} message DeleteMetricDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteMetricDescriptorRequest.encode = function encode(message, writer) { + ListMonitoredResourceDescriptorsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + 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()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified DeleteMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. + * Encodes the specified ListMonitoredResourceDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static - * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} message DeleteMetricDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.IListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteMetricDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMonitoredResourceDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer. + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteMetricDescriptorRequest.decode = function decode(reader, length) { + ListMonitoredResourceDescriptorsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteMetricDescriptorRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); + case 1: + if (!(message.resourceDescriptors && message.resourceDescriptors.length)) + message.resourceDescriptors = []; + message.resourceDescriptors.push($root.google.api.MonitoredResourceDescriptor.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9318,114 +8855,133 @@ }; /** - * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMonitoredResourceDescriptorsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteMetricDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { + ListMonitoredResourceDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteMetricDescriptorRequest message. + * Verifies a ListMonitoredResourceDescriptorsResponse message. * @function verify - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteMetricDescriptorRequest.verify = function verify(message) { + ListMonitoredResourceDescriptorsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.resourceDescriptors != null && message.hasOwnProperty("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]); + if (error) + return "resourceDescriptors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a DeleteMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMonitoredResourceDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest + * @returns {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} ListMonitoredResourceDescriptorsResponse */ - DeleteMetricDescriptorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteMetricDescriptorRequest) + ListMonitoredResourceDescriptorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse) return object; - var message = new $root.google.monitoring.v3.DeleteMetricDescriptorRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse(); + if (object.resourceDescriptors) { + if (!Array.isArray(object.resourceDescriptors)) + throw TypeError(".google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: array expected"); + message.resourceDescriptors = []; + for (var i = 0; i < object.resourceDescriptors.length; ++i) { + if (typeof object.resourceDescriptors[i] !== "object") + throw TypeError(".google.monitoring.v3.ListMonitoredResourceDescriptorsResponse.resourceDescriptors: object expected"); + message.resourceDescriptors[i] = $root.google.api.MonitoredResourceDescriptor.fromObject(object.resourceDescriptors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a DeleteMetricDescriptorRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMonitoredResourceDescriptorsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @static - * @param {google.monitoring.v3.DeleteMetricDescriptorRequest} message DeleteMetricDescriptorRequest + * @param {google.monitoring.v3.ListMonitoredResourceDescriptorsResponse} message ListMonitoredResourceDescriptorsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteMetricDescriptorRequest.toObject = function toObject(message, options) { + ListMonitoredResourceDescriptorsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.resourceDescriptors = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + 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); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this DeleteMetricDescriptorRequest to JSON. + * Converts this ListMonitoredResourceDescriptorsResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest + * @memberof google.monitoring.v3.ListMonitoredResourceDescriptorsResponse * @instance * @returns {Object.} JSON object */ - DeleteMetricDescriptorRequest.prototype.toJSON = function toJSON() { + ListMonitoredResourceDescriptorsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteMetricDescriptorRequest; + return ListMonitoredResourceDescriptorsResponse; })(); - v3.ListTimeSeriesRequest = (function() { + v3.GetMonitoredResourceDescriptorRequest = (function() { /** - * Properties of a ListTimeSeriesRequest. + * Properties of a GetMonitoredResourceDescriptorRequest. * @memberof google.monitoring.v3 - * @interface IListTimeSeriesRequest - * @property {string|null} [name] ListTimeSeriesRequest name - * @property {string|null} [filter] ListTimeSeriesRequest filter - * @property {google.monitoring.v3.ITimeInterval|null} [interval] ListTimeSeriesRequest interval - * @property {google.monitoring.v3.IAggregation|null} [aggregation] ListTimeSeriesRequest aggregation - * @property {string|null} [orderBy] ListTimeSeriesRequest orderBy - * @property {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|null} [view] ListTimeSeriesRequest view - * @property {number|null} [pageSize] ListTimeSeriesRequest pageSize - * @property {string|null} [pageToken] ListTimeSeriesRequest pageToken + * @interface IGetMonitoredResourceDescriptorRequest + * @property {string|null} [name] GetMonitoredResourceDescriptorRequest name */ /** - * Constructs a new ListTimeSeriesRequest. + * Constructs a new GetMonitoredResourceDescriptorRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListTimeSeriesRequest. - * @implements IListTimeSeriesRequest + * @classdesc Represents a GetMonitoredResourceDescriptorRequest. + * @implements IGetMonitoredResourceDescriptorRequest * @constructor - * @param {google.monitoring.v3.IListTimeSeriesRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest=} [properties] Properties to set */ - function ListTimeSeriesRequest(properties) { + function GetMonitoredResourceDescriptorRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9433,167 +8989,76 @@ } /** - * ListTimeSeriesRequest name. + * GetMonitoredResourceDescriptorRequest name. * @member {string} name - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.name = ""; - - /** - * ListTimeSeriesRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.filter = ""; - - /** - * ListTimeSeriesRequest interval. - * @member {google.monitoring.v3.ITimeInterval|null|undefined} interval - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.interval = null; - - /** - * ListTimeSeriesRequest aggregation. - * @member {google.monitoring.v3.IAggregation|null|undefined} aggregation - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.aggregation = null; - - /** - * ListTimeSeriesRequest orderBy. - * @member {string} orderBy - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.orderBy = ""; - - /** - * ListTimeSeriesRequest view. - * @member {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} view - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.view = 0; - - /** - * ListTimeSeriesRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListTimeSeriesRequest - * @instance - */ - ListTimeSeriesRequest.prototype.pageSize = 0; - - /** - * ListTimeSeriesRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @instance */ - ListTimeSeriesRequest.prototype.pageToken = ""; + GetMonitoredResourceDescriptorRequest.prototype.name = ""; /** - * Creates a new ListTimeSeriesRequest instance using the specified properties. + * Creates a new GetMonitoredResourceDescriptorRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static - * @param {google.monitoring.v3.IListTimeSeriesRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest instance + * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest instance */ - ListTimeSeriesRequest.create = function create(properties) { - return new ListTimeSeriesRequest(properties); + GetMonitoredResourceDescriptorRequest.create = function create(properties) { + return new GetMonitoredResourceDescriptorRequest(properties); }; /** - * Encodes the specified ListTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. + * Encodes the specified GetMonitoredResourceDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static - * @param {google.monitoring.v3.IListTimeSeriesRequest} message ListTimeSeriesRequest message or plain object to encode + * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} message GetMonitoredResourceDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTimeSeriesRequest.encode = function encode(message, writer) { + GetMonitoredResourceDescriptorRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.interval != null && message.hasOwnProperty("interval")) - $root.google.monitoring.v3.TimeInterval.encode(message.interval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.aggregation != null && message.hasOwnProperty("aggregation")) - $root.google.monitoring.v3.Aggregation.encode(message.aggregation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - if (message.view != null && message.hasOwnProperty("view")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.view); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.pageToken); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.name); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified ListTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. + * Encodes the specified GetMonitoredResourceDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMonitoredResourceDescriptorRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static - * @param {google.monitoring.v3.IListTimeSeriesRequest} message ListTimeSeriesRequest message or plain object to encode + * @param {google.monitoring.v3.IGetMonitoredResourceDescriptorRequest} message GetMonitoredResourceDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetMonitoredResourceDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTimeSeriesRequest message from the specified reader or buffer. + * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest + * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTimeSeriesRequest.decode = function decode(reader, length) { + GetMonitoredResourceDescriptorRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 10: + case 3: message.name = reader.string(); break; - case 2: - message.filter = reader.string(); - break; - case 4: - message.interval = $root.google.monitoring.v3.TimeInterval.decode(reader, reader.uint32()); - break; - case 5: - message.aggregation = $root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32()); - break; - case 6: - message.orderBy = reader.string(); - break; - case 7: - message.view = reader.int32(); - break; - case 8: - message.pageSize = reader.int32(); - break; - case 9: - message.pageToken = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -9603,205 +9068,110 @@ }; /** - * Decodes a ListTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMonitoredResourceDescriptorRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest + * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + GetMonitoredResourceDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTimeSeriesRequest message. + * Verifies a GetMonitoredResourceDescriptorRequest message. * @function verify - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTimeSeriesRequest.verify = function verify(message) { + GetMonitoredResourceDescriptorRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.monitoring.v3.TimeInterval.verify(message.interval); - if (error) - return "interval." + error; - } - if (message.aggregation != null && message.hasOwnProperty("aggregation")) { - var error = $root.google.monitoring.v3.Aggregation.verify(message.aggregation); - if (error) - return "aggregation." + error; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - break; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; return null; }; /** - * Creates a ListTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMonitoredResourceDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest + * @returns {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} GetMonitoredResourceDescriptorRequest */ - ListTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListTimeSeriesRequest) + GetMonitoredResourceDescriptorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest) return object; - var message = new $root.google.monitoring.v3.ListTimeSeriesRequest(); + var message = new $root.google.monitoring.v3.GetMonitoredResourceDescriptorRequest(); if (object.name != null) message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.monitoring.v3.ListTimeSeriesRequest.interval: object expected"); - message.interval = $root.google.monitoring.v3.TimeInterval.fromObject(object.interval); - } - if (object.aggregation != null) { - if (typeof object.aggregation !== "object") - throw TypeError(".google.monitoring.v3.ListTimeSeriesRequest.aggregation: object expected"); - message.aggregation = $root.google.monitoring.v3.Aggregation.fromObject(object.aggregation); - } - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - switch (object.view) { - case "FULL": - case 0: - message.view = 0; - break; - case "HEADERS": - case 1: - message.view = 1; - break; - } - 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 ListTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetMonitoredResourceDescriptorRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @static - * @param {google.monitoring.v3.ListTimeSeriesRequest} message ListTimeSeriesRequest + * @param {google.monitoring.v3.GetMonitoredResourceDescriptorRequest} message GetMonitoredResourceDescriptorRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTimeSeriesRequest.toObject = function toObject(message, options) { + GetMonitoredResourceDescriptorRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.filter = ""; - object.interval = null; - object.aggregation = null; - object.orderBy = ""; - object.view = options.enums === String ? "FULL" : 0; - object.pageSize = 0; - object.pageToken = ""; + if (options.defaults) object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.monitoring.v3.TimeInterval.toObject(message.interval, options); - if (message.aggregation != null && message.hasOwnProperty("aggregation")) - object.aggregation = $root.google.monitoring.v3.Aggregation.toObject(message.aggregation, options); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView[message.view] : message.view; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; return object; }; /** - * Converts this ListTimeSeriesRequest to JSON. + * Converts this GetMonitoredResourceDescriptorRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @memberof google.monitoring.v3.GetMonitoredResourceDescriptorRequest * @instance * @returns {Object.} JSON object */ - ListTimeSeriesRequest.prototype.toJSON = function toJSON() { + GetMonitoredResourceDescriptorRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * TimeSeriesView enum. - * @name google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView - * @enum {string} - * @property {number} FULL=0 FULL value - * @property {number} HEADERS=1 HEADERS value - */ - ListTimeSeriesRequest.TimeSeriesView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FULL"] = 0; - values[valuesById[1] = "HEADERS"] = 1; - return values; - })(); - - return ListTimeSeriesRequest; + return GetMonitoredResourceDescriptorRequest; })(); - v3.ListTimeSeriesResponse = (function() { + v3.ListMetricDescriptorsRequest = (function() { /** - * Properties of a ListTimeSeriesResponse. + * Properties of a ListMetricDescriptorsRequest. * @memberof google.monitoring.v3 - * @interface IListTimeSeriesResponse - * @property {Array.|null} [timeSeries] ListTimeSeriesResponse timeSeries - * @property {string|null} [nextPageToken] ListTimeSeriesResponse nextPageToken - * @property {Array.|null} [executionErrors] ListTimeSeriesResponse executionErrors + * @interface IListMetricDescriptorsRequest + * @property {string|null} [name] ListMetricDescriptorsRequest name + * @property {string|null} [filter] ListMetricDescriptorsRequest filter + * @property {number|null} [pageSize] ListMetricDescriptorsRequest pageSize + * @property {string|null} [pageToken] ListMetricDescriptorsRequest pageToken */ /** - * Constructs a new ListTimeSeriesResponse. + * Constructs a new ListMetricDescriptorsRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListTimeSeriesResponse. - * @implements IListTimeSeriesResponse + * @classdesc Represents a ListMetricDescriptorsRequest. + * @implements IListMetricDescriptorsRequest * @constructor - * @param {google.monitoring.v3.IListTimeSeriesResponse=} [properties] Properties to set + * @param {google.monitoring.v3.IListMetricDescriptorsRequest=} [properties] Properties to set */ - function ListTimeSeriesResponse(properties) { - this.timeSeries = []; - this.executionErrors = []; + function ListMetricDescriptorsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9809,107 +9179,114 @@ } /** - * ListTimeSeriesResponse timeSeries. - * @member {Array.} timeSeries - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * ListMetricDescriptorsRequest name. + * @member {string} name + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @instance */ - ListTimeSeriesResponse.prototype.timeSeries = $util.emptyArray; + ListMetricDescriptorsRequest.prototype.name = ""; /** - * ListTimeSeriesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * ListMetricDescriptorsRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @instance */ - ListTimeSeriesResponse.prototype.nextPageToken = ""; + ListMetricDescriptorsRequest.prototype.filter = ""; /** - * ListTimeSeriesResponse executionErrors. - * @member {Array.} executionErrors - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * ListMetricDescriptorsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @instance */ - ListTimeSeriesResponse.prototype.executionErrors = $util.emptyArray; + ListMetricDescriptorsRequest.prototype.pageSize = 0; /** - * Creates a new ListTimeSeriesResponse instance using the specified properties. + * ListMetricDescriptorsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest + * @instance + */ + ListMetricDescriptorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMetricDescriptorsRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static - * @param {google.monitoring.v3.IListTimeSeriesResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse instance + * @param {google.monitoring.v3.IListMetricDescriptorsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest instance */ - ListTimeSeriesResponse.create = function create(properties) { - return new ListTimeSeriesResponse(properties); + ListMetricDescriptorsRequest.create = function create(properties) { + return new ListMetricDescriptorsRequest(properties); }; /** - * Encodes the specified ListTimeSeriesResponse message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. + * Encodes the specified ListMetricDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static - * @param {google.monitoring.v3.IListTimeSeriesResponse} message ListTimeSeriesResponse message or plain object to encode + * @param {google.monitoring.v3.IListMetricDescriptorsRequest} message ListMetricDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTimeSeriesResponse.encode = function encode(message, writer) { + ListMetricDescriptorsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeries != null && message.timeSeries.length) - for (var i = 0; i < message.timeSeries.length; ++i) - $root.google.monitoring.v3.TimeSeries.encode(message.timeSeries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.executionErrors != null && message.executionErrors.length) - for (var i = 0; i < message.executionErrors.length; ++i) - $root.google.rpc.Status.encode(message.executionErrors[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); return writer; }; /** - * Encodes the specified ListTimeSeriesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. + * Encodes the specified ListMetricDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static - * @param {google.monitoring.v3.IListTimeSeriesResponse} message ListTimeSeriesResponse message or plain object to encode + * @param {google.monitoring.v3.IListMetricDescriptorsRequest} message ListMetricDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTimeSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListMetricDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTimeSeriesResponse message from the specified reader or buffer. + * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse + * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTimeSeriesResponse.decode = function decode(reader, length) { + ListMetricDescriptorsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListTimeSeriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMetricDescriptorsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.timeSeries && message.timeSeries.length)) - message.timeSeries = []; - message.timeSeries.push($root.google.monitoring.v3.TimeSeries.decode(reader, reader.uint32())); + case 5: + message.name = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.filter = reader.string(); break; case 3: - if (!(message.executionErrors && message.executionErrors.length)) - message.executionErrors = []; - message.executionErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -9920,161 +9297,134 @@ }; /** - * Decodes a ListTimeSeriesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListMetricDescriptorsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse + * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTimeSeriesResponse.decodeDelimited = function decodeDelimited(reader) { + ListMetricDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTimeSeriesResponse message. + * Verifies a ListMetricDescriptorsRequest message. * @function verify - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTimeSeriesResponse.verify = function verify(message) { + ListMetricDescriptorsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { - if (!Array.isArray(message.timeSeries)) - return "timeSeries: array expected"; - for (var i = 0; i < message.timeSeries.length; ++i) { - var error = $root.google.monitoring.v3.TimeSeries.verify(message.timeSeries[i]); - if (error) - return "timeSeries." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.executionErrors != null && message.hasOwnProperty("executionErrors")) { - if (!Array.isArray(message.executionErrors)) - return "executionErrors: array expected"; - for (var i = 0; i < message.executionErrors.length; ++i) { - var error = $root.google.rpc.Status.verify(message.executionErrors[i]); - if (error) - return "executionErrors." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a ListTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListMetricDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse + * @returns {google.monitoring.v3.ListMetricDescriptorsRequest} ListMetricDescriptorsRequest */ - ListTimeSeriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListTimeSeriesResponse) + ListMetricDescriptorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListMetricDescriptorsRequest) return object; - var message = new $root.google.monitoring.v3.ListTimeSeriesResponse(); - if (object.timeSeries) { - if (!Array.isArray(object.timeSeries)) - throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.timeSeries: array expected"); - message.timeSeries = []; - for (var i = 0; i < object.timeSeries.length; ++i) { - if (typeof object.timeSeries[i] !== "object") - throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.timeSeries: object expected"); - message.timeSeries[i] = $root.google.monitoring.v3.TimeSeries.fromObject(object.timeSeries[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.executionErrors) { - if (!Array.isArray(object.executionErrors)) - throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.executionErrors: array expected"); - message.executionErrors = []; - for (var i = 0; i < object.executionErrors.length; ++i) { - if (typeof object.executionErrors[i] !== "object") - throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.executionErrors: object expected"); - message.executionErrors[i] = $root.google.rpc.Status.fromObject(object.executionErrors[i]); - } - } + var message = new $root.google.monitoring.v3.ListMetricDescriptorsRequest(); + 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 ListTimeSeriesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListMetricDescriptorsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @static - * @param {google.monitoring.v3.ListTimeSeriesResponse} message ListTimeSeriesResponse + * @param {google.monitoring.v3.ListMetricDescriptorsRequest} message ListMetricDescriptorsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTimeSeriesResponse.toObject = function toObject(message, options) { + ListMetricDescriptorsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.timeSeries = []; - object.executionErrors = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.timeSeries && message.timeSeries.length) { - object.timeSeries = []; - for (var j = 0; j < message.timeSeries.length; ++j) - object.timeSeries[j] = $root.google.monitoring.v3.TimeSeries.toObject(message.timeSeries[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.executionErrors && message.executionErrors.length) { - object.executionErrors = []; - for (var j = 0; j < message.executionErrors.length; ++j) - object.executionErrors[j] = $root.google.rpc.Status.toObject(message.executionErrors[j], options); + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListTimeSeriesResponse to JSON. + * Converts this ListMetricDescriptorsRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @memberof google.monitoring.v3.ListMetricDescriptorsRequest * @instance * @returns {Object.} JSON object */ - ListTimeSeriesResponse.prototype.toJSON = function toJSON() { + ListMetricDescriptorsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListTimeSeriesResponse; + return ListMetricDescriptorsRequest; })(); - v3.CreateTimeSeriesRequest = (function() { + v3.ListMetricDescriptorsResponse = (function() { /** - * Properties of a CreateTimeSeriesRequest. + * Properties of a ListMetricDescriptorsResponse. * @memberof google.monitoring.v3 - * @interface ICreateTimeSeriesRequest - * @property {string|null} [name] CreateTimeSeriesRequest name - * @property {Array.|null} [timeSeries] CreateTimeSeriesRequest timeSeries + * @interface IListMetricDescriptorsResponse + * @property {Array.|null} [metricDescriptors] ListMetricDescriptorsResponse metricDescriptors + * @property {string|null} [nextPageToken] ListMetricDescriptorsResponse nextPageToken */ /** - * Constructs a new CreateTimeSeriesRequest. + * Constructs a new ListMetricDescriptorsResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a CreateTimeSeriesRequest. - * @implements ICreateTimeSeriesRequest + * @classdesc Represents a ListMetricDescriptorsResponse. + * @implements IListMetricDescriptorsResponse * @constructor - * @param {google.monitoring.v3.ICreateTimeSeriesRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListMetricDescriptorsResponse=} [properties] Properties to set */ - function CreateTimeSeriesRequest(properties) { - this.timeSeries = []; + function ListMetricDescriptorsResponse(properties) { + this.metricDescriptors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10082,91 +9432,91 @@ } /** - * CreateTimeSeriesRequest name. - * @member {string} name - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * ListMetricDescriptorsResponse metricDescriptors. + * @member {Array.} metricDescriptors + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @instance */ - CreateTimeSeriesRequest.prototype.name = ""; + ListMetricDescriptorsResponse.prototype.metricDescriptors = $util.emptyArray; /** - * CreateTimeSeriesRequest timeSeries. - * @member {Array.} timeSeries - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * ListMetricDescriptorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @instance */ - CreateTimeSeriesRequest.prototype.timeSeries = $util.emptyArray; + ListMetricDescriptorsResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateTimeSeriesRequest instance using the specified properties. + * Creates a new ListMetricDescriptorsResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static - * @param {google.monitoring.v3.ICreateTimeSeriesRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest instance + * @param {google.monitoring.v3.IListMetricDescriptorsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse instance */ - CreateTimeSeriesRequest.create = function create(properties) { - return new CreateTimeSeriesRequest(properties); + ListMetricDescriptorsResponse.create = function create(properties) { + return new ListMetricDescriptorsResponse(properties); }; /** - * Encodes the specified CreateTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ListMetricDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static - * @param {google.monitoring.v3.ICreateTimeSeriesRequest} message CreateTimeSeriesRequest message or plain object to encode + * @param {google.monitoring.v3.IListMetricDescriptorsResponse} message ListMetricDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTimeSeriesRequest.encode = function encode(message, writer) { + ListMetricDescriptorsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeries != null && message.timeSeries.length) - for (var i = 0; i < message.timeSeries.length; ++i) - $root.google.monitoring.v3.TimeSeries.encode(message.timeSeries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.metricDescriptors != null && message.metricDescriptors.length) + for (var i = 0; i < message.metricDescriptors.length; ++i) + $root.google.api.MetricDescriptor.encode(message.metricDescriptors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CreateTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ListMetricDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListMetricDescriptorsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static - * @param {google.monitoring.v3.ICreateTimeSeriesRequest} message CreateTimeSeriesRequest message or plain object to encode + * @param {google.monitoring.v3.IListMetricDescriptorsResponse} message ListMetricDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMetricDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer. + * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest + * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTimeSeriesRequest.decode = function decode(reader, length) { + ListMetricDescriptorsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListMetricDescriptorsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); + case 1: + if (!(message.metricDescriptors && message.metricDescriptors.length)) + message.metricDescriptors = []; + message.metricDescriptors.push($root.google.api.MetricDescriptor.decode(reader, reader.uint32())); break; case 2: - if (!(message.timeSeries && message.timeSeries.length)) - message.timeSeries = []; - message.timeSeries.push($root.google.monitoring.v3.TimeSeries.decode(reader, reader.uint32())); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -10177,134 +9527,133 @@ }; /** - * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMetricDescriptorsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest + * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + ListMetricDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTimeSeriesRequest message. + * Verifies a ListMetricDescriptorsResponse message. * @function verify - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTimeSeriesRequest.verify = function verify(message) { + ListMetricDescriptorsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { - if (!Array.isArray(message.timeSeries)) - return "timeSeries: array expected"; - for (var i = 0; i < message.timeSeries.length; ++i) { - var error = $root.google.monitoring.v3.TimeSeries.verify(message.timeSeries[i]); + if (message.metricDescriptors != null && message.hasOwnProperty("metricDescriptors")) { + if (!Array.isArray(message.metricDescriptors)) + return "metricDescriptors: array expected"; + for (var i = 0; i < message.metricDescriptors.length; ++i) { + var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptors[i]); if (error) - return "timeSeries." + error; + return "metricDescriptors." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMetricDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest + * @returns {google.monitoring.v3.ListMetricDescriptorsResponse} ListMetricDescriptorsResponse */ - CreateTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesRequest) + ListMetricDescriptorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListMetricDescriptorsResponse) return object; - var message = new $root.google.monitoring.v3.CreateTimeSeriesRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeSeries) { - if (!Array.isArray(object.timeSeries)) - throw TypeError(".google.monitoring.v3.CreateTimeSeriesRequest.timeSeries: array expected"); - message.timeSeries = []; - for (var i = 0; i < object.timeSeries.length; ++i) { - if (typeof object.timeSeries[i] !== "object") - throw TypeError(".google.monitoring.v3.CreateTimeSeriesRequest.timeSeries: object expected"); - message.timeSeries[i] = $root.google.monitoring.v3.TimeSeries.fromObject(object.timeSeries[i]); + var message = new $root.google.monitoring.v3.ListMetricDescriptorsResponse(); + if (object.metricDescriptors) { + if (!Array.isArray(object.metricDescriptors)) + throw TypeError(".google.monitoring.v3.ListMetricDescriptorsResponse.metricDescriptors: array expected"); + message.metricDescriptors = []; + for (var i = 0; i < object.metricDescriptors.length; ++i) { + if (typeof object.metricDescriptors[i] !== "object") + throw TypeError(".google.monitoring.v3.ListMetricDescriptorsResponse.metricDescriptors: object expected"); + message.metricDescriptors[i] = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptors[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CreateTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMetricDescriptorsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @static - * @param {google.monitoring.v3.CreateTimeSeriesRequest} message CreateTimeSeriesRequest + * @param {google.monitoring.v3.ListMetricDescriptorsResponse} message ListMetricDescriptorsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTimeSeriesRequest.toObject = function toObject(message, options) { + ListMetricDescriptorsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.timeSeries = []; + object.metricDescriptors = []; if (options.defaults) - object.name = ""; - if (message.timeSeries && message.timeSeries.length) { - object.timeSeries = []; - for (var j = 0; j < message.timeSeries.length; ++j) - object.timeSeries[j] = $root.google.monitoring.v3.TimeSeries.toObject(message.timeSeries[j], options); + object.nextPageToken = ""; + if (message.metricDescriptors && message.metricDescriptors.length) { + object.metricDescriptors = []; + for (var j = 0; j < message.metricDescriptors.length; ++j) + object.metricDescriptors[j] = $root.google.api.MetricDescriptor.toObject(message.metricDescriptors[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CreateTimeSeriesRequest to JSON. + * Converts this ListMetricDescriptorsResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateTimeSeriesRequest + * @memberof google.monitoring.v3.ListMetricDescriptorsResponse * @instance * @returns {Object.} JSON object */ - CreateTimeSeriesRequest.prototype.toJSON = function toJSON() { + ListMetricDescriptorsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateTimeSeriesRequest; + return ListMetricDescriptorsResponse; })(); - v3.CreateTimeSeriesError = (function() { + v3.GetMetricDescriptorRequest = (function() { /** - * Properties of a CreateTimeSeriesError. + * Properties of a GetMetricDescriptorRequest. * @memberof google.monitoring.v3 - * @interface ICreateTimeSeriesError - * @property {google.monitoring.v3.ITimeSeries|null} [timeSeries] CreateTimeSeriesError timeSeries - * @property {google.rpc.IStatus|null} [status] CreateTimeSeriesError status + * @interface IGetMetricDescriptorRequest + * @property {string|null} [name] GetMetricDescriptorRequest name */ /** - * Constructs a new CreateTimeSeriesError. + * Constructs a new GetMetricDescriptorRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a CreateTimeSeriesError. - * @implements ICreateTimeSeriesError + * @classdesc Represents a GetMetricDescriptorRequest. + * @implements IGetMetricDescriptorRequest * @constructor - * @param {google.monitoring.v3.ICreateTimeSeriesError=} [properties] Properties to set + * @param {google.monitoring.v3.IGetMetricDescriptorRequest=} [properties] Properties to set */ - function CreateTimeSeriesError(properties) { + function GetMetricDescriptorRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10312,88 +9661,75 @@ } /** - * CreateTimeSeriesError timeSeries. - * @member {google.monitoring.v3.ITimeSeries|null|undefined} timeSeries - * @memberof google.monitoring.v3.CreateTimeSeriesError - * @instance - */ - CreateTimeSeriesError.prototype.timeSeries = null; - - /** - * CreateTimeSeriesError status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.monitoring.v3.CreateTimeSeriesError + * GetMetricDescriptorRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @instance */ - CreateTimeSeriesError.prototype.status = null; + GetMetricDescriptorRequest.prototype.name = ""; /** - * Creates a new CreateTimeSeriesError instance using the specified properties. + * Creates a new GetMetricDescriptorRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static - * @param {google.monitoring.v3.ICreateTimeSeriesError=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError instance + * @param {google.monitoring.v3.IGetMetricDescriptorRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest instance */ - CreateTimeSeriesError.create = function create(properties) { - return new CreateTimeSeriesError(properties); + GetMetricDescriptorRequest.create = function create(properties) { + return new GetMetricDescriptorRequest(properties); }; /** - * Encodes the specified CreateTimeSeriesError message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. + * Encodes the specified GetMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static - * @param {google.monitoring.v3.ICreateTimeSeriesError} message CreateTimeSeriesError message or plain object to encode + * @param {google.monitoring.v3.IGetMetricDescriptorRequest} message GetMetricDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTimeSeriesError.encode = function encode(message, writer) { + GetMetricDescriptorRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - $root.google.monitoring.v3.TimeSeries.encode(message.timeSeries, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && message.hasOwnProperty("status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified CreateTimeSeriesError message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. + * Encodes the specified GetMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetMetricDescriptorRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static - * @param {google.monitoring.v3.ICreateTimeSeriesError} message CreateTimeSeriesError message or plain object to encode + * @param {google.monitoring.v3.IGetMetricDescriptorRequest} message GetMetricDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTimeSeriesError.encodeDelimited = function encodeDelimited(message, writer) { + GetMetricDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTimeSeriesError message from the specified reader or buffer. + * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError + * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTimeSeriesError.decode = function decode(reader, length) { + GetMetricDescriptorRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesError(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetMetricDescriptorRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.timeSeries = $root.google.monitoring.v3.TimeSeries.decode(reader, reader.uint32()); - break; - case 2: - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + case 3: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -10404,129 +9740,108 @@ }; /** - * Decodes a CreateTimeSeriesError message from the specified reader or buffer, length delimited. + * Decodes a GetMetricDescriptorRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError + * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTimeSeriesError.decodeDelimited = function decodeDelimited(reader) { + GetMetricDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTimeSeriesError message. + * Verifies a GetMetricDescriptorRequest message. * @function verify - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTimeSeriesError.verify = function verify(message) { + GetMetricDescriptorRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { - var error = $root.google.monitoring.v3.TimeSeries.verify(message.timeSeries); - if (error) - return "timeSeries." + error; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateTimeSeriesError message from a plain object. Also converts values to their respective internal types. + * Creates a GetMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError + * @returns {google.monitoring.v3.GetMetricDescriptorRequest} GetMetricDescriptorRequest */ - CreateTimeSeriesError.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesError) + GetMetricDescriptorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetMetricDescriptorRequest) return object; - var message = new $root.google.monitoring.v3.CreateTimeSeriesError(); - if (object.timeSeries != null) { - if (typeof object.timeSeries !== "object") - throw TypeError(".google.monitoring.v3.CreateTimeSeriesError.timeSeries: object expected"); - message.timeSeries = $root.google.monitoring.v3.TimeSeries.fromObject(object.timeSeries); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.monitoring.v3.CreateTimeSeriesError.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } + var message = new $root.google.monitoring.v3.GetMetricDescriptorRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateTimeSeriesError message. Also converts values to other types if specified. + * Creates a plain object from a GetMetricDescriptorRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @static - * @param {google.monitoring.v3.CreateTimeSeriesError} message CreateTimeSeriesError + * @param {google.monitoring.v3.GetMetricDescriptorRequest} message GetMetricDescriptorRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTimeSeriesError.toObject = function toObject(message, options) { + GetMetricDescriptorRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.timeSeries = null; - object.status = null; - } - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - object.timeSeries = $root.google.monitoring.v3.TimeSeries.toObject(message.timeSeries, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateTimeSeriesError to JSON. + * Converts this GetMetricDescriptorRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateTimeSeriesError + * @memberof google.monitoring.v3.GetMetricDescriptorRequest * @instance * @returns {Object.} JSON object */ - CreateTimeSeriesError.prototype.toJSON = function toJSON() { + GetMetricDescriptorRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateTimeSeriesError; + return GetMetricDescriptorRequest; })(); - v3.CreateTimeSeriesSummary = (function() { + v3.CreateMetricDescriptorRequest = (function() { /** - * Properties of a CreateTimeSeriesSummary. + * Properties of a CreateMetricDescriptorRequest. * @memberof google.monitoring.v3 - * @interface ICreateTimeSeriesSummary - * @property {number|null} [totalPointCount] CreateTimeSeriesSummary totalPointCount - * @property {number|null} [successPointCount] CreateTimeSeriesSummary successPointCount - * @property {Array.|null} [errors] CreateTimeSeriesSummary errors + * @interface ICreateMetricDescriptorRequest + * @property {string|null} [name] CreateMetricDescriptorRequest name + * @property {google.api.IMetricDescriptor|null} [metricDescriptor] CreateMetricDescriptorRequest metricDescriptor */ /** - * Constructs a new CreateTimeSeriesSummary. + * Constructs a new CreateMetricDescriptorRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a CreateTimeSeriesSummary. - * @implements ICreateTimeSeriesSummary + * @classdesc Represents a CreateMetricDescriptorRequest. + * @implements ICreateMetricDescriptorRequest * @constructor - * @param {google.monitoring.v3.ICreateTimeSeriesSummary=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateMetricDescriptorRequest=} [properties] Properties to set */ - function CreateTimeSeriesSummary(properties) { - this.errors = []; + function CreateMetricDescriptorRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10534,104 +9849,88 @@ } /** - * CreateTimeSeriesSummary totalPointCount. - * @member {number} totalPointCount - * @memberof google.monitoring.v3.CreateTimeSeriesSummary - * @instance - */ - CreateTimeSeriesSummary.prototype.totalPointCount = 0; - - /** - * CreateTimeSeriesSummary successPointCount. - * @member {number} successPointCount - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * CreateMetricDescriptorRequest name. + * @member {string} name + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @instance */ - CreateTimeSeriesSummary.prototype.successPointCount = 0; + CreateMetricDescriptorRequest.prototype.name = ""; /** - * CreateTimeSeriesSummary errors. - * @member {Array.} errors - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * CreateMetricDescriptorRequest metricDescriptor. + * @member {google.api.IMetricDescriptor|null|undefined} metricDescriptor + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @instance */ - CreateTimeSeriesSummary.prototype.errors = $util.emptyArray; + CreateMetricDescriptorRequest.prototype.metricDescriptor = null; /** - * Creates a new CreateTimeSeriesSummary instance using the specified properties. + * Creates a new CreateMetricDescriptorRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static - * @param {google.monitoring.v3.ICreateTimeSeriesSummary=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary instance + * @param {google.monitoring.v3.ICreateMetricDescriptorRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest instance */ - CreateTimeSeriesSummary.create = function create(properties) { - return new CreateTimeSeriesSummary(properties); + CreateMetricDescriptorRequest.create = function create(properties) { + return new CreateMetricDescriptorRequest(properties); }; /** - * Encodes the specified CreateTimeSeriesSummary message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. + * Encodes the specified CreateMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static - * @param {google.monitoring.v3.ICreateTimeSeriesSummary} message CreateTimeSeriesSummary message or plain object to encode + * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} message CreateMetricDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTimeSeriesSummary.encode = function encode(message, writer) { + CreateMetricDescriptorRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalPointCount != null && message.hasOwnProperty("totalPointCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalPointCount); - if (message.successPointCount != null && message.hasOwnProperty("successPointCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.successPointCount); - if (message.errors != null && message.errors.length) - for (var i = 0; i < message.errors.length; ++i) - $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.encode(message.errors[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) + $root.google.api.MetricDescriptor.encode(message.metricDescriptor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified CreateTimeSeriesSummary message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. + * Encodes the specified CreateMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateMetricDescriptorRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static - * @param {google.monitoring.v3.ICreateTimeSeriesSummary} message CreateTimeSeriesSummary message or plain object to encode + * @param {google.monitoring.v3.ICreateMetricDescriptorRequest} message CreateMetricDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTimeSeriesSummary.encodeDelimited = function encodeDelimited(message, writer) { + CreateMetricDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer. + * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary + * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTimeSeriesSummary.decode = function decode(reader, length) { + CreateMetricDescriptorRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateMetricDescriptorRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.totalPointCount = reader.int32(); + case 3: + message.name = reader.string(); break; case 2: - message.successPointCount = reader.int32(); - break; - case 3: - if (!(message.errors && message.errors.length)) - message.errors = []; - message.errors.push($root.google.monitoring.v3.CreateTimeSeriesSummary.Error.decode(reader, reader.uint32())); + message.metricDescriptor = $root.google.api.MetricDescriptor.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10642,358 +9941,121 @@ }; /** - * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer, length delimited. + * Decodes a CreateMetricDescriptorRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary + * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTimeSeriesSummary.decodeDelimited = function decodeDelimited(reader) { + CreateMetricDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTimeSeriesSummary message. + * Verifies a CreateMetricDescriptorRequest message. * @function verify - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTimeSeriesSummary.verify = function verify(message) { + CreateMetricDescriptorRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.totalPointCount != null && message.hasOwnProperty("totalPointCount")) - if (!$util.isInteger(message.totalPointCount)) - return "totalPointCount: integer expected"; - if (message.successPointCount != null && message.hasOwnProperty("successPointCount")) - if (!$util.isInteger(message.successPointCount)) - return "successPointCount: integer expected"; - if (message.errors != null && message.hasOwnProperty("errors")) { - if (!Array.isArray(message.errors)) - return "errors: array expected"; - for (var i = 0; i < message.errors.length; ++i) { - var error = $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.verify(message.errors[i]); - if (error) - return "errors." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) { + var error = $root.google.api.MetricDescriptor.verify(message.metricDescriptor); + if (error) + return "metricDescriptor." + error; } return null; }; /** - * Creates a CreateTimeSeriesSummary message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary + * @returns {google.monitoring.v3.CreateMetricDescriptorRequest} CreateMetricDescriptorRequest */ - CreateTimeSeriesSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesSummary) + CreateMetricDescriptorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateMetricDescriptorRequest) return object; - var message = new $root.google.monitoring.v3.CreateTimeSeriesSummary(); - if (object.totalPointCount != null) - message.totalPointCount = object.totalPointCount | 0; - if (object.successPointCount != null) - message.successPointCount = object.successPointCount | 0; - if (object.errors) { - if (!Array.isArray(object.errors)) - throw TypeError(".google.monitoring.v3.CreateTimeSeriesSummary.errors: array expected"); - message.errors = []; - for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") - throw TypeError(".google.monitoring.v3.CreateTimeSeriesSummary.errors: object expected"); - message.errors[i] = $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.fromObject(object.errors[i]); - } + var message = new $root.google.monitoring.v3.CreateMetricDescriptorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.metricDescriptor != null) { + if (typeof object.metricDescriptor !== "object") + throw TypeError(".google.monitoring.v3.CreateMetricDescriptorRequest.metricDescriptor: object expected"); + message.metricDescriptor = $root.google.api.MetricDescriptor.fromObject(object.metricDescriptor); } return message; }; /** - * Creates a plain object from a CreateTimeSeriesSummary message. Also converts values to other types if specified. + * Creates a plain object from a CreateMetricDescriptorRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @static - * @param {google.monitoring.v3.CreateTimeSeriesSummary} message CreateTimeSeriesSummary + * @param {google.monitoring.v3.CreateMetricDescriptorRequest} message CreateMetricDescriptorRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTimeSeriesSummary.toObject = function toObject(message, options) { + CreateMetricDescriptorRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errors = []; if (options.defaults) { - object.totalPointCount = 0; - object.successPointCount = 0; - } - if (message.totalPointCount != null && message.hasOwnProperty("totalPointCount")) - object.totalPointCount = message.totalPointCount; - if (message.successPointCount != null && message.hasOwnProperty("successPointCount")) - object.successPointCount = message.successPointCount; - if (message.errors && message.errors.length) { - object.errors = []; - for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.toObject(message.errors[j], options); + object.metricDescriptor = null; + object.name = ""; } + if (message.metricDescriptor != null && message.hasOwnProperty("metricDescriptor")) + object.metricDescriptor = $root.google.api.MetricDescriptor.toObject(message.metricDescriptor, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateTimeSeriesSummary to JSON. + * Converts this CreateMetricDescriptorRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @memberof google.monitoring.v3.CreateMetricDescriptorRequest * @instance * @returns {Object.} JSON object */ - CreateTimeSeriesSummary.prototype.toJSON = function toJSON() { + CreateMetricDescriptorRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - CreateTimeSeriesSummary.Error = (function() { - - /** - * Properties of an Error. - * @memberof google.monitoring.v3.CreateTimeSeriesSummary - * @interface IError - * @property {google.rpc.IStatus|null} [status] Error status - * @property {number|null} [pointCount] Error pointCount - */ - - /** - * Constructs a new Error. - * @memberof google.monitoring.v3.CreateTimeSeriesSummary - * @classdesc Represents an Error. - * @implements IError - * @constructor - * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError=} [properties] Properties to set - */ - function Error(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Error status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @instance - */ - Error.prototype.status = null; - - /** - * Error pointCount. - * @member {number} pointCount - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @instance - */ - Error.prototype.pointCount = 0; - - /** - * Creates a new Error instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error instance - */ - Error.create = function create(properties) { - return new Error(properties); - }; - - /** - * Encodes the specified Error message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError} message Error message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Error.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.status != null && message.hasOwnProperty("status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pointCount != null && message.hasOwnProperty("pointCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pointCount); - return writer; - }; - - /** - * Encodes the specified Error message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError} message Error message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Error.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Error message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Error.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesSummary.Error(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 2: - message.pointCount = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Error message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Error.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Error message. - * @function verify - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Error.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.pointCount != null && message.hasOwnProperty("pointCount")) - if (!$util.isInteger(message.pointCount)) - return "pointCount: integer expected"; - return null; - }; - - /** - * Creates an Error message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error - */ - Error.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesSummary.Error) - return object; - var message = new $root.google.monitoring.v3.CreateTimeSeriesSummary.Error(); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.monitoring.v3.CreateTimeSeriesSummary.Error.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.pointCount != null) - message.pointCount = object.pointCount | 0; - return message; - }; - - /** - * Creates a plain object from an Error message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @static - * @param {google.monitoring.v3.CreateTimeSeriesSummary.Error} message Error - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Error.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.status = null; - object.pointCount = 0; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.pointCount != null && message.hasOwnProperty("pointCount")) - object.pointCount = message.pointCount; - return object; - }; - - /** - * Converts this Error to JSON. - * @function toJSON - * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error - * @instance - * @returns {Object.} JSON object - */ - Error.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Error; - })(); - - return CreateTimeSeriesSummary; + return CreateMetricDescriptorRequest; })(); - v3.Point = (function() { + v3.DeleteMetricDescriptorRequest = (function() { /** - * Properties of a Point. + * Properties of a DeleteMetricDescriptorRequest. * @memberof google.monitoring.v3 - * @interface IPoint - * @property {google.monitoring.v3.ITimeInterval|null} [interval] Point interval - * @property {google.monitoring.v3.ITypedValue|null} [value] Point value + * @interface IDeleteMetricDescriptorRequest + * @property {string|null} [name] DeleteMetricDescriptorRequest name */ /** - * Constructs a new Point. + * Constructs a new DeleteMetricDescriptorRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a Point. - * @implements IPoint + * @classdesc Represents a DeleteMetricDescriptorRequest. + * @implements IDeleteMetricDescriptorRequest * @constructor - * @param {google.monitoring.v3.IPoint=} [properties] Properties to set + * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest=} [properties] Properties to set */ - function Point(properties) { + function DeleteMetricDescriptorRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11001,88 +10063,75 @@ } /** - * Point interval. - * @member {google.monitoring.v3.ITimeInterval|null|undefined} interval - * @memberof google.monitoring.v3.Point - * @instance - */ - Point.prototype.interval = null; - - /** - * Point value. - * @member {google.monitoring.v3.ITypedValue|null|undefined} value - * @memberof google.monitoring.v3.Point + * DeleteMetricDescriptorRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @instance */ - Point.prototype.value = null; + DeleteMetricDescriptorRequest.prototype.name = ""; /** - * Creates a new Point instance using the specified properties. + * Creates a new DeleteMetricDescriptorRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static - * @param {google.monitoring.v3.IPoint=} [properties] Properties to set - * @returns {google.monitoring.v3.Point} Point instance + * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest instance */ - Point.create = function create(properties) { - return new Point(properties); + DeleteMetricDescriptorRequest.create = function create(properties) { + return new DeleteMetricDescriptorRequest(properties); }; /** - * Encodes the specified Point message. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. + * Encodes the specified DeleteMetricDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static - * @param {google.monitoring.v3.IPoint} message Point message or plain object to encode + * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} message DeleteMetricDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Point.encode = function encode(message, writer) { + DeleteMetricDescriptorRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.interval != null && message.hasOwnProperty("interval")) - $root.google.monitoring.v3.TimeInterval.encode(message.interval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.value != null && message.hasOwnProperty("value")) - $root.google.monitoring.v3.TypedValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified Point message, length delimited. Does not implicitly {@link google.monitoring.v3.Point.verify|verify} messages. + * Encodes the specified DeleteMetricDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteMetricDescriptorRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static - * @param {google.monitoring.v3.IPoint} message Point message or plain object to encode + * @param {google.monitoring.v3.IDeleteMetricDescriptorRequest} message DeleteMetricDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Point.encodeDelimited = function encodeDelimited(message, writer) { + DeleteMetricDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Point message from the specified reader or buffer. + * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Point} Point + * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Point.decode = function decode(reader, length) { + DeleteMetricDescriptorRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Point(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteMetricDescriptorRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.interval = $root.google.monitoring.v3.TimeInterval.decode(reader, reader.uint32()); - break; - case 2: - message.value = $root.google.monitoring.v3.TypedValue.decode(reader, reader.uint32()); + case 3: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -11093,132 +10142,114 @@ }; /** - * Decodes a Point message from the specified reader or buffer, length delimited. + * Decodes a DeleteMetricDescriptorRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Point} Point + * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Point.decodeDelimited = function decodeDelimited(reader) { + DeleteMetricDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Point message. + * Verifies a DeleteMetricDescriptorRequest message. * @function verify - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Point.verify = function verify(message) { + DeleteMetricDescriptorRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.interval != null && message.hasOwnProperty("interval")) { - var error = $root.google.monitoring.v3.TimeInterval.verify(message.interval); - if (error) - return "interval." + error; - } - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.google.monitoring.v3.TypedValue.verify(message.value); - if (error) - return "value." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a Point message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMetricDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Point} Point + * @returns {google.monitoring.v3.DeleteMetricDescriptorRequest} DeleteMetricDescriptorRequest */ - Point.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Point) + DeleteMetricDescriptorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteMetricDescriptorRequest) return object; - var message = new $root.google.monitoring.v3.Point(); - if (object.interval != null) { - if (typeof object.interval !== "object") - throw TypeError(".google.monitoring.v3.Point.interval: object expected"); - message.interval = $root.google.monitoring.v3.TimeInterval.fromObject(object.interval); - } - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.monitoring.v3.Point.value: object expected"); - message.value = $root.google.monitoring.v3.TypedValue.fromObject(object.value); - } + var message = new $root.google.monitoring.v3.DeleteMetricDescriptorRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a Point message. Also converts values to other types if specified. + * Creates a plain object from a DeleteMetricDescriptorRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @static - * @param {google.monitoring.v3.Point} message Point + * @param {google.monitoring.v3.DeleteMetricDescriptorRequest} message DeleteMetricDescriptorRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Point.toObject = function toObject(message, options) { + DeleteMetricDescriptorRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.interval = null; - object.value = null; - } - if (message.interval != null && message.hasOwnProperty("interval")) - object.interval = $root.google.monitoring.v3.TimeInterval.toObject(message.interval, options); - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.monitoring.v3.TypedValue.toObject(message.value, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this Point to JSON. + * Converts this DeleteMetricDescriptorRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.Point + * @memberof google.monitoring.v3.DeleteMetricDescriptorRequest * @instance * @returns {Object.} JSON object */ - Point.prototype.toJSON = function toJSON() { + DeleteMetricDescriptorRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Point; + return DeleteMetricDescriptorRequest; })(); - v3.TimeSeries = (function() { + v3.ListTimeSeriesRequest = (function() { /** - * Properties of a TimeSeries. + * Properties of a ListTimeSeriesRequest. * @memberof google.monitoring.v3 - * @interface ITimeSeries - * @property {google.api.IMetric|null} [metric] TimeSeries metric - * @property {google.api.IMonitoredResource|null} [resource] TimeSeries resource - * @property {google.api.IMonitoredResourceMetadata|null} [metadata] TimeSeries metadata - * @property {google.api.MetricDescriptor.MetricKind|null} [metricKind] TimeSeries metricKind - * @property {google.api.MetricDescriptor.ValueType|null} [valueType] TimeSeries valueType - * @property {Array.|null} [points] TimeSeries points + * @interface IListTimeSeriesRequest + * @property {string|null} [name] ListTimeSeriesRequest name + * @property {string|null} [filter] ListTimeSeriesRequest filter + * @property {google.monitoring.v3.ITimeInterval|null} [interval] ListTimeSeriesRequest interval + * @property {google.monitoring.v3.IAggregation|null} [aggregation] ListTimeSeriesRequest aggregation + * @property {string|null} [orderBy] ListTimeSeriesRequest orderBy + * @property {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView|null} [view] ListTimeSeriesRequest view + * @property {number|null} [pageSize] ListTimeSeriesRequest pageSize + * @property {string|null} [pageToken] ListTimeSeriesRequest pageToken */ /** - * Constructs a new TimeSeries. + * Constructs a new ListTimeSeriesRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a TimeSeries. - * @implements ITimeSeries + * @classdesc Represents a ListTimeSeriesRequest. + * @implements IListTimeSeriesRequest * @constructor - * @param {google.monitoring.v3.ITimeSeries=} [properties] Properties to set + * @param {google.monitoring.v3.IListTimeSeriesRequest=} [properties] Properties to set */ - function TimeSeries(properties) { - this.points = []; + function ListTimeSeriesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11226,143 +10257,166 @@ } /** - * TimeSeries metric. - * @member {google.api.IMetric|null|undefined} metric - * @memberof google.monitoring.v3.TimeSeries + * ListTimeSeriesRequest name. + * @member {string} name + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance */ - TimeSeries.prototype.metric = null; + ListTimeSeriesRequest.prototype.name = ""; /** - * TimeSeries resource. - * @member {google.api.IMonitoredResource|null|undefined} resource - * @memberof google.monitoring.v3.TimeSeries + * ListTimeSeriesRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance */ - TimeSeries.prototype.resource = null; + ListTimeSeriesRequest.prototype.filter = ""; /** - * TimeSeries metadata. - * @member {google.api.IMonitoredResourceMetadata|null|undefined} metadata - * @memberof google.monitoring.v3.TimeSeries + * ListTimeSeriesRequest interval. + * @member {google.monitoring.v3.ITimeInterval|null|undefined} interval + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance */ - TimeSeries.prototype.metadata = null; + ListTimeSeriesRequest.prototype.interval = null; /** - * TimeSeries metricKind. - * @member {google.api.MetricDescriptor.MetricKind} metricKind - * @memberof google.monitoring.v3.TimeSeries + * ListTimeSeriesRequest aggregation. + * @member {google.monitoring.v3.IAggregation|null|undefined} aggregation + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance */ - TimeSeries.prototype.metricKind = 0; + ListTimeSeriesRequest.prototype.aggregation = null; /** - * TimeSeries valueType. - * @member {google.api.MetricDescriptor.ValueType} valueType - * @memberof google.monitoring.v3.TimeSeries + * ListTimeSeriesRequest orderBy. + * @member {string} orderBy + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance */ - TimeSeries.prototype.valueType = 0; + ListTimeSeriesRequest.prototype.orderBy = ""; /** - * TimeSeries points. - * @member {Array.} points - * @memberof google.monitoring.v3.TimeSeries + * ListTimeSeriesRequest view. + * @member {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} view + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance */ - TimeSeries.prototype.points = $util.emptyArray; + ListTimeSeriesRequest.prototype.view = 0; /** - * Creates a new TimeSeries instance using the specified properties. + * ListTimeSeriesRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @instance + */ + ListTimeSeriesRequest.prototype.pageSize = 0; + + /** + * ListTimeSeriesRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListTimeSeriesRequest + * @instance + */ + ListTimeSeriesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static - * @param {google.monitoring.v3.ITimeSeries=} [properties] Properties to set - * @returns {google.monitoring.v3.TimeSeries} TimeSeries instance + * @param {google.monitoring.v3.IListTimeSeriesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest instance */ - TimeSeries.create = function create(properties) { - return new TimeSeries(properties); + ListTimeSeriesRequest.create = function create(properties) { + return new ListTimeSeriesRequest(properties); }; /** - * Encodes the specified TimeSeries message. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. + * Encodes the specified ListTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static - * @param {google.monitoring.v3.ITimeSeries} message TimeSeries message or plain object to encode + * @param {google.monitoring.v3.IListTimeSeriesRequest} message ListTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeries.encode = function encode(message, writer) { + ListTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.metric != null && message.hasOwnProperty("metric")) - $root.google.api.Metric.encode(message.metric, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.resource != null && message.hasOwnProperty("resource")) - $root.google.api.MonitoredResource.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metricKind != null && message.hasOwnProperty("metricKind")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.metricKind); - if (message.valueType != null && message.hasOwnProperty("valueType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); - if (message.points != null && message.points.length) - for (var i = 0; i < message.points.length; ++i) - $root.google.monitoring.v3.Point.encode(message.points[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.metadata != null && message.hasOwnProperty("metadata")) - $root.google.api.MonitoredResourceMetadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.interval != null && message.hasOwnProperty("interval")) + $root.google.monitoring.v3.TimeInterval.encode(message.interval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.aggregation != null && message.hasOwnProperty("aggregation")) + $root.google.monitoring.v3.Aggregation.encode(message.aggregation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.view); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.name); return writer; }; /** - * Encodes the specified TimeSeries message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeries.verify|verify} messages. + * Encodes the specified ListTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static - * @param {google.monitoring.v3.ITimeSeries} message TimeSeries message or plain object to encode + * @param {google.monitoring.v3.IListTimeSeriesRequest} message ListTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeries.encodeDelimited = function encodeDelimited(message, writer) { + ListTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeSeries message from the specified reader or buffer. + * Decodes a ListTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.TimeSeries} TimeSeries + * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeries.decode = function decode(reader, length) { + ListTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeSeries(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.metric = $root.google.api.Metric.decode(reader, reader.uint32()); + case 10: + message.name = reader.string(); break; case 2: - message.resource = $root.google.api.MonitoredResource.decode(reader, reader.uint32()); - break; - case 7: - message.metadata = $root.google.api.MonitoredResourceMetadata.decode(reader, reader.uint32()); - break; - case 3: - message.metricKind = reader.int32(); + message.filter = reader.string(); break; case 4: - message.valueType = reader.int32(); + message.interval = $root.google.monitoring.v3.TimeInterval.decode(reader, reader.uint32()); break; case 5: - if (!(message.points && message.points.length)) - message.points = []; - message.points.push($root.google.monitoring.v3.Point.decode(reader, reader.uint32())); + message.aggregation = $root.google.monitoring.v3.Aggregation.decode(reader, reader.uint32()); + break; + case 6: + message.orderBy = reader.string(); + break; + case 7: + message.view = reader.int32(); + break; + case 8: + message.pageSize = reader.int32(); + break; + case 9: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -11373,711 +10427,313 @@ }; /** - * Decodes a TimeSeries message from the specified reader or buffer, length delimited. + * Decodes a ListTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.TimeSeries} TimeSeries + * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeries.decodeDelimited = function decodeDelimited(reader) { + ListTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeSeries message. + * Verifies a ListTimeSeriesRequest message. * @function verify - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeSeries.verify = function verify(message) { + ListTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.metric != null && message.hasOwnProperty("metric")) { - var error = $root.google.api.Metric.verify(message.metric); - if (error) - return "metric." + error; - } - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.google.api.MonitoredResource.verify(message.resource); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.monitoring.v3.TimeInterval.verify(message.interval); if (error) - return "resource." + error; + return "interval." + error; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.api.MonitoredResourceMetadata.verify(message.metadata); + if (message.aggregation != null && message.hasOwnProperty("aggregation")) { + var error = $root.google.monitoring.v3.Aggregation.verify(message.aggregation); if (error) - return "metadata." + error; + return "aggregation." + error; } - if (message.metricKind != null && message.hasOwnProperty("metricKind")) - switch (message.metricKind) { - default: - return "metricKind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { default: - return "valueType: enum value expected"; + return "view: enum value expected"; case 0: case 1: - case 2: - case 3: - case 4: - case 5: - case 6: break; } - if (message.points != null && message.hasOwnProperty("points")) { - if (!Array.isArray(message.points)) - return "points: array expected"; - for (var i = 0; i < message.points.length; ++i) { - var error = $root.google.monitoring.v3.Point.verify(message.points[i]); - if (error) - return "points." + error; - } - } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a TimeSeries message from a plain object. Also converts values to their respective internal types. + * Creates a ListTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.TimeSeries} TimeSeries + * @returns {google.monitoring.v3.ListTimeSeriesRequest} ListTimeSeriesRequest */ - TimeSeries.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.TimeSeries) + ListTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListTimeSeriesRequest) return object; - var message = new $root.google.monitoring.v3.TimeSeries(); - if (object.metric != null) { - if (typeof object.metric !== "object") - throw TypeError(".google.monitoring.v3.TimeSeries.metric: object expected"); - message.metric = $root.google.api.Metric.fromObject(object.metric); - } - if (object.resource != null) { - if (typeof object.resource !== "object") - throw TypeError(".google.monitoring.v3.TimeSeries.resource: object expected"); - message.resource = $root.google.api.MonitoredResource.fromObject(object.resource); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.monitoring.v3.TimeSeries.metadata: object expected"); - message.metadata = $root.google.api.MonitoredResourceMetadata.fromObject(object.metadata); + var message = new $root.google.monitoring.v3.ListTimeSeriesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.monitoring.v3.ListTimeSeriesRequest.interval: object expected"); + message.interval = $root.google.monitoring.v3.TimeInterval.fromObject(object.interval); } - switch (object.metricKind) { - case "METRIC_KIND_UNSPECIFIED": - case 0: - message.metricKind = 0; - break; - case "GAUGE": - case 1: - message.metricKind = 1; - break; - case "DELTA": - case 2: - message.metricKind = 2; - break; - case "CUMULATIVE": - case 3: - message.metricKind = 3; - break; + if (object.aggregation != null) { + if (typeof object.aggregation !== "object") + throw TypeError(".google.monitoring.v3.ListTimeSeriesRequest.aggregation: object expected"); + message.aggregation = $root.google.monitoring.v3.Aggregation.fromObject(object.aggregation); } - switch (object.valueType) { - case "VALUE_TYPE_UNSPECIFIED": + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + case "FULL": case 0: - message.valueType = 0; + message.view = 0; break; - case "BOOL": + case "HEADERS": 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; + message.view = 1; break; } - if (object.points) { - if (!Array.isArray(object.points)) - throw TypeError(".google.monitoring.v3.TimeSeries.points: array expected"); - message.points = []; - for (var i = 0; i < object.points.length; ++i) { - if (typeof object.points[i] !== "object") - throw TypeError(".google.monitoring.v3.TimeSeries.points: object expected"); - message.points[i] = $root.google.monitoring.v3.Point.fromObject(object.points[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 TimeSeries message. Also converts values to other types if specified. + * Creates a plain object from a ListTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @static - * @param {google.monitoring.v3.TimeSeries} message TimeSeries + * @param {google.monitoring.v3.ListTimeSeriesRequest} message ListTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeSeries.toObject = function toObject(message, options) { + ListTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.points = []; if (options.defaults) { - object.metric = null; - object.resource = null; - object.metricKind = options.enums === String ? "METRIC_KIND_UNSPECIFIED" : 0; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.metadata = null; - } - if (message.metric != null && message.hasOwnProperty("metric")) - object.metric = $root.google.api.Metric.toObject(message.metric, options); - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = $root.google.api.MonitoredResource.toObject(message.resource, options); - if (message.metricKind != null && message.hasOwnProperty("metricKind")) - object.metricKind = options.enums === String ? $root.google.api.MetricDescriptor.MetricKind[message.metricKind] : message.metricKind; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.api.MetricDescriptor.ValueType[message.valueType] : message.valueType; - if (message.points && message.points.length) { - object.points = []; - for (var j = 0; j < message.points.length; ++j) - object.points[j] = $root.google.monitoring.v3.Point.toObject(message.points[j], options); + object.filter = ""; + object.interval = null; + object.aggregation = null; + object.orderBy = ""; + object.view = options.enums === String ? "FULL" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.api.MonitoredResourceMetadata.toObject(message.metadata, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.monitoring.v3.TimeInterval.toObject(message.interval, options); + if (message.aggregation != null && message.hasOwnProperty("aggregation")) + object.aggregation = $root.google.monitoring.v3.Aggregation.toObject(message.aggregation, options); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TimeSeries to JSON. + * Converts this ListTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.TimeSeries + * @memberof google.monitoring.v3.ListTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - TimeSeries.prototype.toJSON = function toJSON() { + ListTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeSeries; + /** + * TimeSeriesView enum. + * @name google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView + * @enum {string} + * @property {number} FULL=0 FULL value + * @property {number} HEADERS=1 HEADERS value + */ + ListTimeSeriesRequest.TimeSeriesView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL"] = 0; + values[valuesById[1] = "HEADERS"] = 1; + return values; + })(); + + return ListTimeSeriesRequest; })(); - v3.NotificationChannelService = (function() { + v3.ListTimeSeriesResponse = (function() { /** - * Constructs a new NotificationChannelService service. + * Properties of a ListTimeSeriesResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a NotificationChannelService - * @extends $protobuf.rpc.Service + * @interface IListTimeSeriesResponse + * @property {Array.|null} [timeSeries] ListTimeSeriesResponse timeSeries + * @property {string|null} [nextPageToken] ListTimeSeriesResponse nextPageToken + * @property {Array.|null} [executionErrors] ListTimeSeriesResponse executionErrors + */ + + /** + * Constructs a new ListTimeSeriesResponse. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListTimeSeriesResponse. + * @implements IListTimeSeriesResponse * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.monitoring.v3.IListTimeSeriesResponse=} [properties] Properties to set */ - function NotificationChannelService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function ListTimeSeriesResponse(properties) { + this.timeSeries = []; + this.executionErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (NotificationChannelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NotificationChannelService; - /** - * Creates new NotificationChannelService service using the specified rpc implementation. - * @function create - * @memberof google.monitoring.v3.NotificationChannelService - * @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 {NotificationChannelService} RPC service. Useful where requests and/or responses are streamed. + * ListTimeSeriesResponse timeSeries. + * @member {Array.} timeSeries + * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @instance */ - NotificationChannelService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + ListTimeSeriesResponse.prototype.timeSeries = $util.emptyArray; /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannelDescriptors}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef ListNotificationChannelDescriptorsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} [response] ListNotificationChannelDescriptorsResponse + * ListTimeSeriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListTimeSeriesResponse + * @instance */ + ListTimeSeriesResponse.prototype.nextPageToken = ""; /** - * Calls ListNotificationChannelDescriptors. - * @function listNotificationChannelDescriptors - * @memberof google.monitoring.v3.NotificationChannelService + * ListTimeSeriesResponse executionErrors. + * @member {Array.} executionErrors + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @instance - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} request ListNotificationChannelDescriptorsRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.ListNotificationChannelDescriptorsCallback} callback Node-style callback called with the error, if any, and ListNotificationChannelDescriptorsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(NotificationChannelService.prototype.listNotificationChannelDescriptors = function listNotificationChannelDescriptors(request, callback) { - return this.rpcCall(listNotificationChannelDescriptors, $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest, $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse, request, callback); - }, "name", { value: "ListNotificationChannelDescriptors" }); + ListTimeSeriesResponse.prototype.executionErrors = $util.emptyArray; /** - * Calls ListNotificationChannelDescriptors. - * @function listNotificationChannelDescriptors - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} request ListNotificationChannelDescriptorsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelDescriptor}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef GetNotificationChannelDescriptorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.NotificationChannelDescriptor} [response] NotificationChannelDescriptor - */ - - /** - * Calls GetNotificationChannelDescriptor. - * @function getNotificationChannelDescriptor - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} request GetNotificationChannelDescriptorRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptorCallback} callback Node-style callback called with the error, if any, and NotificationChannelDescriptor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.getNotificationChannelDescriptor = function getNotificationChannelDescriptor(request, callback) { - return this.rpcCall(getNotificationChannelDescriptor, $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest, $root.google.monitoring.v3.NotificationChannelDescriptor, request, callback); - }, "name", { value: "GetNotificationChannelDescriptor" }); - - /** - * Calls GetNotificationChannelDescriptor. - * @function getNotificationChannelDescriptor - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} request GetNotificationChannelDescriptorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannels}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef ListNotificationChannelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListNotificationChannelsResponse} [response] ListNotificationChannelsResponse - */ - - /** - * Calls ListNotificationChannels. - * @function listNotificationChannels - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IListNotificationChannelsRequest} request ListNotificationChannelsRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.ListNotificationChannelsCallback} callback Node-style callback called with the error, if any, and ListNotificationChannelsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.listNotificationChannels = function listNotificationChannels(request, callback) { - return this.rpcCall(listNotificationChannels, $root.google.monitoring.v3.ListNotificationChannelsRequest, $root.google.monitoring.v3.ListNotificationChannelsResponse, request, callback); - }, "name", { value: "ListNotificationChannels" }); - - /** - * Calls ListNotificationChannels. - * @function listNotificationChannels - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IListNotificationChannelsRequest} request ListNotificationChannelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannel}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef GetNotificationChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel - */ - - /** - * Calls GetNotificationChannel. - * @function getNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IGetNotificationChannelRequest} request GetNotificationChannelRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.GetNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.getNotificationChannel = function getNotificationChannel(request, callback) { - return this.rpcCall(getNotificationChannel, $root.google.monitoring.v3.GetNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); - }, "name", { value: "GetNotificationChannel" }); - - /** - * Calls GetNotificationChannel. - * @function getNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IGetNotificationChannelRequest} request GetNotificationChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#createNotificationChannel}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef CreateNotificationChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel - */ - - /** - * Calls CreateNotificationChannel. - * @function createNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.ICreateNotificationChannelRequest} request CreateNotificationChannelRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.CreateNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.createNotificationChannel = function createNotificationChannel(request, callback) { - return this.rpcCall(createNotificationChannel, $root.google.monitoring.v3.CreateNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); - }, "name", { value: "CreateNotificationChannel" }); - - /** - * Calls CreateNotificationChannel. - * @function createNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.ICreateNotificationChannelRequest} request CreateNotificationChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#updateNotificationChannel}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef UpdateNotificationChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel - */ - - /** - * Calls UpdateNotificationChannel. - * @function updateNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} request UpdateNotificationChannelRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.UpdateNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.updateNotificationChannel = function updateNotificationChannel(request, callback) { - return this.rpcCall(updateNotificationChannel, $root.google.monitoring.v3.UpdateNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); - }, "name", { value: "UpdateNotificationChannel" }); - - /** - * Calls UpdateNotificationChannel. - * @function updateNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} request UpdateNotificationChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#deleteNotificationChannel}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef DeleteNotificationChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteNotificationChannel. - * @function deleteNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} request DeleteNotificationChannelRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.DeleteNotificationChannelCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.deleteNotificationChannel = function deleteNotificationChannel(request, callback) { - return this.rpcCall(deleteNotificationChannel, $root.google.monitoring.v3.DeleteNotificationChannelRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteNotificationChannel" }); - - /** - * Calls DeleteNotificationChannel. - * @function deleteNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} request DeleteNotificationChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#sendNotificationChannelVerificationCode}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef SendNotificationChannelVerificationCodeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls SendNotificationChannelVerificationCode. - * @function sendNotificationChannelVerificationCode - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} request SendNotificationChannelVerificationCodeRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.SendNotificationChannelVerificationCodeCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.sendNotificationChannelVerificationCode = function sendNotificationChannelVerificationCode(request, callback) { - return this.rpcCall(sendNotificationChannelVerificationCode, $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "SendNotificationChannelVerificationCode" }); - - /** - * Calls SendNotificationChannelVerificationCode. - * @function sendNotificationChannelVerificationCode - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} request SendNotificationChannelVerificationCodeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelVerificationCode}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef GetNotificationChannelVerificationCodeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} [response] GetNotificationChannelVerificationCodeResponse - */ - - /** - * Calls GetNotificationChannelVerificationCode. - * @function getNotificationChannelVerificationCode - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} request GetNotificationChannelVerificationCodeRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.GetNotificationChannelVerificationCodeCallback} callback Node-style callback called with the error, if any, and GetNotificationChannelVerificationCodeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.getNotificationChannelVerificationCode = function getNotificationChannelVerificationCode(request, callback) { - return this.rpcCall(getNotificationChannelVerificationCode, $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest, $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse, request, callback); - }, "name", { value: "GetNotificationChannelVerificationCode" }); - - /** - * Calls GetNotificationChannelVerificationCode. - * @function getNotificationChannelVerificationCode - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} request GetNotificationChannelVerificationCodeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.NotificationChannelService#verifyNotificationChannel}. - * @memberof google.monitoring.v3.NotificationChannelService - * @typedef VerifyNotificationChannelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel - */ - - /** - * Calls VerifyNotificationChannel. - * @function verifyNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} request VerifyNotificationChannelRequest message or plain object - * @param {google.monitoring.v3.NotificationChannelService.VerifyNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NotificationChannelService.prototype.verifyNotificationChannel = function verifyNotificationChannel(request, callback) { - return this.rpcCall(verifyNotificationChannel, $root.google.monitoring.v3.VerifyNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); - }, "name", { value: "VerifyNotificationChannel" }); - - /** - * Calls VerifyNotificationChannel. - * @function verifyNotificationChannel - * @memberof google.monitoring.v3.NotificationChannelService - * @instance - * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} request VerifyNotificationChannelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return NotificationChannelService; - })(); - - v3.ListNotificationChannelDescriptorsRequest = (function() { - - /** - * Properties of a ListNotificationChannelDescriptorsRequest. - * @memberof google.monitoring.v3 - * @interface IListNotificationChannelDescriptorsRequest - * @property {string|null} [name] ListNotificationChannelDescriptorsRequest name - * @property {number|null} [pageSize] ListNotificationChannelDescriptorsRequest pageSize - * @property {string|null} [pageToken] ListNotificationChannelDescriptorsRequest pageToken - */ - - /** - * Constructs a new ListNotificationChannelDescriptorsRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListNotificationChannelDescriptorsRequest. - * @implements IListNotificationChannelDescriptorsRequest - * @constructor - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest=} [properties] Properties to set - */ - function ListNotificationChannelDescriptorsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListNotificationChannelDescriptorsRequest name. - * @member {string} name - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest - * @instance - */ - ListNotificationChannelDescriptorsRequest.prototype.name = ""; - - /** - * ListNotificationChannelDescriptorsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest - * @instance - */ - ListNotificationChannelDescriptorsRequest.prototype.pageSize = 0; - - /** - * ListNotificationChannelDescriptorsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest - * @instance - */ - ListNotificationChannelDescriptorsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListNotificationChannelDescriptorsRequest instance using the specified properties. + * Creates a new ListTimeSeriesResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest instance + * @param {google.monitoring.v3.IListTimeSeriesResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse instance */ - ListNotificationChannelDescriptorsRequest.create = function create(properties) { - return new ListNotificationChannelDescriptorsRequest(properties); + ListTimeSeriesResponse.create = function create(properties) { + return new ListTimeSeriesResponse(properties); }; /** - * Encodes the specified ListNotificationChannelDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. + * Encodes the specified ListTimeSeriesResponse message. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} message ListNotificationChannelDescriptorsRequest message or plain object to encode + * @param {google.monitoring.v3.IListTimeSeriesResponse} message ListTimeSeriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelDescriptorsRequest.encode = function encode(message, writer) { + ListTimeSeriesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.timeSeries != null && message.timeSeries.length) + for (var i = 0; i < message.timeSeries.length; ++i) + $root.google.monitoring.v3.TimeSeries.encode(message.timeSeries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.executionErrors != null && message.executionErrors.length) + for (var i = 0; i < message.executionErrors.length; ++i) + $root.google.rpc.Status.encode(message.executionErrors[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListNotificationChannelDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. + * Encodes the specified ListTimeSeriesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListTimeSeriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} message ListNotificationChannelDescriptorsRequest message or plain object to encode + * @param {google.monitoring.v3.IListTimeSeriesResponse} message ListTimeSeriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListTimeSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer. + * Decodes a ListTimeSeriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest + * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelDescriptorsRequest.decode = function decode(reader, length) { + ListTimeSeriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListTimeSeriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.name = reader.string(); + case 1: + if (!(message.timeSeries && message.timeSeries.length)) + message.timeSeries = []; + message.timeSeries.push($root.google.monitoring.v3.TimeSeries.decode(reader, reader.uint32())); break; case 2: - message.pageSize = reader.int32(); + message.nextPageToken = reader.string(); break; case 3: - message.pageToken = reader.string(); + if (!(message.executionErrors && message.executionErrors.length)) + message.executionErrors = []; + message.executionErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -12088,126 +10744,161 @@ }; /** - * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListTimeSeriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest + * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { + ListTimeSeriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNotificationChannelDescriptorsRequest message. + * Verifies a ListTimeSeriesResponse message. * @function verify - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNotificationChannelDescriptorsRequest.verify = function verify(message) { + ListTimeSeriesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { + if (!Array.isArray(message.timeSeries)) + return "timeSeries: array expected"; + for (var i = 0; i < message.timeSeries.length; ++i) { + var error = $root.google.monitoring.v3.TimeSeries.verify(message.timeSeries[i]); + if (error) + return "timeSeries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.executionErrors != null && message.hasOwnProperty("executionErrors")) { + if (!Array.isArray(message.executionErrors)) + return "executionErrors: array expected"; + for (var i = 0; i < message.executionErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.executionErrors[i]); + if (error) + return "executionErrors." + error; + } + } return null; }; /** - * Creates a ListNotificationChannelDescriptorsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest + * @returns {google.monitoring.v3.ListTimeSeriesResponse} ListTimeSeriesResponse */ - ListNotificationChannelDescriptorsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest) + ListTimeSeriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListTimeSeriesResponse) return object; - var message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.monitoring.v3.ListTimeSeriesResponse(); + if (object.timeSeries) { + if (!Array.isArray(object.timeSeries)) + throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.timeSeries: array expected"); + message.timeSeries = []; + for (var i = 0; i < object.timeSeries.length; ++i) { + if (typeof object.timeSeries[i] !== "object") + throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.timeSeries: object expected"); + message.timeSeries[i] = $root.google.monitoring.v3.TimeSeries.fromObject(object.timeSeries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.executionErrors) { + if (!Array.isArray(object.executionErrors)) + throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.executionErrors: array expected"); + message.executionErrors = []; + for (var i = 0; i < object.executionErrors.length; ++i) { + if (typeof object.executionErrors[i] !== "object") + throw TypeError(".google.monitoring.v3.ListTimeSeriesResponse.executionErrors: object expected"); + message.executionErrors[i] = $root.google.rpc.Status.fromObject(object.executionErrors[i]); + } + } return message; }; /** - * Creates a plain object from a ListNotificationChannelDescriptorsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListTimeSeriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @static - * @param {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} message ListNotificationChannelDescriptorsRequest + * @param {google.monitoring.v3.ListTimeSeriesResponse} message ListTimeSeriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNotificationChannelDescriptorsRequest.toObject = function toObject(message, options) { + ListTimeSeriesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; + if (options.arrays || options.defaults) { + object.timeSeries = []; + object.executionErrors = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.timeSeries && message.timeSeries.length) { + object.timeSeries = []; + for (var j = 0; j < message.timeSeries.length; ++j) + object.timeSeries[j] = $root.google.monitoring.v3.TimeSeries.toObject(message.timeSeries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.executionErrors && message.executionErrors.length) { + object.executionErrors = []; + for (var j = 0; j < message.executionErrors.length; ++j) + object.executionErrors[j] = $root.google.rpc.Status.toObject(message.executionErrors[j], options); } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; return object; }; /** - * Converts this ListNotificationChannelDescriptorsRequest to JSON. + * Converts this ListTimeSeriesResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @memberof google.monitoring.v3.ListTimeSeriesResponse * @instance * @returns {Object.} JSON object */ - ListNotificationChannelDescriptorsRequest.prototype.toJSON = function toJSON() { + ListTimeSeriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListNotificationChannelDescriptorsRequest; + return ListTimeSeriesResponse; })(); - v3.ListNotificationChannelDescriptorsResponse = (function() { + v3.CreateTimeSeriesRequest = (function() { /** - * Properties of a ListNotificationChannelDescriptorsResponse. + * Properties of a CreateTimeSeriesRequest. * @memberof google.monitoring.v3 - * @interface IListNotificationChannelDescriptorsResponse - * @property {Array.|null} [channelDescriptors] ListNotificationChannelDescriptorsResponse channelDescriptors - * @property {string|null} [nextPageToken] ListNotificationChannelDescriptorsResponse nextPageToken + * @interface ICreateTimeSeriesRequest + * @property {string|null} [name] CreateTimeSeriesRequest name + * @property {Array.|null} [timeSeries] CreateTimeSeriesRequest timeSeries */ /** - * Constructs a new ListNotificationChannelDescriptorsResponse. + * Constructs a new CreateTimeSeriesRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListNotificationChannelDescriptorsResponse. - * @implements IListNotificationChannelDescriptorsResponse + * @classdesc Represents a CreateTimeSeriesRequest. + * @implements ICreateTimeSeriesRequest * @constructor - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateTimeSeriesRequest=} [properties] Properties to set */ - function ListNotificationChannelDescriptorsResponse(properties) { - this.channelDescriptors = []; + function CreateTimeSeriesRequest(properties) { + this.timeSeries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12215,91 +10906,91 @@ } /** - * ListNotificationChannelDescriptorsResponse channelDescriptors. - * @member {Array.} channelDescriptors - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * CreateTimeSeriesRequest name. + * @member {string} name + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @instance */ - ListNotificationChannelDescriptorsResponse.prototype.channelDescriptors = $util.emptyArray; + CreateTimeSeriesRequest.prototype.name = ""; /** - * ListNotificationChannelDescriptorsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * CreateTimeSeriesRequest timeSeries. + * @member {Array.} timeSeries + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @instance */ - ListNotificationChannelDescriptorsResponse.prototype.nextPageToken = ""; + CreateTimeSeriesRequest.prototype.timeSeries = $util.emptyArray; /** - * Creates a new ListNotificationChannelDescriptorsResponse instance using the specified properties. + * Creates a new CreateTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse instance + * @param {google.monitoring.v3.ICreateTimeSeriesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest instance */ - ListNotificationChannelDescriptorsResponse.create = function create(properties) { - return new ListNotificationChannelDescriptorsResponse(properties); + CreateTimeSeriesRequest.create = function create(properties) { + return new CreateTimeSeriesRequest(properties); }; /** - * Encodes the specified ListNotificationChannelDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. + * Encodes the specified CreateTimeSeriesRequest message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse} message ListNotificationChannelDescriptorsResponse message or plain object to encode + * @param {google.monitoring.v3.ICreateTimeSeriesRequest} message CreateTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelDescriptorsResponse.encode = function encode(message, writer) { + CreateTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.channelDescriptors != null && message.channelDescriptors.length) - for (var i = 0; i < message.channelDescriptors.length; ++i) - $root.google.monitoring.v3.NotificationChannelDescriptor.encode(message.channelDescriptors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.timeSeries != null && message.timeSeries.length) + for (var i = 0; i < message.timeSeries.length; ++i) + $root.google.monitoring.v3.TimeSeries.encode(message.timeSeries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified ListNotificationChannelDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. + * Encodes the specified CreateTimeSeriesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static - * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse} message ListNotificationChannelDescriptorsResponse message or plain object to encode + * @param {google.monitoring.v3.ICreateTimeSeriesRequest} message CreateTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer. + * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse + * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelDescriptorsResponse.decode = function decode(reader, length) { + CreateTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.channelDescriptors && message.channelDescriptors.length)) - message.channelDescriptors = []; - message.channelDescriptors.push($root.google.monitoring.v3.NotificationChannelDescriptor.decode(reader, reader.uint32())); + case 3: + message.name = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + if (!(message.timeSeries && message.timeSeries.length)) + message.timeSeries = []; + message.timeSeries.push($root.google.monitoring.v3.TimeSeries.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -12310,133 +11001,134 @@ }; /** - * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse + * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNotificationChannelDescriptorsResponse message. + * Verifies a CreateTimeSeriesRequest message. * @function verify - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNotificationChannelDescriptorsResponse.verify = function verify(message) { + CreateTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.channelDescriptors != null && message.hasOwnProperty("channelDescriptors")) { - if (!Array.isArray(message.channelDescriptors)) - return "channelDescriptors: array expected"; - for (var i = 0; i < message.channelDescriptors.length; ++i) { - var error = $root.google.monitoring.v3.NotificationChannelDescriptor.verify(message.channelDescriptors[i]); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { + if (!Array.isArray(message.timeSeries)) + return "timeSeries: array expected"; + for (var i = 0; i < message.timeSeries.length; ++i) { + var error = $root.google.monitoring.v3.TimeSeries.verify(message.timeSeries[i]); if (error) - return "channelDescriptors." + error; + return "timeSeries." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListNotificationChannelDescriptorsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse + * @returns {google.monitoring.v3.CreateTimeSeriesRequest} CreateTimeSeriesRequest */ - ListNotificationChannelDescriptorsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse) + CreateTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesRequest) return object; - var message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse(); - if (object.channelDescriptors) { - if (!Array.isArray(object.channelDescriptors)) - throw TypeError(".google.monitoring.v3.ListNotificationChannelDescriptorsResponse.channelDescriptors: array expected"); - message.channelDescriptors = []; - for (var i = 0; i < object.channelDescriptors.length; ++i) { - if (typeof object.channelDescriptors[i] !== "object") - throw TypeError(".google.monitoring.v3.ListNotificationChannelDescriptorsResponse.channelDescriptors: object expected"); - message.channelDescriptors[i] = $root.google.monitoring.v3.NotificationChannelDescriptor.fromObject(object.channelDescriptors[i]); + var message = new $root.google.monitoring.v3.CreateTimeSeriesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeSeries) { + if (!Array.isArray(object.timeSeries)) + throw TypeError(".google.monitoring.v3.CreateTimeSeriesRequest.timeSeries: array expected"); + message.timeSeries = []; + for (var i = 0; i < object.timeSeries.length; ++i) { + if (typeof object.timeSeries[i] !== "object") + throw TypeError(".google.monitoring.v3.CreateTimeSeriesRequest.timeSeries: object expected"); + message.timeSeries[i] = $root.google.monitoring.v3.TimeSeries.fromObject(object.timeSeries[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListNotificationChannelDescriptorsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @static - * @param {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} message ListNotificationChannelDescriptorsResponse + * @param {google.monitoring.v3.CreateTimeSeriesRequest} message CreateTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNotificationChannelDescriptorsResponse.toObject = function toObject(message, options) { + CreateTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.channelDescriptors = []; + object.timeSeries = []; if (options.defaults) - object.nextPageToken = ""; - if (message.channelDescriptors && message.channelDescriptors.length) { - object.channelDescriptors = []; - for (var j = 0; j < message.channelDescriptors.length; ++j) - object.channelDescriptors[j] = $root.google.monitoring.v3.NotificationChannelDescriptor.toObject(message.channelDescriptors[j], options); + object.name = ""; + if (message.timeSeries && message.timeSeries.length) { + object.timeSeries = []; + for (var j = 0; j < message.timeSeries.length; ++j) + object.timeSeries[j] = $root.google.monitoring.v3.TimeSeries.toObject(message.timeSeries[j], options); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListNotificationChannelDescriptorsResponse to JSON. + * Converts this CreateTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @memberof google.monitoring.v3.CreateTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - ListNotificationChannelDescriptorsResponse.prototype.toJSON = function toJSON() { + CreateTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListNotificationChannelDescriptorsResponse; + return CreateTimeSeriesRequest; })(); - v3.GetNotificationChannelDescriptorRequest = (function() { + v3.CreateTimeSeriesError = (function() { /** - * Properties of a GetNotificationChannelDescriptorRequest. + * Properties of a CreateTimeSeriesError. * @memberof google.monitoring.v3 - * @interface IGetNotificationChannelDescriptorRequest - * @property {string|null} [name] GetNotificationChannelDescriptorRequest name + * @interface ICreateTimeSeriesError + * @property {google.monitoring.v3.ITimeSeries|null} [timeSeries] CreateTimeSeriesError timeSeries + * @property {google.rpc.IStatus|null} [status] CreateTimeSeriesError status */ /** - * Constructs a new GetNotificationChannelDescriptorRequest. + * Constructs a new CreateTimeSeriesError. * @memberof google.monitoring.v3 - * @classdesc Represents a GetNotificationChannelDescriptorRequest. - * @implements IGetNotificationChannelDescriptorRequest + * @classdesc Represents a CreateTimeSeriesError. + * @implements ICreateTimeSeriesError * @constructor - * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateTimeSeriesError=} [properties] Properties to set */ - function GetNotificationChannelDescriptorRequest(properties) { + function CreateTimeSeriesError(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12444,75 +11136,88 @@ } /** - * GetNotificationChannelDescriptorRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * CreateTimeSeriesError timeSeries. + * @member {google.monitoring.v3.ITimeSeries|null|undefined} timeSeries + * @memberof google.monitoring.v3.CreateTimeSeriesError * @instance */ - GetNotificationChannelDescriptorRequest.prototype.name = ""; + CreateTimeSeriesError.prototype.timeSeries = null; /** - * Creates a new GetNotificationChannelDescriptorRequest instance using the specified properties. + * CreateTimeSeriesError status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.monitoring.v3.CreateTimeSeriesError + * @instance + */ + CreateTimeSeriesError.prototype.status = null; + + /** + * Creates a new CreateTimeSeriesError instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static - * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest instance + * @param {google.monitoring.v3.ICreateTimeSeriesError=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError instance */ - GetNotificationChannelDescriptorRequest.create = function create(properties) { - return new GetNotificationChannelDescriptorRequest(properties); + CreateTimeSeriesError.create = function create(properties) { + return new CreateTimeSeriesError(properties); }; /** - * Encodes the specified GetNotificationChannelDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. + * Encodes the specified CreateTimeSeriesError message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static - * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} message GetNotificationChannelDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.ICreateTimeSeriesError} message CreateTimeSeriesError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationChannelDescriptorRequest.encode = function encode(message, writer) { + CreateTimeSeriesError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + $root.google.monitoring.v3.TimeSeries.encode(message.timeSeries, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && message.hasOwnProperty("status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetNotificationChannelDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. + * Encodes the specified CreateTimeSeriesError message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesError.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static - * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} message GetNotificationChannelDescriptorRequest message or plain object to encode + * @param {google.monitoring.v3.ICreateTimeSeriesError} message CreateTimeSeriesError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationChannelDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateTimeSeriesError.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer. + * Decodes a CreateTimeSeriesError message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest + * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationChannelDescriptorRequest.decode = function decode(reader, length) { + CreateTimeSeriesError.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesError(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); + case 1: + message.timeSeries = $root.google.monitoring.v3.TimeSeries.decode(reader, reader.uint32()); + break; + case 2: + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12523,108 +11228,129 @@ }; /** - * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTimeSeriesError message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest + * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationChannelDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { + CreateTimeSeriesError.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNotificationChannelDescriptorRequest message. + * Verifies a CreateTimeSeriesError message. * @function verify - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNotificationChannelDescriptorRequest.verify = function verify(message) { + CreateTimeSeriesError.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { + var error = $root.google.monitoring.v3.TimeSeries.verify(message.timeSeries); + if (error) + return "timeSeries." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } return null; }; /** - * Creates a GetNotificationChannelDescriptorRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTimeSeriesError message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest + * @returns {google.monitoring.v3.CreateTimeSeriesError} CreateTimeSeriesError */ - GetNotificationChannelDescriptorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest) + CreateTimeSeriesError.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesError) return object; - var message = new $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.monitoring.v3.CreateTimeSeriesError(); + if (object.timeSeries != null) { + if (typeof object.timeSeries !== "object") + throw TypeError(".google.monitoring.v3.CreateTimeSeriesError.timeSeries: object expected"); + message.timeSeries = $root.google.monitoring.v3.TimeSeries.fromObject(object.timeSeries); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.monitoring.v3.CreateTimeSeriesError.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } return message; }; /** - * Creates a plain object from a GetNotificationChannelDescriptorRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateTimeSeriesError message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @static - * @param {google.monitoring.v3.GetNotificationChannelDescriptorRequest} message GetNotificationChannelDescriptorRequest + * @param {google.monitoring.v3.CreateTimeSeriesError} message CreateTimeSeriesError * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNotificationChannelDescriptorRequest.toObject = function toObject(message, options) { + CreateTimeSeriesError.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.timeSeries = null; + object.status = null; + } + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + object.timeSeries = $root.google.monitoring.v3.TimeSeries.toObject(message.timeSeries, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); return object; }; /** - * Converts this GetNotificationChannelDescriptorRequest to JSON. + * Converts this CreateTimeSeriesError to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest + * @memberof google.monitoring.v3.CreateTimeSeriesError * @instance * @returns {Object.} JSON object */ - GetNotificationChannelDescriptorRequest.prototype.toJSON = function toJSON() { + CreateTimeSeriesError.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetNotificationChannelDescriptorRequest; + return CreateTimeSeriesError; })(); - v3.CreateNotificationChannelRequest = (function() { + v3.CreateTimeSeriesSummary = (function() { /** - * Properties of a CreateNotificationChannelRequest. + * Properties of a CreateTimeSeriesSummary. * @memberof google.monitoring.v3 - * @interface ICreateNotificationChannelRequest - * @property {string|null} [name] CreateNotificationChannelRequest name - * @property {google.monitoring.v3.INotificationChannel|null} [notificationChannel] CreateNotificationChannelRequest notificationChannel + * @interface ICreateTimeSeriesSummary + * @property {number|null} [totalPointCount] CreateTimeSeriesSummary totalPointCount + * @property {number|null} [successPointCount] CreateTimeSeriesSummary successPointCount + * @property {Array.|null} [errors] CreateTimeSeriesSummary errors */ /** - * Constructs a new CreateNotificationChannelRequest. + * Constructs a new CreateTimeSeriesSummary. * @memberof google.monitoring.v3 - * @classdesc Represents a CreateNotificationChannelRequest. - * @implements ICreateNotificationChannelRequest + * @classdesc Represents a CreateTimeSeriesSummary. + * @implements ICreateTimeSeriesSummary * @constructor - * @param {google.monitoring.v3.ICreateNotificationChannelRequest=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateTimeSeriesSummary=} [properties] Properties to set */ - function CreateNotificationChannelRequest(properties) { + function CreateTimeSeriesSummary(properties) { + this.errors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12632,88 +11358,104 @@ } /** - * CreateNotificationChannelRequest name. - * @member {string} name - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * CreateTimeSeriesSummary totalPointCount. + * @member {number} totalPointCount + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @instance */ - CreateNotificationChannelRequest.prototype.name = ""; + CreateTimeSeriesSummary.prototype.totalPointCount = 0; /** - * CreateNotificationChannelRequest notificationChannel. - * @member {google.monitoring.v3.INotificationChannel|null|undefined} notificationChannel - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * CreateTimeSeriesSummary successPointCount. + * @member {number} successPointCount + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @instance */ - CreateNotificationChannelRequest.prototype.notificationChannel = null; + CreateTimeSeriesSummary.prototype.successPointCount = 0; /** - * Creates a new CreateNotificationChannelRequest instance using the specified properties. + * CreateTimeSeriesSummary errors. + * @member {Array.} errors + * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @instance + */ + CreateTimeSeriesSummary.prototype.errors = $util.emptyArray; + + /** + * Creates a new CreateTimeSeriesSummary instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static - * @param {google.monitoring.v3.ICreateNotificationChannelRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest instance + * @param {google.monitoring.v3.ICreateTimeSeriesSummary=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary instance */ - CreateNotificationChannelRequest.create = function create(properties) { - return new CreateNotificationChannelRequest(properties); + CreateTimeSeriesSummary.create = function create(properties) { + return new CreateTimeSeriesSummary(properties); }; /** - * Encodes the specified CreateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. + * Encodes the specified CreateTimeSeriesSummary message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static - * @param {google.monitoring.v3.ICreateNotificationChannelRequest} message CreateNotificationChannelRequest message or plain object to encode + * @param {google.monitoring.v3.ICreateTimeSeriesSummary} message CreateTimeSeriesSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNotificationChannelRequest.encode = function encode(message, writer) { + CreateTimeSeriesSummary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) - $root.google.monitoring.v3.NotificationChannel.encode(message.notificationChannel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.totalPointCount != null && message.hasOwnProperty("totalPointCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalPointCount); + if (message.successPointCount != null && message.hasOwnProperty("successPointCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.successPointCount); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.encode(message.errors[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. + * Encodes the specified CreateTimeSeriesSummary message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static - * @param {google.monitoring.v3.ICreateNotificationChannelRequest} message CreateNotificationChannelRequest message or plain object to encode + * @param {google.monitoring.v3.ICreateTimeSeriesSummary} message CreateTimeSeriesSummary message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateTimeSeriesSummary.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer. + * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest + * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNotificationChannelRequest.decode = function decode(reader, length) { + CreateTimeSeriesSummary.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateNotificationChannelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesSummary(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.name = reader.string(); + case 1: + message.totalPointCount = reader.int32(); break; case 2: - message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.decode(reader, reader.uint32()); + message.successPointCount = reader.int32(); + break; + case 3: + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.monitoring.v3.CreateTimeSeriesSummary.Error.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -12724,125 +11466,365 @@ }; /** - * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTimeSeriesSummary message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest + * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { + CreateTimeSeriesSummary.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateNotificationChannelRequest message. + * Verifies a CreateTimeSeriesSummary message. * @function verify - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateNotificationChannelRequest.verify = function verify(message) { + CreateTimeSeriesSummary.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) { - var error = $root.google.monitoring.v3.NotificationChannel.verify(message.notificationChannel); - if (error) - return "notificationChannel." + error; + if (message.totalPointCount != null && message.hasOwnProperty("totalPointCount")) + if (!$util.isInteger(message.totalPointCount)) + return "totalPointCount: integer expected"; + if (message.successPointCount != null && message.hasOwnProperty("successPointCount")) + if (!$util.isInteger(message.successPointCount)) + return "successPointCount: integer expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.verify(message.errors[i]); + if (error) + return "errors." + error; + } } return null; }; /** - * Creates a CreateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTimeSeriesSummary message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest + * @returns {google.monitoring.v3.CreateTimeSeriesSummary} CreateTimeSeriesSummary */ - CreateNotificationChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateNotificationChannelRequest) + CreateTimeSeriesSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesSummary) return object; - var message = new $root.google.monitoring.v3.CreateNotificationChannelRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.notificationChannel != null) { - if (typeof object.notificationChannel !== "object") - throw TypeError(".google.monitoring.v3.CreateNotificationChannelRequest.notificationChannel: object expected"); - message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.fromObject(object.notificationChannel); + var message = new $root.google.monitoring.v3.CreateTimeSeriesSummary(); + if (object.totalPointCount != null) + message.totalPointCount = object.totalPointCount | 0; + if (object.successPointCount != null) + message.successPointCount = object.successPointCount | 0; + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.monitoring.v3.CreateTimeSeriesSummary.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.monitoring.v3.CreateTimeSeriesSummary.errors: object expected"); + message.errors[i] = $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.fromObject(object.errors[i]); + } } return message; }; /** - * Creates a plain object from a CreateNotificationChannelRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateTimeSeriesSummary message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @static - * @param {google.monitoring.v3.CreateNotificationChannelRequest} message CreateNotificationChannelRequest + * @param {google.monitoring.v3.CreateTimeSeriesSummary} message CreateTimeSeriesSummary * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateNotificationChannelRequest.toObject = function toObject(message, options) { + CreateTimeSeriesSummary.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.errors = []; if (options.defaults) { - object.notificationChannel = null; - object.name = ""; + object.totalPointCount = 0; + object.successPointCount = 0; + } + if (message.totalPointCount != null && message.hasOwnProperty("totalPointCount")) + object.totalPointCount = message.totalPointCount; + if (message.successPointCount != null && message.hasOwnProperty("successPointCount")) + object.successPointCount = message.successPointCount; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.monitoring.v3.CreateTimeSeriesSummary.Error.toObject(message.errors[j], options); } - if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) - object.notificationChannel = $root.google.monitoring.v3.NotificationChannel.toObject(message.notificationChannel, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; return object; }; /** - * Converts this CreateNotificationChannelRequest to JSON. + * Converts this CreateTimeSeriesSummary to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateNotificationChannelRequest + * @memberof google.monitoring.v3.CreateTimeSeriesSummary * @instance * @returns {Object.} JSON object */ - CreateNotificationChannelRequest.prototype.toJSON = function toJSON() { + CreateTimeSeriesSummary.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateNotificationChannelRequest; + CreateTimeSeriesSummary.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @interface IError + * @property {google.rpc.IStatus|null} [status] Error status + * @property {number|null} [pointCount] Error pointCount + */ + + /** + * Constructs a new Error. + * @memberof google.monitoring.v3.CreateTimeSeriesSummary + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError=} [properties] Properties to set + */ + function Error(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @instance + */ + Error.prototype.status = null; + + /** + * Error pointCount. + * @member {number} pointCount + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @instance + */ + Error.prototype.pointCount = 0; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && message.hasOwnProperty("status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pointCount != null && message.hasOwnProperty("pointCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pointCount); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateTimeSeriesSummary.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {google.monitoring.v3.CreateTimeSeriesSummary.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateTimeSeriesSummary.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 2: + message.pointCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.pointCount != null && message.hasOwnProperty("pointCount")) + if (!$util.isInteger(message.pointCount)) + return "pointCount: integer expected"; + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.CreateTimeSeriesSummary.Error} Error + */ + Error.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateTimeSeriesSummary.Error) + return object; + var message = new $root.google.monitoring.v3.CreateTimeSeriesSummary.Error(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.monitoring.v3.CreateTimeSeriesSummary.Error.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.pointCount != null) + message.pointCount = object.pointCount | 0; + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @static + * @param {google.monitoring.v3.CreateTimeSeriesSummary.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.pointCount = 0; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.pointCount != null && message.hasOwnProperty("pointCount")) + object.pointCount = message.pointCount; + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.monitoring.v3.CreateTimeSeriesSummary.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Error; + })(); + + return CreateTimeSeriesSummary; })(); - v3.ListNotificationChannelsRequest = (function() { + v3.NotificationChannelDescriptor = (function() { /** - * Properties of a ListNotificationChannelsRequest. + * Properties of a NotificationChannelDescriptor. * @memberof google.monitoring.v3 - * @interface IListNotificationChannelsRequest - * @property {string|null} [name] ListNotificationChannelsRequest name - * @property {string|null} [filter] ListNotificationChannelsRequest filter - * @property {string|null} [orderBy] ListNotificationChannelsRequest orderBy - * @property {number|null} [pageSize] ListNotificationChannelsRequest pageSize - * @property {string|null} [pageToken] ListNotificationChannelsRequest pageToken + * @interface INotificationChannelDescriptor + * @property {string|null} [name] NotificationChannelDescriptor name + * @property {string|null} [type] NotificationChannelDescriptor type + * @property {string|null} [displayName] NotificationChannelDescriptor displayName + * @property {string|null} [description] NotificationChannelDescriptor description + * @property {Array.|null} [labels] NotificationChannelDescriptor labels + * @property {Array.|null} [supportedTiers] NotificationChannelDescriptor supportedTiers + * @property {google.api.LaunchStage|null} [launchStage] NotificationChannelDescriptor launchStage */ /** - * Constructs a new ListNotificationChannelsRequest. + * Constructs a new NotificationChannelDescriptor. * @memberof google.monitoring.v3 - * @classdesc Represents a ListNotificationChannelsRequest. - * @implements IListNotificationChannelsRequest + * @classdesc Represents a NotificationChannelDescriptor. + * @implements INotificationChannelDescriptor * @constructor - * @param {google.monitoring.v3.IListNotificationChannelsRequest=} [properties] Properties to set + * @param {google.monitoring.v3.INotificationChannelDescriptor=} [properties] Properties to set */ - function ListNotificationChannelsRequest(properties) { + function NotificationChannelDescriptor(properties) { + this.labels = []; + this.supportedTiers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12850,127 +11832,167 @@ } /** - * ListNotificationChannelsRequest name. + * NotificationChannelDescriptor name. * @member {string} name - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @instance */ - ListNotificationChannelsRequest.prototype.name = ""; + NotificationChannelDescriptor.prototype.name = ""; /** - * ListNotificationChannelsRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * NotificationChannelDescriptor type. + * @member {string} type + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @instance */ - ListNotificationChannelsRequest.prototype.filter = ""; + NotificationChannelDescriptor.prototype.type = ""; /** - * ListNotificationChannelsRequest orderBy. - * @member {string} orderBy - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * NotificationChannelDescriptor displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @instance */ - ListNotificationChannelsRequest.prototype.orderBy = ""; + NotificationChannelDescriptor.prototype.displayName = ""; /** - * ListNotificationChannelsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * NotificationChannelDescriptor description. + * @member {string} description + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @instance */ - ListNotificationChannelsRequest.prototype.pageSize = 0; + NotificationChannelDescriptor.prototype.description = ""; /** - * ListNotificationChannelsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * NotificationChannelDescriptor labels. + * @member {Array.} labels + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @instance */ - ListNotificationChannelsRequest.prototype.pageToken = ""; + NotificationChannelDescriptor.prototype.labels = $util.emptyArray; /** - * Creates a new ListNotificationChannelsRequest instance using the specified properties. + * NotificationChannelDescriptor supportedTiers. + * @member {Array.} supportedTiers + * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @instance + */ + NotificationChannelDescriptor.prototype.supportedTiers = $util.emptyArray; + + /** + * NotificationChannelDescriptor launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @instance + */ + NotificationChannelDescriptor.prototype.launchStage = 0; + + /** + * Creates a new NotificationChannelDescriptor instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static - * @param {google.monitoring.v3.IListNotificationChannelsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest instance + * @param {google.monitoring.v3.INotificationChannelDescriptor=} [properties] Properties to set + * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor instance */ - ListNotificationChannelsRequest.create = function create(properties) { - return new ListNotificationChannelsRequest(properties); + NotificationChannelDescriptor.create = function create(properties) { + return new NotificationChannelDescriptor(properties); }; /** - * Encodes the specified ListNotificationChannelsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. + * Encodes the specified NotificationChannelDescriptor message. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static - * @param {google.monitoring.v3.IListNotificationChannelsRequest} message ListNotificationChannelsRequest message or plain object to encode + * @param {google.monitoring.v3.INotificationChannelDescriptor} message NotificationChannelDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelsRequest.encode = function encode(message, writer) { + NotificationChannelDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.labels != null && message.labels.length) + for (var i = 0; i < message.labels.length; ++i) + $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.supportedTiers != null && message.supportedTiers.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.supportedTiers.length; ++i) + writer.int32(message.supportedTiers[i]); + writer.ldelim(); + } if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.orderBy); + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.launchStage); return writer; }; /** - * Encodes the specified ListNotificationChannelsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. + * Encodes the specified NotificationChannelDescriptor message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static - * @param {google.monitoring.v3.IListNotificationChannelsRequest} message ListNotificationChannelsRequest message or plain object to encode + * @param {google.monitoring.v3.INotificationChannelDescriptor} message NotificationChannelDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + NotificationChannelDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer. + * Decodes a NotificationChannelDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest + * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelsRequest.decode = function decode(reader, length) { + NotificationChannelDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.NotificationChannelDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: + case 6: message.name = reader.string(); break; - case 6: - message.filter = reader.string(); + case 1: + message.type = reader.string(); break; - case 7: - message.orderBy = reader.string(); + case 2: + message.displayName = reader.string(); break; case 3: - message.pageSize = reader.int32(); + message.description = reader.string(); break; case 4: - message.pageToken = reader.string(); + if (!(message.labels && message.labels.length)) + message.labels = []; + message.labels.push($root.google.api.LabelDescriptor.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.supportedTiers && message.supportedTiers.length)) + message.supportedTiers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.supportedTiers.push(reader.int32()); + } else + message.supportedTiers.push(reader.int32()); + break; + case 7: + message.launchStage = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12981,142 +12003,249 @@ }; /** - * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer, length delimited. + * Decodes a NotificationChannelDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest + * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelsRequest.decodeDelimited = function decodeDelimited(reader) { + NotificationChannelDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNotificationChannelsRequest message. + * Verifies a NotificationChannelDescriptor message. * @function verify - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNotificationChannelsRequest.verify = function verify(message) { + NotificationChannelDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListNotificationChannelsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!Array.isArray(message.labels)) + return "labels: array expected"; + for (var i = 0; i < message.labels.length; ++i) { + var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (error) + return "labels." + error; + } + } + if (message.supportedTiers != null && message.hasOwnProperty("supportedTiers")) { + if (!Array.isArray(message.supportedTiers)) + return "supportedTiers: array expected"; + for (var i = 0; i < message.supportedTiers.length; ++i) + switch (message.supportedTiers[i]) { + default: + return "supportedTiers: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a NotificationChannelDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest + * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor */ - ListNotificationChannelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListNotificationChannelsRequest) + NotificationChannelDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.NotificationChannelDescriptor) return object; - var message = new $root.google.monitoring.v3.ListNotificationChannelsRequest(); + var message = new $root.google.monitoring.v3.NotificationChannelDescriptor(); if (object.name != null) message.name = String(object.name); - 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); + 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.monitoring.v3.NotificationChannelDescriptor.labels: array expected"); + message.labels = []; + for (var i = 0; i < object.labels.length; ++i) { + if (typeof object.labels[i] !== "object") + throw TypeError(".google.monitoring.v3.NotificationChannelDescriptor.labels: object expected"); + message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + } + } + if (object.supportedTiers) { + if (!Array.isArray(object.supportedTiers)) + throw TypeError(".google.monitoring.v3.NotificationChannelDescriptor.supportedTiers: array expected"); + message.supportedTiers = []; + for (var i = 0; i < object.supportedTiers.length; ++i) + switch (object.supportedTiers[i]) { + default: + case "SERVICE_TIER_UNSPECIFIED": + case 0: + message.supportedTiers[i] = 0; + break; + case "SERVICE_TIER_BASIC": + case 1: + message.supportedTiers[i] = 1; + break; + case "SERVICE_TIER_PREMIUM": + case 2: + message.supportedTiers[i] = 2; + break; + } + } + switch (object.launchStage) { + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + 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 ListNotificationChannelsRequest message. Also converts values to other types if specified. + * Creates a plain object from a NotificationChannelDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @static - * @param {google.monitoring.v3.ListNotificationChannelsRequest} message ListNotificationChannelsRequest + * @param {google.monitoring.v3.NotificationChannelDescriptor} message NotificationChannelDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNotificationChannelsRequest.toObject = function toObject(message, options) { + NotificationChannelDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.labels = []; + object.supportedTiers = []; + } if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; + object.type = ""; + object.displayName = ""; + object.description = ""; object.name = ""; - object.filter = ""; - object.orderBy = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.labels && message.labels.length) { + object.labels = []; + for (var j = 0; j < message.labels.length; ++j) + object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); + } + if (message.supportedTiers && message.supportedTiers.length) { + object.supportedTiers = []; + for (var j = 0; j < message.supportedTiers.length; ++j) + object.supportedTiers[j] = options.enums === String ? $root.google.monitoring.v3.ServiceTier[message.supportedTiers[j]] : message.supportedTiers[j]; } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; return object; }; /** - * Converts this ListNotificationChannelsRequest to JSON. + * Converts this NotificationChannelDescriptor to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @memberof google.monitoring.v3.NotificationChannelDescriptor * @instance * @returns {Object.} JSON object */ - ListNotificationChannelsRequest.prototype.toJSON = function toJSON() { + NotificationChannelDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListNotificationChannelsRequest; + return NotificationChannelDescriptor; })(); - v3.ListNotificationChannelsResponse = (function() { + v3.NotificationChannel = (function() { /** - * Properties of a ListNotificationChannelsResponse. + * Properties of a NotificationChannel. * @memberof google.monitoring.v3 - * @interface IListNotificationChannelsResponse - * @property {Array.|null} [notificationChannels] ListNotificationChannelsResponse notificationChannels - * @property {string|null} [nextPageToken] ListNotificationChannelsResponse nextPageToken + * @interface INotificationChannel + * @property {string|null} [type] NotificationChannel type + * @property {string|null} [name] NotificationChannel name + * @property {string|null} [displayName] NotificationChannel displayName + * @property {string|null} [description] NotificationChannel description + * @property {Object.|null} [labels] NotificationChannel labels + * @property {Object.|null} [userLabels] NotificationChannel userLabels + * @property {google.monitoring.v3.NotificationChannel.VerificationStatus|null} [verificationStatus] NotificationChannel verificationStatus + * @property {google.protobuf.IBoolValue|null} [enabled] NotificationChannel enabled */ /** - * Constructs a new ListNotificationChannelsResponse. + * Constructs a new NotificationChannel. * @memberof google.monitoring.v3 - * @classdesc Represents a ListNotificationChannelsResponse. - * @implements IListNotificationChannelsResponse + * @classdesc Represents a NotificationChannel. + * @implements INotificationChannel * @constructor - * @param {google.monitoring.v3.IListNotificationChannelsResponse=} [properties] Properties to set + * @param {google.monitoring.v3.INotificationChannel=} [properties] Properties to set */ - function ListNotificationChannelsResponse(properties) { - this.notificationChannels = []; + function NotificationChannel(properties) { + this.labels = {}; + this.userLabels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13124,91 +12253,178 @@ } /** - * ListNotificationChannelsResponse notificationChannels. - * @member {Array.} notificationChannels - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * NotificationChannel type. + * @member {string} type + * @memberof google.monitoring.v3.NotificationChannel * @instance */ - ListNotificationChannelsResponse.prototype.notificationChannels = $util.emptyArray; + NotificationChannel.prototype.type = ""; /** - * ListNotificationChannelsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * NotificationChannel name. + * @member {string} name + * @memberof google.monitoring.v3.NotificationChannel * @instance */ - ListNotificationChannelsResponse.prototype.nextPageToken = ""; + NotificationChannel.prototype.name = ""; /** - * Creates a new ListNotificationChannelsResponse instance using the specified properties. + * NotificationChannel displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.NotificationChannel + * @instance + */ + NotificationChannel.prototype.displayName = ""; + + /** + * NotificationChannel description. + * @member {string} description + * @memberof google.monitoring.v3.NotificationChannel + * @instance + */ + NotificationChannel.prototype.description = ""; + + /** + * NotificationChannel labels. + * @member {Object.} labels + * @memberof google.monitoring.v3.NotificationChannel + * @instance + */ + NotificationChannel.prototype.labels = $util.emptyObject; + + /** + * NotificationChannel userLabels. + * @member {Object.} userLabels + * @memberof google.monitoring.v3.NotificationChannel + * @instance + */ + NotificationChannel.prototype.userLabels = $util.emptyObject; + + /** + * NotificationChannel verificationStatus. + * @member {google.monitoring.v3.NotificationChannel.VerificationStatus} verificationStatus + * @memberof google.monitoring.v3.NotificationChannel + * @instance + */ + NotificationChannel.prototype.verificationStatus = 0; + + /** + * NotificationChannel enabled. + * @member {google.protobuf.IBoolValue|null|undefined} enabled + * @memberof google.monitoring.v3.NotificationChannel + * @instance + */ + NotificationChannel.prototype.enabled = null; + + /** + * Creates a new NotificationChannel instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static - * @param {google.monitoring.v3.IListNotificationChannelsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse instance + * @param {google.monitoring.v3.INotificationChannel=} [properties] Properties to set + * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel instance */ - ListNotificationChannelsResponse.create = function create(properties) { - return new ListNotificationChannelsResponse(properties); + NotificationChannel.create = function create(properties) { + return new NotificationChannel(properties); }; /** - * Encodes the specified ListNotificationChannelsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. + * Encodes the specified NotificationChannel message. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static - * @param {google.monitoring.v3.IListNotificationChannelsResponse} message ListNotificationChannelsResponse message or plain object to encode + * @param {google.monitoring.v3.INotificationChannel} message NotificationChannel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelsResponse.encode = function encode(message, writer) { + NotificationChannel.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.notificationChannels != null && message.notificationChannels.length) - for (var i = 0; i < message.notificationChannels.length; ++i) - $root.google.monitoring.v3.NotificationChannel.encode(message.notificationChannels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.userLabels != null && message.hasOwnProperty("userLabels")) + for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); + if (message.verificationStatus != null && message.hasOwnProperty("verificationStatus")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.verificationStatus); + if (message.enabled != null && message.hasOwnProperty("enabled")) + $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListNotificationChannelsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. + * Encodes the specified NotificationChannel message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static - * @param {google.monitoring.v3.IListNotificationChannelsResponse} message ListNotificationChannelsResponse message or plain object to encode + * @param {google.monitoring.v3.INotificationChannel} message NotificationChannel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListNotificationChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + NotificationChannel.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer. + * Decodes a NotificationChannel message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse + * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelsResponse.decode = function decode(reader, length) { + NotificationChannel.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.NotificationChannel(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 6: + message.name = reader.string(); + break; case 3: - if (!(message.notificationChannels && message.notificationChannels.length)) - message.notificationChannels = []; - message.notificationChannels.push($root.google.monitoring.v3.NotificationChannel.decode(reader, reader.uint32())); + message.displayName = reader.string(); break; - case 2: - message.nextPageToken = reader.string(); + case 4: + message.description = reader.string(); + break; + case 5: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + case 8: + reader.skip().pos++; + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + key = reader.string(); + reader.pos++; + message.userLabels[key] = reader.string(); + break; + case 9: + message.verificationStatus = reader.int32(); + break; + case 11: + message.enabled = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13219,541 +12435,599 @@ }; /** - * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer, length delimited. + * Decodes a NotificationChannel message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse + * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListNotificationChannelsResponse.decodeDelimited = function decodeDelimited(reader) { + NotificationChannel.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListNotificationChannelsResponse message. + * Verifies a NotificationChannel message. * @function verify - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListNotificationChannelsResponse.verify = function verify(message) { + NotificationChannel.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.notificationChannels != null && message.hasOwnProperty("notificationChannels")) { - if (!Array.isArray(message.notificationChannels)) - return "notificationChannels: array expected"; - for (var i = 0; i < message.notificationChannels.length; ++i) { - var error = $root.google.monitoring.v3.NotificationChannel.verify(message.notificationChannels[i]); - if (error) - return "notificationChannels." + error; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$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.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + if (message.verificationStatus != null && message.hasOwnProperty("verificationStatus")) + switch (message.verificationStatus) { + default: + return "verificationStatus: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.enabled != null && message.hasOwnProperty("enabled")) { + var error = $root.google.protobuf.BoolValue.verify(message.enabled); + if (error) + return "enabled." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListNotificationChannelsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationChannel message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse + * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel */ - ListNotificationChannelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListNotificationChannelsResponse) + NotificationChannel.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.NotificationChannel) return object; - var message = new $root.google.monitoring.v3.ListNotificationChannelsResponse(); - if (object.notificationChannels) { - if (!Array.isArray(object.notificationChannels)) - throw TypeError(".google.monitoring.v3.ListNotificationChannelsResponse.notificationChannels: array expected"); - message.notificationChannels = []; - for (var i = 0; i < object.notificationChannels.length; ++i) { - if (typeof object.notificationChannels[i] !== "object") - throw TypeError(".google.monitoring.v3.ListNotificationChannelsResponse.notificationChannels: object expected"); - message.notificationChannels[i] = $root.google.monitoring.v3.NotificationChannel.fromObject(object.notificationChannels[i]); - } + var message = new $root.google.monitoring.v3.NotificationChannel(); + if (object.type != null) + message.type = String(object.type); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.monitoring.v3.NotificationChannel.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.monitoring.v3.NotificationChannel.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } + switch (object.verificationStatus) { + case "VERIFICATION_STATUS_UNSPECIFIED": + case 0: + message.verificationStatus = 0; + break; + case "UNVERIFIED": + case 1: + message.verificationStatus = 1; + break; + case "VERIFIED": + case 2: + message.verificationStatus = 2; + break; + } + if (object.enabled != null) { + if (typeof object.enabled !== "object") + throw TypeError(".google.monitoring.v3.NotificationChannel.enabled: object expected"); + message.enabled = $root.google.protobuf.BoolValue.fromObject(object.enabled); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListNotificationChannelsResponse message. Also converts values to other types if specified. + * Creates a plain object from a NotificationChannel message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @static - * @param {google.monitoring.v3.ListNotificationChannelsResponse} message ListNotificationChannelsResponse + * @param {google.monitoring.v3.NotificationChannel} message NotificationChannel * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListNotificationChannelsResponse.toObject = function toObject(message, options) { + NotificationChannel.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.notificationChannels = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.notificationChannels && message.notificationChannels.length) { - object.notificationChannels = []; - for (var j = 0; j < message.notificationChannels.length; ++j) - object.notificationChannels[j] = $root.google.monitoring.v3.NotificationChannel.toObject(message.notificationChannels[j], options); + if (options.objects || options.defaults) { + object.labels = {}; + object.userLabels = {}; + } + if (options.defaults) { + object.type = ""; + object.displayName = ""; + object.description = ""; + object.name = ""; + object.verificationStatus = options.enums === String ? "VERIFICATION_STATUS_UNSPECIFIED" : 0; + object.enabled = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; } + if (message.verificationStatus != null && message.hasOwnProperty("verificationStatus")) + object.verificationStatus = options.enums === String ? $root.google.monitoring.v3.NotificationChannel.VerificationStatus[message.verificationStatus] : message.verificationStatus; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options); return object; }; /** - * Converts this ListNotificationChannelsResponse to JSON. + * Converts this NotificationChannel to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListNotificationChannelsResponse + * @memberof google.monitoring.v3.NotificationChannel * @instance * @returns {Object.} JSON object */ - ListNotificationChannelsResponse.prototype.toJSON = function toJSON() { + NotificationChannel.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListNotificationChannelsResponse; - })(); - - v3.GetNotificationChannelRequest = (function() { - /** - * Properties of a GetNotificationChannelRequest. - * @memberof google.monitoring.v3 - * @interface IGetNotificationChannelRequest - * @property {string|null} [name] GetNotificationChannelRequest name + * VerificationStatus enum. + * @name google.monitoring.v3.NotificationChannel.VerificationStatus + * @enum {string} + * @property {number} VERIFICATION_STATUS_UNSPECIFIED=0 VERIFICATION_STATUS_UNSPECIFIED value + * @property {number} UNVERIFIED=1 UNVERIFIED value + * @property {number} VERIFIED=2 VERIFIED value */ + NotificationChannel.VerificationStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VERIFICATION_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + values[valuesById[2] = "VERIFIED"] = 2; + return values; + })(); + + return NotificationChannel; + })(); + + v3.NotificationChannelService = (function() { /** - * Constructs a new GetNotificationChannelRequest. + * Constructs a new NotificationChannelService service. * @memberof google.monitoring.v3 - * @classdesc Represents a GetNotificationChannelRequest. - * @implements IGetNotificationChannelRequest + * @classdesc Represents a NotificationChannelService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.monitoring.v3.IGetNotificationChannelRequest=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function GetNotificationChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function NotificationChannelService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * GetNotificationChannelRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @instance - */ - GetNotificationChannelRequest.prototype.name = ""; + (NotificationChannelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NotificationChannelService; /** - * Creates a new GetNotificationChannelRequest instance using the specified properties. + * Creates new NotificationChannelService service using the specified rpc implementation. * @function create - * @memberof google.monitoring.v3.GetNotificationChannelRequest + * @memberof google.monitoring.v3.NotificationChannelService * @static - * @param {google.monitoring.v3.IGetNotificationChannelRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest instance + * @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 {NotificationChannelService} RPC service. Useful where requests and/or responses are streamed. */ - GetNotificationChannelRequest.create = function create(properties) { - return new GetNotificationChannelRequest(properties); + NotificationChannelService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified GetNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {google.monitoring.v3.IGetNotificationChannelRequest} message GetNotificationChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannelDescriptors}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef ListNotificationChannelDescriptorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} [response] ListNotificationChannelDescriptorsResponse */ - GetNotificationChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; /** - * Encodes the specified GetNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {google.monitoring.v3.IGetNotificationChannelRequest} message GetNotificationChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListNotificationChannelDescriptors. + * @function listNotificationChannelDescriptors + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} request ListNotificationChannelDescriptorsRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.ListNotificationChannelDescriptorsCallback} callback Node-style callback called with the error, if any, and ListNotificationChannelDescriptorsResponse + * @returns {undefined} + * @variation 1 */ - GetNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(NotificationChannelService.prototype.listNotificationChannelDescriptors = function listNotificationChannelDescriptors(request, callback) { + return this.rpcCall(listNotificationChannelDescriptors, $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest, $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse, request, callback); + }, "name", { value: "ListNotificationChannelDescriptors" }); /** - * Decodes a GetNotificationChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListNotificationChannelDescriptors. + * @function listNotificationChannelDescriptors + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} request ListNotificationChannelDescriptorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetNotificationChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GetNotificationChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelDescriptor}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef GetNotificationChannelDescriptorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.NotificationChannelDescriptor} [response] NotificationChannelDescriptor */ - GetNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a GetNotificationChannelRequest message. - * @function verify - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetNotificationChannelDescriptor. + * @function getNotificationChannelDescriptor + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} request GetNotificationChannelDescriptorRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptorCallback} callback Node-style callback called with the error, if any, and NotificationChannelDescriptor + * @returns {undefined} + * @variation 1 */ - GetNotificationChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + Object.defineProperty(NotificationChannelService.prototype.getNotificationChannelDescriptor = function getNotificationChannelDescriptor(request, callback) { + return this.rpcCall(getNotificationChannelDescriptor, $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest, $root.google.monitoring.v3.NotificationChannelDescriptor, request, callback); + }, "name", { value: "GetNotificationChannelDescriptor" }); /** - * Creates a GetNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest + * Calls GetNotificationChannelDescriptor. + * @function getNotificationChannelDescriptor + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} request GetNotificationChannelDescriptorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetNotificationChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetNotificationChannelRequest) - return object; - var message = new $root.google.monitoring.v3.GetNotificationChannelRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a GetNotificationChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.GetNotificationChannelRequest - * @static - * @param {google.monitoring.v3.GetNotificationChannelRequest} message GetNotificationChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#listNotificationChannels}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef ListNotificationChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListNotificationChannelsResponse} [response] ListNotificationChannelsResponse */ - GetNotificationChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; /** - * Converts this GetNotificationChannelRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.GetNotificationChannelRequest + * Calls ListNotificationChannels. + * @function listNotificationChannels + * @memberof google.monitoring.v3.NotificationChannelService * @instance - * @returns {Object.} JSON object + * @param {google.monitoring.v3.IListNotificationChannelsRequest} request ListNotificationChannelsRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.ListNotificationChannelsCallback} callback Node-style callback called with the error, if any, and ListNotificationChannelsResponse + * @returns {undefined} + * @variation 1 */ - GetNotificationChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return GetNotificationChannelRequest; - })(); - - v3.UpdateNotificationChannelRequest = (function() { + Object.defineProperty(NotificationChannelService.prototype.listNotificationChannels = function listNotificationChannels(request, callback) { + return this.rpcCall(listNotificationChannels, $root.google.monitoring.v3.ListNotificationChannelsRequest, $root.google.monitoring.v3.ListNotificationChannelsResponse, request, callback); + }, "name", { value: "ListNotificationChannels" }); /** - * Properties of an UpdateNotificationChannelRequest. - * @memberof google.monitoring.v3 - * @interface IUpdateNotificationChannelRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationChannelRequest updateMask - * @property {google.monitoring.v3.INotificationChannel|null} [notificationChannel] UpdateNotificationChannelRequest notificationChannel + * Calls ListNotificationChannels. + * @function listNotificationChannels + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IListNotificationChannelsRequest} request ListNotificationChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new UpdateNotificationChannelRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents an UpdateNotificationChannelRequest. - * @implements IUpdateNotificationChannelRequest - * @constructor - * @param {google.monitoring.v3.IUpdateNotificationChannelRequest=} [properties] Properties to set + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannel}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef GetNotificationChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel */ - function UpdateNotificationChannelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * UpdateNotificationChannelRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * Calls GetNotificationChannel. + * @function getNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService * @instance + * @param {google.monitoring.v3.IGetNotificationChannelRequest} request GetNotificationChannelRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.GetNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel + * @returns {undefined} + * @variation 1 */ - UpdateNotificationChannelRequest.prototype.updateMask = null; + Object.defineProperty(NotificationChannelService.prototype.getNotificationChannel = function getNotificationChannel(request, callback) { + return this.rpcCall(getNotificationChannel, $root.google.monitoring.v3.GetNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); + }, "name", { value: "GetNotificationChannel" }); /** - * UpdateNotificationChannelRequest notificationChannel. - * @member {google.monitoring.v3.INotificationChannel|null|undefined} notificationChannel - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * Calls GetNotificationChannel. + * @function getNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService * @instance + * @param {google.monitoring.v3.IGetNotificationChannelRequest} request GetNotificationChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateNotificationChannelRequest.prototype.notificationChannel = null; /** - * Creates a new UpdateNotificationChannelRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {google.monitoring.v3.IUpdateNotificationChannelRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest instance + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#createNotificationChannel}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef CreateNotificationChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel */ - UpdateNotificationChannelRequest.create = function create(properties) { - return new UpdateNotificationChannelRequest(properties); - }; /** - * Encodes the specified UpdateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} message UpdateNotificationChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateNotificationChannel. + * @function createNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.ICreateNotificationChannelRequest} request CreateNotificationChannelRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.CreateNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel + * @returns {undefined} + * @variation 1 */ - UpdateNotificationChannelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) - $root.google.monitoring.v3.NotificationChannel.encode(message.notificationChannel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + Object.defineProperty(NotificationChannelService.prototype.createNotificationChannel = function createNotificationChannel(request, callback) { + return this.rpcCall(createNotificationChannel, $root.google.monitoring.v3.CreateNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); + }, "name", { value: "CreateNotificationChannel" }); /** - * Encodes the specified UpdateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} message UpdateNotificationChannelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateNotificationChannel. + * @function createNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.ICreateNotificationChannelRequest} request CreateNotificationChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#updateNotificationChannel}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef UpdateNotificationChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel */ - UpdateNotificationChannelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateNotificationChannelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 3: - message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateNotificationChannel. + * @function updateNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} request UpdateNotificationChannelRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.UpdateNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel + * @returns {undefined} + * @variation 1 */ - UpdateNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(NotificationChannelService.prototype.updateNotificationChannel = function updateNotificationChannel(request, callback) { + return this.rpcCall(updateNotificationChannel, $root.google.monitoring.v3.UpdateNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); + }, "name", { value: "UpdateNotificationChannel" }); /** - * Verifies an UpdateNotificationChannelRequest message. - * @function verify - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateNotificationChannel. + * @function updateNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} request UpdateNotificationChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateNotificationChannelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) { - var error = $root.google.monitoring.v3.NotificationChannel.verify(message.notificationChannel); - if (error) - return "notificationChannel." + error; - } - return null; - }; /** - * Creates an UpdateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#deleteNotificationChannel}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef DeleteNotificationChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - UpdateNotificationChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.UpdateNotificationChannelRequest) - return object; - var message = new $root.google.monitoring.v3.UpdateNotificationChannelRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.monitoring.v3.UpdateNotificationChannelRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.notificationChannel != null) { - if (typeof object.notificationChannel !== "object") - throw TypeError(".google.monitoring.v3.UpdateNotificationChannelRequest.notificationChannel: object expected"); - message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.fromObject(object.notificationChannel); - } - return message; - }; /** - * Creates a plain object from an UpdateNotificationChannelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest - * @static - * @param {google.monitoring.v3.UpdateNotificationChannelRequest} message UpdateNotificationChannelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls DeleteNotificationChannel. + * @function deleteNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} request DeleteNotificationChannelRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.DeleteNotificationChannelCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - UpdateNotificationChannelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.notificationChannel = null; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) - object.notificationChannel = $root.google.monitoring.v3.NotificationChannel.toObject(message.notificationChannel, options); - return object; - }; + Object.defineProperty(NotificationChannelService.prototype.deleteNotificationChannel = function deleteNotificationChannel(request, callback) { + return this.rpcCall(deleteNotificationChannel, $root.google.monitoring.v3.DeleteNotificationChannelRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteNotificationChannel" }); /** - * Converts this UpdateNotificationChannelRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * Calls DeleteNotificationChannel. + * @function deleteNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService * @instance - * @returns {Object.} JSON object + * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} request DeleteNotificationChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateNotificationChannelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return UpdateNotificationChannelRequest; + /** + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#sendNotificationChannelVerificationCode}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef SendNotificationChannelVerificationCodeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls SendNotificationChannelVerificationCode. + * @function sendNotificationChannelVerificationCode + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} request SendNotificationChannelVerificationCodeRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.SendNotificationChannelVerificationCodeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NotificationChannelService.prototype.sendNotificationChannelVerificationCode = function sendNotificationChannelVerificationCode(request, callback) { + return this.rpcCall(sendNotificationChannelVerificationCode, $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "SendNotificationChannelVerificationCode" }); + + /** + * Calls SendNotificationChannelVerificationCode. + * @function sendNotificationChannelVerificationCode + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} request SendNotificationChannelVerificationCodeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#getNotificationChannelVerificationCode}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef GetNotificationChannelVerificationCodeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} [response] GetNotificationChannelVerificationCodeResponse + */ + + /** + * Calls GetNotificationChannelVerificationCode. + * @function getNotificationChannelVerificationCode + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} request GetNotificationChannelVerificationCodeRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.GetNotificationChannelVerificationCodeCallback} callback Node-style callback called with the error, if any, and GetNotificationChannelVerificationCodeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NotificationChannelService.prototype.getNotificationChannelVerificationCode = function getNotificationChannelVerificationCode(request, callback) { + return this.rpcCall(getNotificationChannelVerificationCode, $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest, $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse, request, callback); + }, "name", { value: "GetNotificationChannelVerificationCode" }); + + /** + * Calls GetNotificationChannelVerificationCode. + * @function getNotificationChannelVerificationCode + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} request GetNotificationChannelVerificationCodeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.NotificationChannelService#verifyNotificationChannel}. + * @memberof google.monitoring.v3.NotificationChannelService + * @typedef VerifyNotificationChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.NotificationChannel} [response] NotificationChannel + */ + + /** + * Calls VerifyNotificationChannel. + * @function verifyNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} request VerifyNotificationChannelRequest message or plain object + * @param {google.monitoring.v3.NotificationChannelService.VerifyNotificationChannelCallback} callback Node-style callback called with the error, if any, and NotificationChannel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NotificationChannelService.prototype.verifyNotificationChannel = function verifyNotificationChannel(request, callback) { + return this.rpcCall(verifyNotificationChannel, $root.google.monitoring.v3.VerifyNotificationChannelRequest, $root.google.monitoring.v3.NotificationChannel, request, callback); + }, "name", { value: "VerifyNotificationChannel" }); + + /** + * Calls VerifyNotificationChannel. + * @function verifyNotificationChannel + * @memberof google.monitoring.v3.NotificationChannelService + * @instance + * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} request VerifyNotificationChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NotificationChannelService; })(); - v3.DeleteNotificationChannelRequest = (function() { + v3.ListNotificationChannelDescriptorsRequest = (function() { /** - * Properties of a DeleteNotificationChannelRequest. + * Properties of a ListNotificationChannelDescriptorsRequest. * @memberof google.monitoring.v3 - * @interface IDeleteNotificationChannelRequest - * @property {string|null} [name] DeleteNotificationChannelRequest name - * @property {boolean|null} [force] DeleteNotificationChannelRequest force + * @interface IListNotificationChannelDescriptorsRequest + * @property {string|null} [name] ListNotificationChannelDescriptorsRequest name + * @property {number|null} [pageSize] ListNotificationChannelDescriptorsRequest pageSize + * @property {string|null} [pageToken] ListNotificationChannelDescriptorsRequest pageToken */ /** - * Constructs a new DeleteNotificationChannelRequest. + * Constructs a new ListNotificationChannelDescriptorsRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteNotificationChannelRequest. - * @implements IDeleteNotificationChannelRequest + * @classdesc Represents a ListNotificationChannelDescriptorsRequest. + * @implements IListNotificationChannelDescriptorsRequest * @constructor - * @param {google.monitoring.v3.IDeleteNotificationChannelRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest=} [properties] Properties to set */ - function DeleteNotificationChannelRequest(properties) { + function ListNotificationChannelDescriptorsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13761,88 +13035,101 @@ } /** - * DeleteNotificationChannelRequest name. + * ListNotificationChannelDescriptorsRequest name. * @member {string} name - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @instance */ - DeleteNotificationChannelRequest.prototype.name = ""; + ListNotificationChannelDescriptorsRequest.prototype.name = ""; /** - * DeleteNotificationChannelRequest force. - * @member {boolean} force - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * ListNotificationChannelDescriptorsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @instance */ - DeleteNotificationChannelRequest.prototype.force = false; + ListNotificationChannelDescriptorsRequest.prototype.pageSize = 0; /** - * Creates a new DeleteNotificationChannelRequest instance using the specified properties. + * ListNotificationChannelDescriptorsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest + * @instance + */ + ListNotificationChannelDescriptorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListNotificationChannelDescriptorsRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static - * @param {google.monitoring.v3.IDeleteNotificationChannelRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest instance + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest instance */ - DeleteNotificationChannelRequest.create = function create(properties) { - return new DeleteNotificationChannelRequest(properties); + ListNotificationChannelDescriptorsRequest.create = function create(properties) { + return new ListNotificationChannelDescriptorsRequest(properties); }; /** - * Encodes the specified DeleteNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. + * Encodes the specified ListNotificationChannelDescriptorsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static - * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} message DeleteNotificationChannelRequest message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} message ListNotificationChannelDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNotificationChannelRequest.encode = function encode(message, writer) { + ListNotificationChannelDescriptorsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - if (message.force != null && message.hasOwnProperty("force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; /** - * Encodes the specified DeleteNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. + * Encodes the specified ListNotificationChannelDescriptorsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static - * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} message DeleteNotificationChannelRequest message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsRequest} message ListNotificationChannelDescriptorsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationChannelDescriptorsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer. + * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNotificationChannelRequest.decode = function decode(reader, length) { + ListNotificationChannelDescriptorsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteNotificationChannelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: + case 4: message.name = reader.string(); break; - case 5: - message.force = reader.bool(); + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -13853,116 +13140,126 @@ }; /** - * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelDescriptorsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { + ListNotificationChannelDescriptorsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteNotificationChannelRequest message. + * Verifies a ListNotificationChannelDescriptorsRequest message. * @function verify - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteNotificationChannelRequest.verify = function verify(message) { + ListNotificationChannelDescriptorsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a DeleteNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelDescriptorsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} ListNotificationChannelDescriptorsRequest */ - DeleteNotificationChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteNotificationChannelRequest) + ListNotificationChannelDescriptorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest) return object; - var message = new $root.google.monitoring.v3.DeleteNotificationChannelRequest(); + var message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsRequest(); if (object.name != null) message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); + 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 DeleteNotificationChannelRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationChannelDescriptorsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @static - * @param {google.monitoring.v3.DeleteNotificationChannelRequest} message DeleteNotificationChannelRequest + * @param {google.monitoring.v3.ListNotificationChannelDescriptorsRequest} message ListNotificationChannelDescriptorsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteNotificationChannelRequest.toObject = function toObject(message, options) { + ListNotificationChannelDescriptorsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; object.name = ""; - object.force = false; } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this DeleteNotificationChannelRequest to JSON. + * Converts this ListNotificationChannelDescriptorsRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsRequest * @instance * @returns {Object.} JSON object */ - DeleteNotificationChannelRequest.prototype.toJSON = function toJSON() { + ListNotificationChannelDescriptorsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteNotificationChannelRequest; + return ListNotificationChannelDescriptorsRequest; })(); - v3.SendNotificationChannelVerificationCodeRequest = (function() { + v3.ListNotificationChannelDescriptorsResponse = (function() { /** - * Properties of a SendNotificationChannelVerificationCodeRequest. + * Properties of a ListNotificationChannelDescriptorsResponse. * @memberof google.monitoring.v3 - * @interface ISendNotificationChannelVerificationCodeRequest - * @property {string|null} [name] SendNotificationChannelVerificationCodeRequest name + * @interface IListNotificationChannelDescriptorsResponse + * @property {Array.|null} [channelDescriptors] ListNotificationChannelDescriptorsResponse channelDescriptors + * @property {string|null} [nextPageToken] ListNotificationChannelDescriptorsResponse nextPageToken */ /** - * Constructs a new SendNotificationChannelVerificationCodeRequest. + * Constructs a new ListNotificationChannelDescriptorsResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a SendNotificationChannelVerificationCodeRequest. - * @implements ISendNotificationChannelVerificationCodeRequest + * @classdesc Represents a ListNotificationChannelDescriptorsResponse. + * @implements IListNotificationChannelDescriptorsResponse * @constructor - * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse=} [properties] Properties to set */ - function SendNotificationChannelVerificationCodeRequest(properties) { + function ListNotificationChannelDescriptorsResponse(properties) { + this.channelDescriptors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13970,75 +13267,91 @@ } /** - * SendNotificationChannelVerificationCodeRequest name. - * @member {string} name - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * ListNotificationChannelDescriptorsResponse channelDescriptors. + * @member {Array.} channelDescriptors + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @instance */ - SendNotificationChannelVerificationCodeRequest.prototype.name = ""; + ListNotificationChannelDescriptorsResponse.prototype.channelDescriptors = $util.emptyArray; /** - * Creates a new SendNotificationChannelVerificationCodeRequest instance using the specified properties. + * ListNotificationChannelDescriptorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse + * @instance + */ + ListNotificationChannelDescriptorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNotificationChannelDescriptorsResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static - * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest instance + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse instance */ - SendNotificationChannelVerificationCodeRequest.create = function create(properties) { - return new SendNotificationChannelVerificationCodeRequest(properties); + ListNotificationChannelDescriptorsResponse.create = function create(properties) { + return new ListNotificationChannelDescriptorsResponse(properties); }; /** - * Encodes the specified SendNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. + * Encodes the specified ListNotificationChannelDescriptorsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static - * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} message SendNotificationChannelVerificationCodeRequest message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse} message ListNotificationChannelDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendNotificationChannelVerificationCodeRequest.encode = function encode(message, writer) { + ListNotificationChannelDescriptorsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.channelDescriptors != null && message.channelDescriptors.length) + for (var i = 0; i < message.channelDescriptors.length; ++i) + $root.google.monitoring.v3.NotificationChannelDescriptor.encode(message.channelDescriptors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified SendNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. + * Encodes the specified ListNotificationChannelDescriptorsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static - * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} message SendNotificationChannelVerificationCodeRequest message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelDescriptorsResponse} message ListNotificationChannelDescriptorsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendNotificationChannelVerificationCodeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationChannelDescriptorsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer. + * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendNotificationChannelVerificationCodeRequest.decode = function decode(reader, length) { + ListNotificationChannelDescriptorsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.channelDescriptors && message.channelDescriptors.length)) + message.channelDescriptors = []; + message.channelDescriptors.push($root.google.monitoring.v3.NotificationChannelDescriptor.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14049,108 +13362,133 @@ }; /** - * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelDescriptorsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendNotificationChannelVerificationCodeRequest.decodeDelimited = function decodeDelimited(reader) { + ListNotificationChannelDescriptorsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SendNotificationChannelVerificationCodeRequest message. + * Verifies a ListNotificationChannelDescriptorsResponse message. * @function verify - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SendNotificationChannelVerificationCodeRequest.verify = function verify(message) { + ListNotificationChannelDescriptorsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.channelDescriptors != null && message.hasOwnProperty("channelDescriptors")) { + if (!Array.isArray(message.channelDescriptors)) + return "channelDescriptors: array expected"; + for (var i = 0; i < message.channelDescriptors.length; ++i) { + var error = $root.google.monitoring.v3.NotificationChannelDescriptor.verify(message.channelDescriptors[i]); + if (error) + return "channelDescriptors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a SendNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelDescriptorsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest + * @returns {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} ListNotificationChannelDescriptorsResponse */ - SendNotificationChannelVerificationCodeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest) + ListNotificationChannelDescriptorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse) return object; - var message = new $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.monitoring.v3.ListNotificationChannelDescriptorsResponse(); + if (object.channelDescriptors) { + if (!Array.isArray(object.channelDescriptors)) + throw TypeError(".google.monitoring.v3.ListNotificationChannelDescriptorsResponse.channelDescriptors: array expected"); + message.channelDescriptors = []; + for (var i = 0; i < object.channelDescriptors.length; ++i) { + if (typeof object.channelDescriptors[i] !== "object") + throw TypeError(".google.monitoring.v3.ListNotificationChannelDescriptorsResponse.channelDescriptors: object expected"); + message.channelDescriptors[i] = $root.google.monitoring.v3.NotificationChannelDescriptor.fromObject(object.channelDescriptors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a SendNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationChannelDescriptorsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @static - * @param {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} message SendNotificationChannelVerificationCodeRequest + * @param {google.monitoring.v3.ListNotificationChannelDescriptorsResponse} message ListNotificationChannelDescriptorsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SendNotificationChannelVerificationCodeRequest.toObject = function toObject(message, options) { + ListNotificationChannelDescriptorsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.channelDescriptors = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.channelDescriptors && message.channelDescriptors.length) { + object.channelDescriptors = []; + for (var j = 0; j < message.channelDescriptors.length; ++j) + object.channelDescriptors[j] = $root.google.monitoring.v3.NotificationChannelDescriptor.toObject(message.channelDescriptors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this SendNotificationChannelVerificationCodeRequest to JSON. + * Converts this ListNotificationChannelDescriptorsResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.ListNotificationChannelDescriptorsResponse * @instance * @returns {Object.} JSON object */ - SendNotificationChannelVerificationCodeRequest.prototype.toJSON = function toJSON() { + ListNotificationChannelDescriptorsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SendNotificationChannelVerificationCodeRequest; + return ListNotificationChannelDescriptorsResponse; })(); - v3.GetNotificationChannelVerificationCodeRequest = (function() { + v3.GetNotificationChannelDescriptorRequest = (function() { /** - * Properties of a GetNotificationChannelVerificationCodeRequest. + * Properties of a GetNotificationChannelDescriptorRequest. * @memberof google.monitoring.v3 - * @interface IGetNotificationChannelVerificationCodeRequest - * @property {string|null} [name] GetNotificationChannelVerificationCodeRequest name - * @property {google.protobuf.ITimestamp|null} [expireTime] GetNotificationChannelVerificationCodeRequest expireTime + * @interface IGetNotificationChannelDescriptorRequest + * @property {string|null} [name] GetNotificationChannelDescriptorRequest name */ /** - * Constructs a new GetNotificationChannelVerificationCodeRequest. + * Constructs a new GetNotificationChannelDescriptorRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a GetNotificationChannelVerificationCodeRequest. - * @implements IGetNotificationChannelVerificationCodeRequest + * @classdesc Represents a GetNotificationChannelDescriptorRequest. + * @implements IGetNotificationChannelDescriptorRequest * @constructor - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest=} [properties] Properties to set */ - function GetNotificationChannelVerificationCodeRequest(properties) { + function GetNotificationChannelDescriptorRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14158,89 +13496,76 @@ } /** - * GetNotificationChannelVerificationCodeRequest name. + * GetNotificationChannelDescriptorRequest name. * @member {string} name - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest - * @instance - */ - GetNotificationChannelVerificationCodeRequest.prototype.name = ""; - - /** - * GetNotificationChannelVerificationCodeRequest expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @instance */ - GetNotificationChannelVerificationCodeRequest.prototype.expireTime = null; + GetNotificationChannelDescriptorRequest.prototype.name = ""; /** - * Creates a new GetNotificationChannelVerificationCodeRequest instance using the specified properties. + * Creates a new GetNotificationChannelDescriptorRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest instance + * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest instance */ - GetNotificationChannelVerificationCodeRequest.create = function create(properties) { - return new GetNotificationChannelVerificationCodeRequest(properties); + GetNotificationChannelDescriptorRequest.create = function create(properties) { + return new GetNotificationChannelDescriptorRequest(properties); }; /** - * Encodes the specified GetNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. + * Encodes the specified GetNotificationChannelDescriptorRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} message GetNotificationChannelVerificationCodeRequest message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} message GetNotificationChannelDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationChannelVerificationCodeRequest.encode = function encode(message, writer) { + GetNotificationChannelDescriptorRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified GetNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. + * Encodes the specified GetNotificationChannelDescriptorRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelDescriptorRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} message GetNotificationChannelVerificationCodeRequest message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelDescriptorRequest} message GetNotificationChannelDescriptorRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationChannelVerificationCodeRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetNotificationChannelDescriptorRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer. + * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest + * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationChannelVerificationCodeRequest.decode = function decode(reader, length) { + GetNotificationChannelDescriptorRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: + case 3: message.name = reader.string(); break; - case 2: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -14250,122 +13575,108 @@ }; /** - * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationChannelDescriptorRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest + * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationChannelVerificationCodeRequest.decodeDelimited = function decodeDelimited(reader) { + GetNotificationChannelDescriptorRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNotificationChannelVerificationCodeRequest message. + * Verifies a GetNotificationChannelDescriptorRequest message. * @function verify - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNotificationChannelVerificationCodeRequest.verify = function verify(message) { + GetNotificationChannelDescriptorRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } return null; }; /** - * Creates a GetNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationChannelDescriptorRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest + * @returns {google.monitoring.v3.GetNotificationChannelDescriptorRequest} GetNotificationChannelDescriptorRequest */ - GetNotificationChannelVerificationCodeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest) + GetNotificationChannelDescriptorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest) return object; - var message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest(); + var message = new $root.google.monitoring.v3.GetNotificationChannelDescriptorRequest(); if (object.name != null) message.name = String(object.name); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } return message; }; /** - * Creates a plain object from a GetNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetNotificationChannelDescriptorRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @static - * @param {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} message GetNotificationChannelVerificationCodeRequest + * @param {google.monitoring.v3.GetNotificationChannelDescriptorRequest} message GetNotificationChannelDescriptorRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNotificationChannelVerificationCodeRequest.toObject = function toObject(message, options) { + GetNotificationChannelDescriptorRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.expireTime = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); return object; }; /** - * Converts this GetNotificationChannelVerificationCodeRequest to JSON. + * Converts this GetNotificationChannelDescriptorRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @memberof google.monitoring.v3.GetNotificationChannelDescriptorRequest * @instance * @returns {Object.} JSON object */ - GetNotificationChannelVerificationCodeRequest.prototype.toJSON = function toJSON() { + GetNotificationChannelDescriptorRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetNotificationChannelVerificationCodeRequest; + return GetNotificationChannelDescriptorRequest; })(); - v3.GetNotificationChannelVerificationCodeResponse = (function() { + v3.CreateNotificationChannelRequest = (function() { /** - * Properties of a GetNotificationChannelVerificationCodeResponse. + * Properties of a CreateNotificationChannelRequest. * @memberof google.monitoring.v3 - * @interface IGetNotificationChannelVerificationCodeResponse - * @property {string|null} [code] GetNotificationChannelVerificationCodeResponse code - * @property {google.protobuf.ITimestamp|null} [expireTime] GetNotificationChannelVerificationCodeResponse expireTime + * @interface ICreateNotificationChannelRequest + * @property {string|null} [name] CreateNotificationChannelRequest name + * @property {google.monitoring.v3.INotificationChannel|null} [notificationChannel] CreateNotificationChannelRequest notificationChannel */ /** - * Constructs a new GetNotificationChannelVerificationCodeResponse. + * Constructs a new CreateNotificationChannelRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a GetNotificationChannelVerificationCodeResponse. - * @implements IGetNotificationChannelVerificationCodeResponse + * @classdesc Represents a CreateNotificationChannelRequest. + * @implements ICreateNotificationChannelRequest * @constructor - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateNotificationChannelRequest=} [properties] Properties to set */ - function GetNotificationChannelVerificationCodeResponse(properties) { + function CreateNotificationChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14373,88 +13684,88 @@ } /** - * GetNotificationChannelVerificationCodeResponse code. - * @member {string} code - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * CreateNotificationChannelRequest name. + * @member {string} name + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @instance */ - GetNotificationChannelVerificationCodeResponse.prototype.code = ""; + CreateNotificationChannelRequest.prototype.name = ""; /** - * GetNotificationChannelVerificationCodeResponse expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * CreateNotificationChannelRequest notificationChannel. + * @member {google.monitoring.v3.INotificationChannel|null|undefined} notificationChannel + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @instance */ - GetNotificationChannelVerificationCodeResponse.prototype.expireTime = null; + CreateNotificationChannelRequest.prototype.notificationChannel = null; /** - * Creates a new GetNotificationChannelVerificationCodeResponse instance using the specified properties. + * Creates a new CreateNotificationChannelRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse instance + * @param {google.monitoring.v3.ICreateNotificationChannelRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest instance */ - GetNotificationChannelVerificationCodeResponse.create = function create(properties) { - return new GetNotificationChannelVerificationCodeResponse(properties); + CreateNotificationChannelRequest.create = function create(properties) { + return new CreateNotificationChannelRequest(properties); }; /** - * Encodes the specified GetNotificationChannelVerificationCodeResponse message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. + * Encodes the specified CreateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse} message GetNotificationChannelVerificationCodeResponse message or plain object to encode + * @param {google.monitoring.v3.ICreateNotificationChannelRequest} message CreateNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationChannelVerificationCodeResponse.encode = function encode(message, writer) { + CreateNotificationChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) + $root.google.monitoring.v3.NotificationChannel.encode(message.notificationChannel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified GetNotificationChannelVerificationCodeResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. + * Encodes the specified CreateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateNotificationChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static - * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse} message GetNotificationChannelVerificationCodeResponse message or plain object to encode + * @param {google.monitoring.v3.ICreateNotificationChannelRequest} message CreateNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetNotificationChannelVerificationCodeResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer. + * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse + * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationChannelVerificationCodeResponse.decode = function decode(reader, length) { + CreateNotificationChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateNotificationChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.string(); + case 3: + message.name = reader.string(); break; case 2: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14465,122 +13776,125 @@ }; /** - * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateNotificationChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse + * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetNotificationChannelVerificationCodeResponse.decodeDelimited = function decodeDelimited(reader) { + CreateNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetNotificationChannelVerificationCodeResponse message. + * Verifies a CreateNotificationChannelRequest message. * @function verify - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetNotificationChannelVerificationCodeResponse.verify = function verify(message) { + CreateNotificationChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isString(message.code)) - return "code: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) { + var error = $root.google.monitoring.v3.NotificationChannel.verify(message.notificationChannel); if (error) - return "expireTime." + error; + return "notificationChannel." + error; } return null; }; /** - * Creates a GetNotificationChannelVerificationCodeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse + * @returns {google.monitoring.v3.CreateNotificationChannelRequest} CreateNotificationChannelRequest */ - GetNotificationChannelVerificationCodeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse) + CreateNotificationChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateNotificationChannelRequest) return object; - var message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse(); - if (object.code != null) - message.code = String(object.code); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + var message = new $root.google.monitoring.v3.CreateNotificationChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.notificationChannel != null) { + if (typeof object.notificationChannel !== "object") + throw TypeError(".google.monitoring.v3.CreateNotificationChannelRequest.notificationChannel: object expected"); + message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.fromObject(object.notificationChannel); } return message; }; /** - * Creates a plain object from a GetNotificationChannelVerificationCodeResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateNotificationChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @static - * @param {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} message GetNotificationChannelVerificationCodeResponse + * @param {google.monitoring.v3.CreateNotificationChannelRequest} message CreateNotificationChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetNotificationChannelVerificationCodeResponse.toObject = function toObject(message, options) { + CreateNotificationChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.code = ""; - object.expireTime = null; + object.notificationChannel = null; + object.name = ""; } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) + object.notificationChannel = $root.google.monitoring.v3.NotificationChannel.toObject(message.notificationChannel, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GetNotificationChannelVerificationCodeResponse to JSON. + * Converts this CreateNotificationChannelRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse + * @memberof google.monitoring.v3.CreateNotificationChannelRequest * @instance * @returns {Object.} JSON object */ - GetNotificationChannelVerificationCodeResponse.prototype.toJSON = function toJSON() { + CreateNotificationChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetNotificationChannelVerificationCodeResponse; + return CreateNotificationChannelRequest; })(); - v3.VerifyNotificationChannelRequest = (function() { + v3.ListNotificationChannelsRequest = (function() { /** - * Properties of a VerifyNotificationChannelRequest. + * Properties of a ListNotificationChannelsRequest. * @memberof google.monitoring.v3 - * @interface IVerifyNotificationChannelRequest - * @property {string|null} [name] VerifyNotificationChannelRequest name - * @property {string|null} [code] VerifyNotificationChannelRequest code + * @interface IListNotificationChannelsRequest + * @property {string|null} [name] ListNotificationChannelsRequest name + * @property {string|null} [filter] ListNotificationChannelsRequest filter + * @property {string|null} [orderBy] ListNotificationChannelsRequest orderBy + * @property {number|null} [pageSize] ListNotificationChannelsRequest pageSize + * @property {string|null} [pageToken] ListNotificationChannelsRequest pageToken */ /** - * Constructs a new VerifyNotificationChannelRequest. + * Constructs a new ListNotificationChannelsRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a VerifyNotificationChannelRequest. - * @implements IVerifyNotificationChannelRequest + * @classdesc Represents a ListNotificationChannelsRequest. + * @implements IListNotificationChannelsRequest * @constructor - * @param {google.monitoring.v3.IVerifyNotificationChannelRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListNotificationChannelsRequest=} [properties] Properties to set */ - function VerifyNotificationChannelRequest(properties) { + function ListNotificationChannelsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14588,88 +13902,127 @@ } /** - * VerifyNotificationChannelRequest name. + * ListNotificationChannelsRequest name. * @member {string} name - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @instance */ - VerifyNotificationChannelRequest.prototype.name = ""; + ListNotificationChannelsRequest.prototype.name = ""; /** - * VerifyNotificationChannelRequest code. - * @member {string} code - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * ListNotificationChannelsRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @instance */ - VerifyNotificationChannelRequest.prototype.code = ""; + ListNotificationChannelsRequest.prototype.filter = ""; /** - * Creates a new VerifyNotificationChannelRequest instance using the specified properties. + * ListNotificationChannelsRequest orderBy. + * @member {string} orderBy + * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @instance + */ + ListNotificationChannelsRequest.prototype.orderBy = ""; + + /** + * ListNotificationChannelsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @instance + */ + ListNotificationChannelsRequest.prototype.pageSize = 0; + + /** + * ListNotificationChannelsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListNotificationChannelsRequest + * @instance + */ + ListNotificationChannelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListNotificationChannelsRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static - * @param {google.monitoring.v3.IVerifyNotificationChannelRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest instance + * @param {google.monitoring.v3.IListNotificationChannelsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest instance */ - VerifyNotificationChannelRequest.create = function create(properties) { - return new VerifyNotificationChannelRequest(properties); + ListNotificationChannelsRequest.create = function create(properties) { + return new ListNotificationChannelsRequest(properties); }; /** - * Encodes the specified VerifyNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. + * Encodes the specified ListNotificationChannelsRequest message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static - * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} message VerifyNotificationChannelRequest message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelsRequest} message ListNotificationChannelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifyNotificationChannelRequest.encode = function encode(message, writer) { + ListNotificationChannelsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.code != null && message.hasOwnProperty("code")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.code); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.orderBy); return writer; }; /** - * Encodes the specified VerifyNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. + * Encodes the specified ListNotificationChannelsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static - * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} message VerifyNotificationChannelRequest message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelsRequest} message ListNotificationChannelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifyNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer. + * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest + * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifyNotificationChannelRequest.decode = function decode(reader, length) { + ListNotificationChannelsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.VerifyNotificationChannelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: + case 5: message.name = reader.string(); break; - case 2: - message.code = reader.string(); + case 6: + message.filter = reader.string(); + break; + case 7: + message.orderBy = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14680,123 +14033,142 @@ }; /** - * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest + * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifyNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { + ListNotificationChannelsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VerifyNotificationChannelRequest message. + * Verifies a ListNotificationChannelsRequest message. * @function verify - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VerifyNotificationChannelRequest.verify = function verify(message) { + ListNotificationChannelsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isString(message.code)) - return "code: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a VerifyNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest + * @returns {google.monitoring.v3.ListNotificationChannelsRequest} ListNotificationChannelsRequest */ - VerifyNotificationChannelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.VerifyNotificationChannelRequest) + ListNotificationChannelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListNotificationChannelsRequest) return object; - var message = new $root.google.monitoring.v3.VerifyNotificationChannelRequest(); + var message = new $root.google.monitoring.v3.ListNotificationChannelsRequest(); if (object.name != null) message.name = String(object.name); - if (object.code != null) - message.code = String(object.code); + 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 VerifyNotificationChannelRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationChannelsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @static - * @param {google.monitoring.v3.VerifyNotificationChannelRequest} message VerifyNotificationChannelRequest + * @param {google.monitoring.v3.ListNotificationChannelsRequest} message ListNotificationChannelsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VerifyNotificationChannelRequest.toObject = function toObject(message, options) { + ListNotificationChannelsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; object.name = ""; - object.code = ""; + object.filter = ""; + object.orderBy = ""; } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this VerifyNotificationChannelRequest to JSON. + * Converts this ListNotificationChannelsRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.VerifyNotificationChannelRequest + * @memberof google.monitoring.v3.ListNotificationChannelsRequest * @instance * @returns {Object.} JSON object */ - VerifyNotificationChannelRequest.prototype.toJSON = function toJSON() { + ListNotificationChannelsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return VerifyNotificationChannelRequest; + return ListNotificationChannelsRequest; })(); - v3.NotificationChannelDescriptor = (function() { + v3.ListNotificationChannelsResponse = (function() { /** - * Properties of a NotificationChannelDescriptor. + * Properties of a ListNotificationChannelsResponse. * @memberof google.monitoring.v3 - * @interface INotificationChannelDescriptor - * @property {string|null} [name] NotificationChannelDescriptor name - * @property {string|null} [type] NotificationChannelDescriptor type - * @property {string|null} [displayName] NotificationChannelDescriptor displayName - * @property {string|null} [description] NotificationChannelDescriptor description - * @property {Array.|null} [labels] NotificationChannelDescriptor labels - * @property {Array.|null} [supportedTiers] NotificationChannelDescriptor supportedTiers + * @interface IListNotificationChannelsResponse + * @property {Array.|null} [notificationChannels] ListNotificationChannelsResponse notificationChannels + * @property {string|null} [nextPageToken] ListNotificationChannelsResponse nextPageToken */ /** - * Constructs a new NotificationChannelDescriptor. + * Constructs a new ListNotificationChannelsResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a NotificationChannelDescriptor. - * @implements INotificationChannelDescriptor + * @classdesc Represents a ListNotificationChannelsResponse. + * @implements IListNotificationChannelsResponse * @constructor - * @param {google.monitoring.v3.INotificationChannelDescriptor=} [properties] Properties to set + * @param {google.monitoring.v3.IListNotificationChannelsResponse=} [properties] Properties to set */ - function NotificationChannelDescriptor(properties) { - this.labels = []; - this.supportedTiers = []; + function ListNotificationChannelsResponse(properties) { + this.notificationChannels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14804,154 +14176,91 @@ } /** - * NotificationChannelDescriptor name. - * @member {string} name - * @memberof google.monitoring.v3.NotificationChannelDescriptor - * @instance - */ - NotificationChannelDescriptor.prototype.name = ""; - - /** - * NotificationChannelDescriptor type. - * @member {string} type - * @memberof google.monitoring.v3.NotificationChannelDescriptor - * @instance - */ - NotificationChannelDescriptor.prototype.type = ""; - - /** - * NotificationChannelDescriptor displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.NotificationChannelDescriptor - * @instance - */ - NotificationChannelDescriptor.prototype.displayName = ""; - - /** - * NotificationChannelDescriptor description. - * @member {string} description - * @memberof google.monitoring.v3.NotificationChannelDescriptor - * @instance - */ - NotificationChannelDescriptor.prototype.description = ""; - - /** - * NotificationChannelDescriptor labels. - * @member {Array.} labels - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * ListNotificationChannelsResponse notificationChannels. + * @member {Array.} notificationChannels + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @instance */ - NotificationChannelDescriptor.prototype.labels = $util.emptyArray; + ListNotificationChannelsResponse.prototype.notificationChannels = $util.emptyArray; /** - * NotificationChannelDescriptor supportedTiers. - * @member {Array.} supportedTiers - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * ListNotificationChannelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @instance */ - NotificationChannelDescriptor.prototype.supportedTiers = $util.emptyArray; + ListNotificationChannelsResponse.prototype.nextPageToken = ""; /** - * Creates a new NotificationChannelDescriptor instance using the specified properties. + * Creates a new ListNotificationChannelsResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static - * @param {google.monitoring.v3.INotificationChannelDescriptor=} [properties] Properties to set - * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor instance + * @param {google.monitoring.v3.IListNotificationChannelsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse instance */ - NotificationChannelDescriptor.create = function create(properties) { - return new NotificationChannelDescriptor(properties); + ListNotificationChannelsResponse.create = function create(properties) { + return new ListNotificationChannelsResponse(properties); }; /** - * Encodes the specified NotificationChannelDescriptor message. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. + * Encodes the specified ListNotificationChannelsResponse message. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static - * @param {google.monitoring.v3.INotificationChannelDescriptor} message NotificationChannelDescriptor message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelsResponse} message ListNotificationChannelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationChannelDescriptor.encode = function encode(message, writer) { + ListNotificationChannelsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.labels != null && message.labels.length) - for (var i = 0; i < message.labels.length; ++i) - $root.google.api.LabelDescriptor.encode(message.labels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.supportedTiers != null && message.supportedTiers.length) { - writer.uint32(/* id 5, wireType 2 =*/42).fork(); - for (var i = 0; i < message.supportedTiers.length; ++i) - writer.int32(message.supportedTiers[i]); - writer.ldelim(); - } - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.notificationChannels != null && message.notificationChannels.length) + for (var i = 0; i < message.notificationChannels.length; ++i) + $root.google.monitoring.v3.NotificationChannel.encode(message.notificationChannels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified NotificationChannelDescriptor message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannelDescriptor.verify|verify} messages. + * Encodes the specified ListNotificationChannelsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListNotificationChannelsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static - * @param {google.monitoring.v3.INotificationChannelDescriptor} message NotificationChannelDescriptor message or plain object to encode + * @param {google.monitoring.v3.IListNotificationChannelsResponse} message ListNotificationChannelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationChannelDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + ListNotificationChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationChannelDescriptor message from the specified reader or buffer. + * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor + * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationChannelDescriptor.decode = function decode(reader, length) { + ListNotificationChannelsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.NotificationChannelDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListNotificationChannelsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - 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())); + if (!(message.notificationChannels && message.notificationChannels.length)) + message.notificationChannels = []; + message.notificationChannels.push($root.google.monitoring.v3.NotificationChannel.decode(reader, reader.uint32())); break; - case 5: - if (!(message.supportedTiers && message.supportedTiers.length)) - message.supportedTiers = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.supportedTiers.push(reader.int32()); - } else - message.supportedTiers.push(reader.int32()); + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -14962,208 +14271,133 @@ }; /** - * Decodes a NotificationChannelDescriptor message from the specified reader or buffer, length delimited. + * Decodes a ListNotificationChannelsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor + * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationChannelDescriptor.decodeDelimited = function decodeDelimited(reader) { + ListNotificationChannelsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationChannelDescriptor message. + * Verifies a ListNotificationChannelsResponse message. * @function verify - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationChannelDescriptor.verify = function verify(message) { + ListNotificationChannelsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!Array.isArray(message.labels)) - return "labels: array expected"; - for (var i = 0; i < message.labels.length; ++i) { - var error = $root.google.api.LabelDescriptor.verify(message.labels[i]); + if (message.notificationChannels != null && message.hasOwnProperty("notificationChannels")) { + if (!Array.isArray(message.notificationChannels)) + return "notificationChannels: array expected"; + for (var i = 0; i < message.notificationChannels.length; ++i) { + var error = $root.google.monitoring.v3.NotificationChannel.verify(message.notificationChannels[i]); if (error) - return "labels." + error; + return "notificationChannels." + error; } } - if (message.supportedTiers != null && message.hasOwnProperty("supportedTiers")) { - if (!Array.isArray(message.supportedTiers)) - return "supportedTiers: array expected"; - for (var i = 0; i < message.supportedTiers.length; ++i) - switch (message.supportedTiers[i]) { - default: - return "supportedTiers: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a NotificationChannelDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a ListNotificationChannelsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.NotificationChannelDescriptor} NotificationChannelDescriptor + * @returns {google.monitoring.v3.ListNotificationChannelsResponse} ListNotificationChannelsResponse */ - NotificationChannelDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.NotificationChannelDescriptor) + ListNotificationChannelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListNotificationChannelsResponse) return object; - var message = new $root.google.monitoring.v3.NotificationChannelDescriptor(); - 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.monitoring.v3.NotificationChannelDescriptor.labels: array expected"); - message.labels = []; - for (var i = 0; i < object.labels.length; ++i) { - if (typeof object.labels[i] !== "object") - throw TypeError(".google.monitoring.v3.NotificationChannelDescriptor.labels: object expected"); - message.labels[i] = $root.google.api.LabelDescriptor.fromObject(object.labels[i]); + var message = new $root.google.monitoring.v3.ListNotificationChannelsResponse(); + if (object.notificationChannels) { + if (!Array.isArray(object.notificationChannels)) + throw TypeError(".google.monitoring.v3.ListNotificationChannelsResponse.notificationChannels: array expected"); + message.notificationChannels = []; + for (var i = 0; i < object.notificationChannels.length; ++i) { + if (typeof object.notificationChannels[i] !== "object") + throw TypeError(".google.monitoring.v3.ListNotificationChannelsResponse.notificationChannels: object expected"); + message.notificationChannels[i] = $root.google.monitoring.v3.NotificationChannel.fromObject(object.notificationChannels[i]); } } - if (object.supportedTiers) { - if (!Array.isArray(object.supportedTiers)) - throw TypeError(".google.monitoring.v3.NotificationChannelDescriptor.supportedTiers: array expected"); - message.supportedTiers = []; - for (var i = 0; i < object.supportedTiers.length; ++i) - switch (object.supportedTiers[i]) { - default: - case "SERVICE_TIER_UNSPECIFIED": - case 0: - message.supportedTiers[i] = 0; - break; - case "SERVICE_TIER_BASIC": - case 1: - message.supportedTiers[i] = 1; - break; - case "SERVICE_TIER_PREMIUM": - case 2: - message.supportedTiers[i] = 2; - break; - } - } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a NotificationChannelDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a ListNotificationChannelsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @static - * @param {google.monitoring.v3.NotificationChannelDescriptor} message NotificationChannelDescriptor + * @param {google.monitoring.v3.ListNotificationChannelsResponse} message ListNotificationChannelsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationChannelDescriptor.toObject = function toObject(message, options) { + ListNotificationChannelsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.labels = []; - object.supportedTiers = []; - } - if (options.defaults) { - object.type = ""; - object.displayName = ""; - object.description = ""; - object.name = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.labels && message.labels.length) { - object.labels = []; - for (var j = 0; j < message.labels.length; ++j) - object.labels[j] = $root.google.api.LabelDescriptor.toObject(message.labels[j], options); - } - if (message.supportedTiers && message.supportedTiers.length) { - object.supportedTiers = []; - for (var j = 0; j < message.supportedTiers.length; ++j) - object.supportedTiers[j] = options.enums === String ? $root.google.monitoring.v3.ServiceTier[message.supportedTiers[j]] : message.supportedTiers[j]; + if (options.arrays || options.defaults) + object.notificationChannels = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.notificationChannels && message.notificationChannels.length) { + object.notificationChannels = []; + for (var j = 0; j < message.notificationChannels.length; ++j) + object.notificationChannels[j] = $root.google.monitoring.v3.NotificationChannel.toObject(message.notificationChannels[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; return object; }; /** - * Converts this NotificationChannelDescriptor to JSON. + * Converts this ListNotificationChannelsResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.NotificationChannelDescriptor + * @memberof google.monitoring.v3.ListNotificationChannelsResponse * @instance * @returns {Object.} JSON object */ - NotificationChannelDescriptor.prototype.toJSON = function toJSON() { + ListNotificationChannelsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NotificationChannelDescriptor; + return ListNotificationChannelsResponse; })(); - v3.NotificationChannel = (function() { + v3.GetNotificationChannelRequest = (function() { /** - * Properties of a NotificationChannel. + * Properties of a GetNotificationChannelRequest. * @memberof google.monitoring.v3 - * @interface INotificationChannel - * @property {string|null} [type] NotificationChannel type - * @property {string|null} [name] NotificationChannel name - * @property {string|null} [displayName] NotificationChannel displayName - * @property {string|null} [description] NotificationChannel description - * @property {Object.|null} [labels] NotificationChannel labels - * @property {Object.|null} [userLabels] NotificationChannel userLabels - * @property {google.monitoring.v3.NotificationChannel.VerificationStatus|null} [verificationStatus] NotificationChannel verificationStatus - * @property {google.protobuf.IBoolValue|null} [enabled] NotificationChannel enabled + * @interface IGetNotificationChannelRequest + * @property {string|null} [name] GetNotificationChannelRequest name */ /** - * Constructs a new NotificationChannel. + * Constructs a new GetNotificationChannelRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a NotificationChannel. - * @implements INotificationChannel + * @classdesc Represents a GetNotificationChannelRequest. + * @implements IGetNotificationChannelRequest * @constructor - * @param {google.monitoring.v3.INotificationChannel=} [properties] Properties to set + * @param {google.monitoring.v3.IGetNotificationChannelRequest=} [properties] Properties to set */ - function NotificationChannel(properties) { - this.labels = {}; - this.userLabels = {}; + function GetNotificationChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15171,178 +14405,75 @@ } /** - * NotificationChannel type. - * @member {string} type - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.type = ""; - - /** - * NotificationChannel name. + * GetNotificationChannelRequest name. * @member {string} name - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.name = ""; - - /** - * NotificationChannel displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.displayName = ""; - - /** - * NotificationChannel description. - * @member {string} description - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.description = ""; - - /** - * NotificationChannel labels. - * @member {Object.} labels - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.labels = $util.emptyObject; - - /** - * NotificationChannel userLabels. - * @member {Object.} userLabels - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.userLabels = $util.emptyObject; - - /** - * NotificationChannel verificationStatus. - * @member {google.monitoring.v3.NotificationChannel.VerificationStatus} verificationStatus - * @memberof google.monitoring.v3.NotificationChannel - * @instance - */ - NotificationChannel.prototype.verificationStatus = 0; - - /** - * NotificationChannel enabled. - * @member {google.protobuf.IBoolValue|null|undefined} enabled - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @instance */ - NotificationChannel.prototype.enabled = null; + GetNotificationChannelRequest.prototype.name = ""; /** - * Creates a new NotificationChannel instance using the specified properties. + * Creates a new GetNotificationChannelRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static - * @param {google.monitoring.v3.INotificationChannel=} [properties] Properties to set - * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel instance + * @param {google.monitoring.v3.IGetNotificationChannelRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest instance */ - NotificationChannel.create = function create(properties) { - return new NotificationChannel(properties); + GetNotificationChannelRequest.create = function create(properties) { + return new GetNotificationChannelRequest(properties); }; /** - * Encodes the specified NotificationChannel message. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. + * Encodes the specified GetNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static - * @param {google.monitoring.v3.INotificationChannel} message NotificationChannel message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelRequest} message GetNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationChannel.encode = function encode(message, writer) { + GetNotificationChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); - if (message.userLabels != null && message.hasOwnProperty("userLabels")) - for (var keys = Object.keys(message.userLabels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim(); - if (message.verificationStatus != null && message.hasOwnProperty("verificationStatus")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.verificationStatus); - if (message.enabled != null && message.hasOwnProperty("enabled")) - $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified NotificationChannel message, length delimited. Does not implicitly {@link google.monitoring.v3.NotificationChannel.verify|verify} messages. + * Encodes the specified GetNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static - * @param {google.monitoring.v3.INotificationChannel} message NotificationChannel message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelRequest} message GetNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationChannel.encodeDelimited = function encodeDelimited(message, writer) { + GetNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationChannel message from the specified reader or buffer. + * Decodes a GetNotificationChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel + * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationChannel.decode = function decode(reader, length) { + GetNotificationChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.NotificationChannel(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 6: - message.name = reader.string(); - break; case 3: - message.displayName = reader.string(); - break; - case 4: - message.description = reader.string(); - break; - case 5: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; - case 8: - reader.skip().pos++; - if (message.userLabels === $util.emptyObject) - message.userLabels = {}; - key = reader.string(); - reader.pos++; - message.userLabels[key] = reader.string(); - break; - case 9: - message.verificationStatus = reader.int32(); - break; - case 11: - message.enabled = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -15353,701 +14484,417 @@ }; /** - * Decodes a NotificationChannel message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel + * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationChannel.decodeDelimited = function decodeDelimited(reader) { + GetNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationChannel message. + * Verifies a GetNotificationChannelRequest message. * @function verify - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationChannel.verify = function verify(message) { + GetNotificationChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$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.userLabels != null && message.hasOwnProperty("userLabels")) { - if (!$util.isObject(message.userLabels)) - return "userLabels: object expected"; - var key = Object.keys(message.userLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.userLabels[key[i]])) - return "userLabels: string{k:string} expected"; - } - if (message.verificationStatus != null && message.hasOwnProperty("verificationStatus")) - switch (message.verificationStatus) { - default: - return "verificationStatus: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.enabled != null && message.hasOwnProperty("enabled")) { - var error = $root.google.protobuf.BoolValue.verify(message.enabled); - if (error) - return "enabled." + error; - } return null; }; /** - * Creates a NotificationChannel message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.NotificationChannel} NotificationChannel + * @returns {google.monitoring.v3.GetNotificationChannelRequest} GetNotificationChannelRequest */ - NotificationChannel.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.NotificationChannel) + GetNotificationChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetNotificationChannelRequest) return object; - var message = new $root.google.monitoring.v3.NotificationChannel(); - if (object.type != null) - message.type = String(object.type); + var message = new $root.google.monitoring.v3.GetNotificationChannelRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.monitoring.v3.NotificationChannel.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.userLabels) { - if (typeof object.userLabels !== "object") - throw TypeError(".google.monitoring.v3.NotificationChannel.userLabels: object expected"); - message.userLabels = {}; - for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) - message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); - } - switch (object.verificationStatus) { - case "VERIFICATION_STATUS_UNSPECIFIED": - case 0: - message.verificationStatus = 0; - break; - case "UNVERIFIED": - case 1: - message.verificationStatus = 1; - break; - case "VERIFIED": - case 2: - message.verificationStatus = 2; - break; - } - if (object.enabled != null) { - if (typeof object.enabled !== "object") - throw TypeError(".google.monitoring.v3.NotificationChannel.enabled: object expected"); - message.enabled = $root.google.protobuf.BoolValue.fromObject(object.enabled); - } return message; }; /** - * Creates a plain object from a NotificationChannel message. Also converts values to other types if specified. + * Creates a plain object from a GetNotificationChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @static - * @param {google.monitoring.v3.NotificationChannel} message NotificationChannel + * @param {google.monitoring.v3.GetNotificationChannelRequest} message GetNotificationChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationChannel.toObject = function toObject(message, options) { + GetNotificationChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.userLabels = {}; - } - if (options.defaults) { - object.type = ""; - object.displayName = ""; - object.description = ""; + if (options.defaults) object.name = ""; - object.verificationStatus = options.enums === String ? "VERIFICATION_STATUS_UNSPECIFIED" : 0; - object.enabled = null; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { - object.userLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; - } - if (message.verificationStatus != null && message.hasOwnProperty("verificationStatus")) - object.verificationStatus = options.enums === String ? $root.google.monitoring.v3.NotificationChannel.VerificationStatus[message.verificationStatus] : message.verificationStatus; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options); return object; }; /** - * Converts this NotificationChannel to JSON. + * Converts this GetNotificationChannelRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.NotificationChannel + * @memberof google.monitoring.v3.GetNotificationChannelRequest * @instance * @returns {Object.} JSON object */ - NotificationChannel.prototype.toJSON = function toJSON() { + GetNotificationChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * VerificationStatus enum. - * @name google.monitoring.v3.NotificationChannel.VerificationStatus - * @enum {string} - * @property {number} VERIFICATION_STATUS_UNSPECIFIED=0 VERIFICATION_STATUS_UNSPECIFIED value - * @property {number} UNVERIFIED=1 UNVERIFIED value - * @property {number} VERIFIED=2 VERIFIED value - */ - NotificationChannel.VerificationStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VERIFICATION_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - values[valuesById[2] = "VERIFIED"] = 2; - return values; - })(); - - return NotificationChannel; + return GetNotificationChannelRequest; })(); - v3.ServiceMonitoringService = (function() { + v3.UpdateNotificationChannelRequest = (function() { /** - * Constructs a new ServiceMonitoringService service. + * Properties of an UpdateNotificationChannelRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ServiceMonitoringService - * @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 + * @interface IUpdateNotificationChannelRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNotificationChannelRequest updateMask + * @property {google.monitoring.v3.INotificationChannel|null} [notificationChannel] UpdateNotificationChannelRequest notificationChannel */ - function ServiceMonitoringService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ServiceMonitoringService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ServiceMonitoringService; /** - * Creates new ServiceMonitoringService service using the specified rpc implementation. - * @function create - * @memberof google.monitoring.v3.ServiceMonitoringService - * @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 {ServiceMonitoringService} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new UpdateNotificationChannelRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents an UpdateNotificationChannelRequest. + * @implements IUpdateNotificationChannelRequest + * @constructor + * @param {google.monitoring.v3.IUpdateNotificationChannelRequest=} [properties] Properties to set */ - ServiceMonitoringService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function UpdateNotificationChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createService}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef CreateServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.Service} [response] Service + * UpdateNotificationChannelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @instance */ + UpdateNotificationChannelRequest.prototype.updateMask = null; /** - * Calls CreateService. - * @function createService - * @memberof google.monitoring.v3.ServiceMonitoringService + * UpdateNotificationChannelRequest notificationChannel. + * @member {google.monitoring.v3.INotificationChannel|null|undefined} notificationChannel + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest * @instance - * @param {google.monitoring.v3.ICreateServiceRequest} request CreateServiceRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.CreateServiceCallback} callback Node-style callback called with the error, if any, and Service - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ServiceMonitoringService.prototype.createService = function createService(request, callback) { - return this.rpcCall(createService, $root.google.monitoring.v3.CreateServiceRequest, $root.google.monitoring.v3.Service, request, callback); - }, "name", { value: "CreateService" }); + UpdateNotificationChannelRequest.prototype.notificationChannel = null; /** - * Calls CreateService. - * @function createService - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.ICreateServiceRequest} request CreateServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new UpdateNotificationChannelRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {google.monitoring.v3.IUpdateNotificationChannelRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest instance */ + UpdateNotificationChannelRequest.create = function create(properties) { + return new UpdateNotificationChannelRequest(properties); + }; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getService}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef GetServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.Service} [response] Service + * Encodes the specified UpdateNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} message UpdateNotificationChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateNotificationChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) + $root.google.monitoring.v3.NotificationChannel.encode(message.notificationChannel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Calls GetService. - * @function getService - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IGetServiceRequest} request GetServiceRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.GetServiceCallback} callback Node-style callback called with the error, if any, and Service - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateNotificationChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {google.monitoring.v3.IUpdateNotificationChannelRequest} message UpdateNotificationChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ServiceMonitoringService.prototype.getService = function getService(request, callback) { - return this.rpcCall(getService, $root.google.monitoring.v3.GetServiceRequest, $root.google.monitoring.v3.Service, request, callback); - }, "name", { value: "GetService" }); + UpdateNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetService. - * @function getService - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IGetServiceRequest} request GetServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateNotificationChannelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateNotificationChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServices}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef ListServicesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListServicesResponse} [response] ListServicesResponse + * Decodes an UpdateNotificationChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + UpdateNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListServices. - * @function listServices - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IListServicesRequest} request ListServicesRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse - * @returns {undefined} - * @variation 1 + * Verifies an UpdateNotificationChannelRequest message. + * @function verify + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ServiceMonitoringService.prototype.listServices = function listServices(request, callback) { - return this.rpcCall(listServices, $root.google.monitoring.v3.ListServicesRequest, $root.google.monitoring.v3.ListServicesResponse, request, callback); - }, "name", { value: "ListServices" }); + UpdateNotificationChannelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) { + var error = $root.google.monitoring.v3.NotificationChannel.verify(message.notificationChannel); + if (error) + return "notificationChannel." + error; + } + return null; + }; /** - * Calls ListServices. - * @function listServices - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IListServicesRequest} request ListServicesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an UpdateNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.UpdateNotificationChannelRequest} UpdateNotificationChannelRequest */ + UpdateNotificationChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateNotificationChannelRequest) + return object; + var message = new $root.google.monitoring.v3.UpdateNotificationChannelRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.monitoring.v3.UpdateNotificationChannelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.notificationChannel != null) { + if (typeof object.notificationChannel !== "object") + throw TypeError(".google.monitoring.v3.UpdateNotificationChannelRequest.notificationChannel: object expected"); + message.notificationChannel = $root.google.monitoring.v3.NotificationChannel.fromObject(object.notificationChannel); + } + return message; + }; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateService}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef UpdateServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.Service} [response] Service + * Creates a plain object from an UpdateNotificationChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest + * @static + * @param {google.monitoring.v3.UpdateNotificationChannelRequest} message UpdateNotificationChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + UpdateNotificationChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.notificationChannel = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.notificationChannel != null && message.hasOwnProperty("notificationChannel")) + object.notificationChannel = $root.google.monitoring.v3.NotificationChannel.toObject(message.notificationChannel, options); + return object; + }; /** - * Calls UpdateService. - * @function updateService - * @memberof google.monitoring.v3.ServiceMonitoringService + * Converts this UpdateNotificationChannelRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.UpdateNotificationChannelRequest * @instance - * @param {google.monitoring.v3.IUpdateServiceRequest} request UpdateServiceRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Service - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ServiceMonitoringService.prototype.updateService = function updateService(request, callback) { - return this.rpcCall(updateService, $root.google.monitoring.v3.UpdateServiceRequest, $root.google.monitoring.v3.Service, request, callback); - }, "name", { value: "UpdateService" }); + UpdateNotificationChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateNotificationChannelRequest; + })(); + + v3.DeleteNotificationChannelRequest = (function() { /** - * Calls UpdateService. - * @function updateService - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IUpdateServiceRequest} request UpdateServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a DeleteNotificationChannelRequest. + * @memberof google.monitoring.v3 + * @interface IDeleteNotificationChannelRequest + * @property {string|null} [name] DeleteNotificationChannelRequest name + * @property {boolean|null} [force] DeleteNotificationChannelRequest force */ /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteService}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef DeleteServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Constructs a new DeleteNotificationChannelRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a DeleteNotificationChannelRequest. + * @implements IDeleteNotificationChannelRequest + * @constructor + * @param {google.monitoring.v3.IDeleteNotificationChannelRequest=} [properties] Properties to set */ + function DeleteNotificationChannelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls DeleteService. - * @function deleteService - * @memberof google.monitoring.v3.ServiceMonitoringService + * DeleteNotificationChannelRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @instance - * @param {google.monitoring.v3.IDeleteServiceRequest} request DeleteServiceRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ServiceMonitoringService.prototype.deleteService = function deleteService(request, callback) { - return this.rpcCall(deleteService, $root.google.monitoring.v3.DeleteServiceRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteService" }); + DeleteNotificationChannelRequest.prototype.name = ""; /** - * Calls DeleteService. - * @function deleteService - * @memberof google.monitoring.v3.ServiceMonitoringService + * DeleteNotificationChannelRequest force. + * @member {boolean} force + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @instance - * @param {google.monitoring.v3.IDeleteServiceRequest} request DeleteServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + DeleteNotificationChannelRequest.prototype.force = false; /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createServiceLevelObjective}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef CreateServiceLevelObjectiveCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + * Creates a new DeleteNotificationChannelRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest + * @static + * @param {google.monitoring.v3.IDeleteNotificationChannelRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest instance */ + DeleteNotificationChannelRequest.create = function create(properties) { + return new DeleteNotificationChannelRequest(properties); + }; /** - * Calls CreateServiceLevelObjective. - * @function createServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} request CreateServiceLevelObjectiveRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ServiceMonitoringService.prototype.createServiceLevelObjective = function createServiceLevelObjective(request, callback) { - return this.rpcCall(createServiceLevelObjective, $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); - }, "name", { value: "CreateServiceLevelObjective" }); - - /** - * Calls CreateServiceLevelObjective. - * @function createServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} request CreateServiceLevelObjectiveRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getServiceLevelObjective}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef GetServiceLevelObjectiveCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective - */ - - /** - * Calls GetServiceLevelObjective. - * @function getServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} request GetServiceLevelObjectiveRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ServiceMonitoringService.prototype.getServiceLevelObjective = function getServiceLevelObjective(request, callback) { - return this.rpcCall(getServiceLevelObjective, $root.google.monitoring.v3.GetServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); - }, "name", { value: "GetServiceLevelObjective" }); - - /** - * Calls GetServiceLevelObjective. - * @function getServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} request GetServiceLevelObjectiveRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServiceLevelObjectives}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef ListServiceLevelObjectivesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListServiceLevelObjectivesResponse} [response] ListServiceLevelObjectivesResponse - */ - - /** - * Calls ListServiceLevelObjectives. - * @function listServiceLevelObjectives - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} request ListServiceLevelObjectivesRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectivesCallback} callback Node-style callback called with the error, if any, and ListServiceLevelObjectivesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ServiceMonitoringService.prototype.listServiceLevelObjectives = function listServiceLevelObjectives(request, callback) { - return this.rpcCall(listServiceLevelObjectives, $root.google.monitoring.v3.ListServiceLevelObjectivesRequest, $root.google.monitoring.v3.ListServiceLevelObjectivesResponse, request, callback); - }, "name", { value: "ListServiceLevelObjectives" }); - - /** - * Calls ListServiceLevelObjectives. - * @function listServiceLevelObjectives - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} request ListServiceLevelObjectivesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateServiceLevelObjective}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef UpdateServiceLevelObjectiveCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective - */ - - /** - * Calls UpdateServiceLevelObjective. - * @function updateServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} request UpdateServiceLevelObjectiveRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ServiceMonitoringService.prototype.updateServiceLevelObjective = function updateServiceLevelObjective(request, callback) { - return this.rpcCall(updateServiceLevelObjective, $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); - }, "name", { value: "UpdateServiceLevelObjective" }); - - /** - * Calls UpdateServiceLevelObjective. - * @function updateServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} request UpdateServiceLevelObjectiveRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteServiceLevelObjective}. - * @memberof google.monitoring.v3.ServiceMonitoringService - * @typedef DeleteServiceLevelObjectiveCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteServiceLevelObjective. - * @function deleteServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} request DeleteServiceLevelObjectiveRequest message or plain object - * @param {google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ServiceMonitoringService.prototype.deleteServiceLevelObjective = function deleteServiceLevelObjective(request, callback) { - return this.rpcCall(deleteServiceLevelObjective, $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteServiceLevelObjective" }); - - /** - * Calls DeleteServiceLevelObjective. - * @function deleteServiceLevelObjective - * @memberof google.monitoring.v3.ServiceMonitoringService - * @instance - * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} request DeleteServiceLevelObjectiveRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ServiceMonitoringService; - })(); - - v3.CreateServiceRequest = (function() { - - /** - * Properties of a CreateServiceRequest. - * @memberof google.monitoring.v3 - * @interface ICreateServiceRequest - * @property {string|null} [parent] CreateServiceRequest parent - * @property {string|null} [serviceId] CreateServiceRequest serviceId - * @property {google.monitoring.v3.IService|null} [service] CreateServiceRequest service - */ - - /** - * Constructs a new CreateServiceRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a CreateServiceRequest. - * @implements ICreateServiceRequest - * @constructor - * @param {google.monitoring.v3.ICreateServiceRequest=} [properties] Properties to set - */ - function CreateServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateServiceRequest parent. - * @member {string} parent - * @memberof google.monitoring.v3.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.parent = ""; - - /** - * CreateServiceRequest serviceId. - * @member {string} serviceId - * @memberof google.monitoring.v3.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.serviceId = ""; - - /** - * CreateServiceRequest service. - * @member {google.monitoring.v3.IService|null|undefined} service - * @memberof google.monitoring.v3.CreateServiceRequest - * @instance - */ - CreateServiceRequest.prototype.service = null; - - /** - * Creates a new CreateServiceRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.CreateServiceRequest - * @static - * @param {google.monitoring.v3.ICreateServiceRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest instance - */ - CreateServiceRequest.create = function create(properties) { - return new CreateServiceRequest(properties); - }; - - /** - * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * Encodes the specified DeleteNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static - * @param {google.monitoring.v3.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} message DeleteNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateServiceRequest.encode = function encode(message, writer) { + DeleteNotificationChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.service != null && message.hasOwnProperty("service")) - $root.google.monitoring.v3.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceId); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.force != null && message.hasOwnProperty("force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); return writer; }; /** - * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. + * Encodes the specified DeleteNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteNotificationChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static - * @param {google.monitoring.v3.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode + * @param {google.monitoring.v3.IDeleteNotificationChannelRequest} message DeleteNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateServiceRequest message from the specified reader or buffer. + * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest + * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateServiceRequest.decode = function decode(reader, length) { + DeleteNotificationChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateServiceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteNotificationChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; case 3: - message.serviceId = reader.string(); + message.name = reader.string(); break; - case 2: - message.service = $root.google.monitoring.v3.Service.decode(reader, reader.uint32()); + case 5: + message.force = reader.bool(); break; default: reader.skipType(tag & 7); @@ -16058,129 +14905,116 @@ }; /** - * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteNotificationChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest + * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateServiceRequest message. + * Verifies a DeleteNotificationChannelRequest message. * @function verify - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateServiceRequest.verify = function verify(message) { + DeleteNotificationChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - if (!$util.isString(message.serviceId)) - return "serviceId: string expected"; - if (message.service != null && message.hasOwnProperty("service")) { - var error = $root.google.monitoring.v3.Service.verify(message.service); - if (error) - return "service." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest + * @returns {google.monitoring.v3.DeleteNotificationChannelRequest} DeleteNotificationChannelRequest */ - CreateServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateServiceRequest) + DeleteNotificationChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteNotificationChannelRequest) return object; - var message = new $root.google.monitoring.v3.CreateServiceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.serviceId != null) - message.serviceId = String(object.serviceId); - if (object.service != null) { - if (typeof object.service !== "object") - throw TypeError(".google.monitoring.v3.CreateServiceRequest.service: object expected"); - message.service = $root.google.monitoring.v3.Service.fromObject(object.service); - } + var message = new $root.google.monitoring.v3.DeleteNotificationChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteNotificationChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @static - * @param {google.monitoring.v3.CreateServiceRequest} message CreateServiceRequest + * @param {google.monitoring.v3.DeleteNotificationChannelRequest} message DeleteNotificationChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateServiceRequest.toObject = function toObject(message, options) { + DeleteNotificationChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.service = null; - object.serviceId = ""; + object.name = ""; + object.force = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.service != null && message.hasOwnProperty("service")) - object.service = $root.google.monitoring.v3.Service.toObject(message.service, options); - if (message.serviceId != null && message.hasOwnProperty("serviceId")) - object.serviceId = message.serviceId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this CreateServiceRequest to JSON. + * Converts this DeleteNotificationChannelRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateServiceRequest + * @memberof google.monitoring.v3.DeleteNotificationChannelRequest * @instance * @returns {Object.} JSON object */ - CreateServiceRequest.prototype.toJSON = function toJSON() { + DeleteNotificationChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateServiceRequest; + return DeleteNotificationChannelRequest; })(); - v3.GetServiceRequest = (function() { + v3.SendNotificationChannelVerificationCodeRequest = (function() { /** - * Properties of a GetServiceRequest. + * Properties of a SendNotificationChannelVerificationCodeRequest. * @memberof google.monitoring.v3 - * @interface IGetServiceRequest - * @property {string|null} [name] GetServiceRequest name + * @interface ISendNotificationChannelVerificationCodeRequest + * @property {string|null} [name] SendNotificationChannelVerificationCodeRequest name */ /** - * Constructs a new GetServiceRequest. + * Constructs a new SendNotificationChannelVerificationCodeRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a GetServiceRequest. - * @implements IGetServiceRequest + * @classdesc Represents a SendNotificationChannelVerificationCodeRequest. + * @implements ISendNotificationChannelVerificationCodeRequest * @constructor - * @param {google.monitoring.v3.IGetServiceRequest=} [properties] Properties to set + * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest=} [properties] Properties to set */ - function GetServiceRequest(properties) { + function SendNotificationChannelVerificationCodeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16188,35 +15022,35 @@ } /** - * GetServiceRequest name. + * SendNotificationChannelVerificationCodeRequest name. * @member {string} name - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @instance */ - GetServiceRequest.prototype.name = ""; + SendNotificationChannelVerificationCodeRequest.prototype.name = ""; /** - * Creates a new GetServiceRequest instance using the specified properties. + * Creates a new SendNotificationChannelVerificationCodeRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.IGetServiceRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest instance + * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest instance */ - GetServiceRequest.create = function create(properties) { - return new GetServiceRequest(properties); + SendNotificationChannelVerificationCodeRequest.create = function create(properties) { + return new SendNotificationChannelVerificationCodeRequest(properties); }; /** - * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * Encodes the specified SendNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} message SendNotificationChannelVerificationCodeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetServiceRequest.encode = function encode(message, writer) { + SendNotificationChannelVerificationCodeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) @@ -16225,33 +15059,33 @@ }; /** - * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. + * Encodes the specified SendNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.SendNotificationChannelVerificationCodeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.IGetServiceRequest} message GetServiceRequest message or plain object to encode + * @param {google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest} message SendNotificationChannelVerificationCodeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + SendNotificationChannelVerificationCodeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetServiceRequest message from the specified reader or buffer. + * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest + * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetServiceRequest.decode = function decode(reader, length) { + SendNotificationChannelVerificationCodeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetServiceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16267,30 +15101,30 @@ }; /** - * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. + * Decodes a SendNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest + * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { + SendNotificationChannelVerificationCodeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetServiceRequest message. + * Verifies a SendNotificationChannelVerificationCodeRequest message. * @function verify - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetServiceRequest.verify = function verify(message) { + SendNotificationChannelVerificationCodeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -16300,32 +15134,32 @@ }; /** - * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SendNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest + * @returns {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} SendNotificationChannelVerificationCodeRequest */ - GetServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetServiceRequest) + SendNotificationChannelVerificationCodeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest) return object; - var message = new $root.google.monitoring.v3.GetServiceRequest(); + var message = new $root.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. + * Creates a plain object from a SendNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.GetServiceRequest} message GetServiceRequest + * @param {google.monitoring.v3.SendNotificationChannelVerificationCodeRequest} message SendNotificationChannelVerificationCodeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetServiceRequest.toObject = function toObject(message, options) { + SendNotificationChannelVerificationCodeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -16337,40 +15171,38 @@ }; /** - * Converts this GetServiceRequest to JSON. + * Converts this SendNotificationChannelVerificationCodeRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetServiceRequest + * @memberof google.monitoring.v3.SendNotificationChannelVerificationCodeRequest * @instance * @returns {Object.} JSON object */ - GetServiceRequest.prototype.toJSON = function toJSON() { + SendNotificationChannelVerificationCodeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetServiceRequest; + return SendNotificationChannelVerificationCodeRequest; })(); - v3.ListServicesRequest = (function() { + v3.GetNotificationChannelVerificationCodeRequest = (function() { /** - * Properties of a ListServicesRequest. + * Properties of a GetNotificationChannelVerificationCodeRequest. * @memberof google.monitoring.v3 - * @interface IListServicesRequest - * @property {string|null} [parent] ListServicesRequest parent - * @property {string|null} [filter] ListServicesRequest filter - * @property {number|null} [pageSize] ListServicesRequest pageSize - * @property {string|null} [pageToken] ListServicesRequest pageToken + * @interface IGetNotificationChannelVerificationCodeRequest + * @property {string|null} [name] GetNotificationChannelVerificationCodeRequest name + * @property {google.protobuf.ITimestamp|null} [expireTime] GetNotificationChannelVerificationCodeRequest expireTime */ /** - * Constructs a new ListServicesRequest. + * Constructs a new GetNotificationChannelVerificationCodeRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListServicesRequest. - * @implements IListServicesRequest + * @classdesc Represents a GetNotificationChannelVerificationCodeRequest. + * @implements IGetNotificationChannelVerificationCodeRequest * @constructor - * @param {google.monitoring.v3.IListServicesRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest=} [properties] Properties to set */ - function ListServicesRequest(properties) { + function GetNotificationChannelVerificationCodeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16378,114 +15210,88 @@ } /** - * ListServicesRequest parent. - * @member {string} parent - * @memberof google.monitoring.v3.ListServicesRequest - * @instance - */ - ListServicesRequest.prototype.parent = ""; - - /** - * ListServicesRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListServicesRequest + * GetNotificationChannelVerificationCodeRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @instance */ - ListServicesRequest.prototype.filter = ""; + GetNotificationChannelVerificationCodeRequest.prototype.name = ""; /** - * ListServicesRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListServicesRequest + * GetNotificationChannelVerificationCodeRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @instance */ - ListServicesRequest.prototype.pageSize = 0; + GetNotificationChannelVerificationCodeRequest.prototype.expireTime = null; /** - * ListServicesRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListServicesRequest - * @instance + * Creates a new GetNotificationChannelVerificationCodeRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest + * @static + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest instance */ - ListServicesRequest.prototype.pageToken = ""; + GetNotificationChannelVerificationCodeRequest.create = function create(properties) { + return new GetNotificationChannelVerificationCodeRequest(properties); + }; /** - * Creates a new ListServicesRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListServicesRequest - * @static - * @param {google.monitoring.v3.IListServicesRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest instance - */ - ListServicesRequest.create = function create(properties) { - return new ListServicesRequest(properties); - }; - - /** - * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * Encodes the specified GetNotificationChannelVerificationCodeRequest message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} message GetNotificationChannelVerificationCodeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServicesRequest.encode = function encode(message, writer) { + GetNotificationChannelVerificationCodeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. + * Encodes the specified GetNotificationChannelVerificationCodeRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.IListServicesRequest} message ListServicesRequest message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest} message GetNotificationChannelVerificationCodeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetNotificationChannelVerificationCodeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListServicesRequest message from the specified reader or buffer. + * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServicesRequest.decode = function decode(reader, length) { + GetNotificationChannelVerificationCodeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServicesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.filter = reader.string(); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -16496,134 +15302,122 @@ }; /** - * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationChannelVerificationCodeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { + GetNotificationChannelVerificationCodeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListServicesRequest message. + * Verifies a GetNotificationChannelVerificationCodeRequest message. * @function verify - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListServicesRequest.verify = function verify(message) { + GetNotificationChannelVerificationCodeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } return null; }; /** - * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationChannelVerificationCodeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} GetNotificationChannelVerificationCodeRequest */ - ListServicesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListServicesRequest) + GetNotificationChannelVerificationCodeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest) return object; - var message = new $root.google.monitoring.v3.ListServicesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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); + var message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.monitoring.v3.GetNotificationChannelVerificationCodeRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } return message; }; /** - * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetNotificationChannelVerificationCodeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @static - * @param {google.monitoring.v3.ListServicesRequest} message ListServicesRequest + * @param {google.monitoring.v3.GetNotificationChannelVerificationCodeRequest} message GetNotificationChannelVerificationCodeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListServicesRequest.toObject = function toObject(message, options) { + GetNotificationChannelVerificationCodeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; + object.name = ""; + object.expireTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); return object; }; /** - * Converts this ListServicesRequest to JSON. + * Converts this GetNotificationChannelVerificationCodeRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListServicesRequest + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeRequest * @instance * @returns {Object.} JSON object */ - ListServicesRequest.prototype.toJSON = function toJSON() { + GetNotificationChannelVerificationCodeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListServicesRequest; + return GetNotificationChannelVerificationCodeRequest; })(); - v3.ListServicesResponse = (function() { + v3.GetNotificationChannelVerificationCodeResponse = (function() { /** - * Properties of a ListServicesResponse. + * Properties of a GetNotificationChannelVerificationCodeResponse. * @memberof google.monitoring.v3 - * @interface IListServicesResponse - * @property {Array.|null} [services] ListServicesResponse services - * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken + * @interface IGetNotificationChannelVerificationCodeResponse + * @property {string|null} [code] GetNotificationChannelVerificationCodeResponse code + * @property {google.protobuf.ITimestamp|null} [expireTime] GetNotificationChannelVerificationCodeResponse expireTime */ /** - * Constructs a new ListServicesResponse. + * Constructs a new GetNotificationChannelVerificationCodeResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a ListServicesResponse. - * @implements IListServicesResponse + * @classdesc Represents a GetNotificationChannelVerificationCodeResponse. + * @implements IGetNotificationChannelVerificationCodeResponse * @constructor - * @param {google.monitoring.v3.IListServicesResponse=} [properties] Properties to set + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse=} [properties] Properties to set */ - function ListServicesResponse(properties) { - this.services = []; + function GetNotificationChannelVerificationCodeResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16631,91 +15425,88 @@ } /** - * ListServicesResponse services. - * @member {Array.} services - * @memberof google.monitoring.v3.ListServicesResponse + * GetNotificationChannelVerificationCodeResponse code. + * @member {string} code + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @instance */ - ListServicesResponse.prototype.services = $util.emptyArray; + GetNotificationChannelVerificationCodeResponse.prototype.code = ""; /** - * ListServicesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListServicesResponse + * GetNotificationChannelVerificationCodeResponse expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @instance */ - ListServicesResponse.prototype.nextPageToken = ""; + GetNotificationChannelVerificationCodeResponse.prototype.expireTime = null; /** - * Creates a new ListServicesResponse instance using the specified properties. + * Creates a new GetNotificationChannelVerificationCodeResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static - * @param {google.monitoring.v3.IListServicesResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse instance + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse instance */ - ListServicesResponse.create = function create(properties) { - return new ListServicesResponse(properties); + GetNotificationChannelVerificationCodeResponse.create = function create(properties) { + return new GetNotificationChannelVerificationCodeResponse(properties); }; /** - * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * Encodes the specified GetNotificationChannelVerificationCodeResponse message. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static - * @param {google.monitoring.v3.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse} message GetNotificationChannelVerificationCodeResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServicesResponse.encode = function encode(message, writer) { + GetNotificationChannelVerificationCodeResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.services != null && message.services.length) - for (var i = 0; i < message.services.length; ++i) - $root.google.monitoring.v3.Service.encode(message.services[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * Encodes the specified GetNotificationChannelVerificationCodeResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static - * @param {google.monitoring.v3.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse} message GetNotificationChannelVerificationCodeResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetNotificationChannelVerificationCodeResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListServicesResponse message from the specified reader or buffer. + * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServicesResponse.decode = function decode(reader, length) { + GetNotificationChannelVerificationCodeResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServicesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.services && message.services.length)) - message.services = []; - message.services.push($root.google.monitoring.v3.Service.decode(reader, reader.uint32())); + message.code = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -16726,134 +15517,122 @@ }; /** - * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetNotificationChannelVerificationCodeResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { + GetNotificationChannelVerificationCodeResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListServicesResponse message. + * Verifies a GetNotificationChannelVerificationCodeResponse message. * @function verify - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListServicesResponse.verify = function verify(message) { + GetNotificationChannelVerificationCodeResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.services != null && message.hasOwnProperty("services")) { - if (!Array.isArray(message.services)) - return "services: array expected"; - for (var i = 0; i < message.services.length; ++i) { - var error = $root.google.monitoring.v3.Service.verify(message.services[i]); - if (error) - return "services." + error; - } + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetNotificationChannelVerificationCodeResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @returns {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} GetNotificationChannelVerificationCodeResponse */ - ListServicesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListServicesResponse) + GetNotificationChannelVerificationCodeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse) return object; - var message = new $root.google.monitoring.v3.ListServicesResponse(); - if (object.services) { - if (!Array.isArray(object.services)) - throw TypeError(".google.monitoring.v3.ListServicesResponse.services: array expected"); - message.services = []; - for (var i = 0; i < object.services.length; ++i) { - if (typeof object.services[i] !== "object") - throw TypeError(".google.monitoring.v3.ListServicesResponse.services: object expected"); - message.services[i] = $root.google.monitoring.v3.Service.fromObject(object.services[i]); - } + var message = new $root.google.monitoring.v3.GetNotificationChannelVerificationCodeResponse(); + if (object.code != null) + message.code = String(object.code); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.monitoring.v3.GetNotificationChannelVerificationCodeResponse.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetNotificationChannelVerificationCodeResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @static - * @param {google.monitoring.v3.ListServicesResponse} message ListServicesResponse + * @param {google.monitoring.v3.GetNotificationChannelVerificationCodeResponse} message GetNotificationChannelVerificationCodeResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListServicesResponse.toObject = function toObject(message, options) { + GetNotificationChannelVerificationCodeResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.services = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.services && message.services.length) { - object.services = []; - for (var j = 0; j < message.services.length; ++j) - object.services[j] = $root.google.monitoring.v3.Service.toObject(message.services[j], options); + if (options.defaults) { + object.code = ""; + object.expireTime = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); return object; }; /** - * Converts this ListServicesResponse to JSON. + * Converts this GetNotificationChannelVerificationCodeResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListServicesResponse + * @memberof google.monitoring.v3.GetNotificationChannelVerificationCodeResponse * @instance * @returns {Object.} JSON object */ - ListServicesResponse.prototype.toJSON = function toJSON() { + GetNotificationChannelVerificationCodeResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListServicesResponse; + return GetNotificationChannelVerificationCodeResponse; })(); - v3.UpdateServiceRequest = (function() { + v3.VerifyNotificationChannelRequest = (function() { /** - * Properties of an UpdateServiceRequest. + * Properties of a VerifyNotificationChannelRequest. * @memberof google.monitoring.v3 - * @interface IUpdateServiceRequest - * @property {google.monitoring.v3.IService|null} [service] UpdateServiceRequest service - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask + * @interface IVerifyNotificationChannelRequest + * @property {string|null} [name] VerifyNotificationChannelRequest name + * @property {string|null} [code] VerifyNotificationChannelRequest code */ /** - * Constructs a new UpdateServiceRequest. + * Constructs a new VerifyNotificationChannelRequest. * @memberof google.monitoring.v3 - * @classdesc Represents an UpdateServiceRequest. - * @implements IUpdateServiceRequest + * @classdesc Represents a VerifyNotificationChannelRequest. + * @implements IVerifyNotificationChannelRequest * @constructor - * @param {google.monitoring.v3.IUpdateServiceRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IVerifyNotificationChannelRequest=} [properties] Properties to set */ - function UpdateServiceRequest(properties) { + function VerifyNotificationChannelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16861,88 +15640,88 @@ } /** - * UpdateServiceRequest service. - * @member {google.monitoring.v3.IService|null|undefined} service - * @memberof google.monitoring.v3.UpdateServiceRequest + * VerifyNotificationChannelRequest name. + * @member {string} name + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @instance */ - UpdateServiceRequest.prototype.service = null; + VerifyNotificationChannelRequest.prototype.name = ""; /** - * UpdateServiceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.monitoring.v3.UpdateServiceRequest + * VerifyNotificationChannelRequest code. + * @member {string} code + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @instance */ - UpdateServiceRequest.prototype.updateMask = null; + VerifyNotificationChannelRequest.prototype.code = ""; /** - * Creates a new UpdateServiceRequest instance using the specified properties. + * Creates a new VerifyNotificationChannelRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static - * @param {google.monitoring.v3.IUpdateServiceRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest instance + * @param {google.monitoring.v3.IVerifyNotificationChannelRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest instance */ - UpdateServiceRequest.create = function create(properties) { - return new UpdateServiceRequest(properties); + VerifyNotificationChannelRequest.create = function create(properties) { + return new VerifyNotificationChannelRequest(properties); }; /** - * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * Encodes the specified VerifyNotificationChannelRequest message. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static - * @param {google.monitoring.v3.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} message VerifyNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateServiceRequest.encode = function encode(message, writer) { + VerifyNotificationChannelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.service != null && message.hasOwnProperty("service")) - $root.google.monitoring.v3.Service.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.code); return writer; }; /** - * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. + * Encodes the specified VerifyNotificationChannelRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.VerifyNotificationChannelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static - * @param {google.monitoring.v3.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode + * @param {google.monitoring.v3.IVerifyNotificationChannelRequest} message VerifyNotificationChannelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + VerifyNotificationChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer. + * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest + * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateServiceRequest.decode = function decode(reader, length) { + VerifyNotificationChannelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateServiceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.VerifyNotificationChannelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.service = $root.google.monitoring.v3.Service.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.code = reader.string(); break; default: reader.skipType(tag & 7); @@ -16953,126 +15732,122 @@ }; /** - * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. + * Decodes a VerifyNotificationChannelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest + * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { + VerifyNotificationChannelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateServiceRequest message. + * Verifies a VerifyNotificationChannelRequest message. * @function verify - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateServiceRequest.verify = function verify(message) { + VerifyNotificationChannelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) { - var error = $root.google.monitoring.v3.Service.verify(message.service); - if (error) - return "service." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; return null; }; /** - * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a VerifyNotificationChannelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest + * @returns {google.monitoring.v3.VerifyNotificationChannelRequest} VerifyNotificationChannelRequest */ - UpdateServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.UpdateServiceRequest) + VerifyNotificationChannelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.VerifyNotificationChannelRequest) return object; - var message = new $root.google.monitoring.v3.UpdateServiceRequest(); - if (object.service != null) { - if (typeof object.service !== "object") - throw TypeError(".google.monitoring.v3.UpdateServiceRequest.service: object expected"); - message.service = $root.google.monitoring.v3.Service.fromObject(object.service); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.monitoring.v3.UpdateServiceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.monitoring.v3.VerifyNotificationChannelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.code != null) + message.code = String(object.code); return message; }; /** - * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. + * Creates a plain object from a VerifyNotificationChannelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @static - * @param {google.monitoring.v3.UpdateServiceRequest} message UpdateServiceRequest + * @param {google.monitoring.v3.VerifyNotificationChannelRequest} message VerifyNotificationChannelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateServiceRequest.toObject = function toObject(message, options) { + VerifyNotificationChannelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.service = null; - object.updateMask = null; + object.name = ""; + object.code = ""; } - if (message.service != null && message.hasOwnProperty("service")) - object.service = $root.google.monitoring.v3.Service.toObject(message.service, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; return object; }; /** - * Converts this UpdateServiceRequest to JSON. + * Converts this VerifyNotificationChannelRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.UpdateServiceRequest + * @memberof google.monitoring.v3.VerifyNotificationChannelRequest * @instance * @returns {Object.} JSON object */ - UpdateServiceRequest.prototype.toJSON = function toJSON() { + VerifyNotificationChannelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateServiceRequest; + return VerifyNotificationChannelRequest; })(); - v3.DeleteServiceRequest = (function() { + v3.Service = (function() { /** - * Properties of a DeleteServiceRequest. + * Properties of a Service. * @memberof google.monitoring.v3 - * @interface IDeleteServiceRequest - * @property {string|null} [name] DeleteServiceRequest name + * @interface IService + * @property {string|null} [name] Service name + * @property {string|null} [displayName] Service displayName + * @property {google.monitoring.v3.Service.ICustom|null} [custom] Service custom + * @property {google.monitoring.v3.Service.IAppEngine|null} [appEngine] Service appEngine + * @property {google.monitoring.v3.Service.ICloudEndpoints|null} [cloudEndpoints] Service cloudEndpoints + * @property {google.monitoring.v3.Service.IClusterIstio|null} [clusterIstio] Service clusterIstio + * @property {google.monitoring.v3.Service.ITelemetry|null} [telemetry] Service telemetry */ /** - * Constructs a new DeleteServiceRequest. + * Constructs a new Service. * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteServiceRequest. - * @implements IDeleteServiceRequest + * @classdesc Represents a Service. + * @implements IService * @constructor - * @param {google.monitoring.v3.IDeleteServiceRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IService=} [properties] Properties to set */ - function DeleteServiceRequest(properties) { + function Service(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17080,290 +15855,167 @@ } /** - * DeleteServiceRequest name. + * Service name. * @member {string} name - * @memberof google.monitoring.v3.DeleteServiceRequest + * @memberof google.monitoring.v3.Service * @instance */ - DeleteServiceRequest.prototype.name = ""; - - /** - * Creates a new DeleteServiceRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {google.monitoring.v3.IDeleteServiceRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest instance - */ - DeleteServiceRequest.create = function create(properties) { - return new DeleteServiceRequest(properties); - }; - - /** - * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {google.monitoring.v3.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {google.monitoring.v3.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteServiceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteServiceRequest message. - * @function verify - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest - */ - DeleteServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteServiceRequest) - return object; - var message = new $root.google.monitoring.v3.DeleteServiceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + Service.prototype.name = ""; /** - * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.DeleteServiceRequest - * @static - * @param {google.monitoring.v3.DeleteServiceRequest} message DeleteServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Service displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.Service + * @instance */ - DeleteServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + Service.prototype.displayName = ""; /** - * Converts this DeleteServiceRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.DeleteServiceRequest + * Service custom. + * @member {google.monitoring.v3.Service.ICustom|null|undefined} custom + * @memberof google.monitoring.v3.Service * @instance - * @returns {Object.} JSON object */ - DeleteServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeleteServiceRequest; - })(); - - v3.CreateServiceLevelObjectiveRequest = (function() { + Service.prototype.custom = null; /** - * Properties of a CreateServiceLevelObjectiveRequest. - * @memberof google.monitoring.v3 - * @interface ICreateServiceLevelObjectiveRequest - * @property {string|null} [parent] CreateServiceLevelObjectiveRequest parent - * @property {string|null} [serviceLevelObjectiveId] CreateServiceLevelObjectiveRequest serviceLevelObjectiveId - * @property {google.monitoring.v3.IServiceLevelObjective|null} [serviceLevelObjective] CreateServiceLevelObjectiveRequest serviceLevelObjective + * Service appEngine. + * @member {google.monitoring.v3.Service.IAppEngine|null|undefined} appEngine + * @memberof google.monitoring.v3.Service + * @instance */ + Service.prototype.appEngine = null; /** - * Constructs a new CreateServiceLevelObjectiveRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a CreateServiceLevelObjectiveRequest. - * @implements ICreateServiceLevelObjectiveRequest - * @constructor - * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest=} [properties] Properties to set + * Service cloudEndpoints. + * @member {google.monitoring.v3.Service.ICloudEndpoints|null|undefined} cloudEndpoints + * @memberof google.monitoring.v3.Service + * @instance */ - function CreateServiceLevelObjectiveRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Service.prototype.cloudEndpoints = null; /** - * CreateServiceLevelObjectiveRequest parent. - * @member {string} parent - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * Service clusterIstio. + * @member {google.monitoring.v3.Service.IClusterIstio|null|undefined} clusterIstio + * @memberof google.monitoring.v3.Service * @instance */ - CreateServiceLevelObjectiveRequest.prototype.parent = ""; + Service.prototype.clusterIstio = null; /** - * CreateServiceLevelObjectiveRequest serviceLevelObjectiveId. - * @member {string} serviceLevelObjectiveId - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * Service telemetry. + * @member {google.monitoring.v3.Service.ITelemetry|null|undefined} telemetry + * @memberof google.monitoring.v3.Service * @instance */ - CreateServiceLevelObjectiveRequest.prototype.serviceLevelObjectiveId = ""; + Service.prototype.telemetry = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * CreateServiceLevelObjectiveRequest serviceLevelObjective. - * @member {google.monitoring.v3.IServiceLevelObjective|null|undefined} serviceLevelObjective - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * Service identifier. + * @member {"custom"|"appEngine"|"cloudEndpoints"|"clusterIstio"|undefined} identifier + * @memberof google.monitoring.v3.Service * @instance */ - CreateServiceLevelObjectiveRequest.prototype.serviceLevelObjective = null; + Object.defineProperty(Service.prototype, "identifier", { + get: $util.oneOfGetter($oneOfFields = ["custom", "appEngine", "cloudEndpoints", "clusterIstio"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new CreateServiceLevelObjectiveRequest instance using the specified properties. + * Creates a new Service instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static - * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest instance + * @param {google.monitoring.v3.IService=} [properties] Properties to set + * @returns {google.monitoring.v3.Service} Service instance */ - CreateServiceLevelObjectiveRequest.create = function create(properties) { - return new CreateServiceLevelObjectiveRequest(properties); + Service.create = function create(properties) { + return new Service(properties); }; /** - * Encodes the specified CreateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * Encodes the specified Service message. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static - * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param {google.monitoring.v3.IService} message Service message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateServiceLevelObjectiveRequest.encode = function encode(message, writer) { + Service.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) - $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjective, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceLevelObjectiveId); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.monitoring.v3.Service.Custom.encode(message.custom, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appEngine != null && message.hasOwnProperty("appEngine")) + $root.google.monitoring.v3.Service.AppEngine.encode(message.appEngine, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) + $root.google.monitoring.v3.Service.CloudEndpoints.encode(message.cloudEndpoints, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) + $root.google.monitoring.v3.Service.ClusterIstio.encode(message.clusterIstio, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.telemetry != null && message.hasOwnProperty("telemetry")) + $root.google.monitoring.v3.Service.Telemetry.encode(message.telemetry, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static - * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param {google.monitoring.v3.IService} message Service message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + Service.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer. + * Decodes a Service message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest + * @returns {google.monitoring.v3.Service} Service * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateServiceLevelObjectiveRequest.decode = function decode(reader, length) { + Service.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 3: - message.serviceLevelObjectiveId = reader.string(); + message.name = reader.string(); break; case 2: - message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32()); + message.displayName = reader.string(); + break; + case 6: + message.custom = $root.google.monitoring.v3.Service.Custom.decode(reader, reader.uint32()); + break; + case 7: + message.appEngine = $root.google.monitoring.v3.Service.AppEngine.decode(reader, reader.uint32()); + break; + case 8: + message.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.decode(reader, reader.uint32()); + break; + case 9: + message.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.decode(reader, reader.uint32()); + break; + case 13: + message.telemetry = $root.google.monitoring.v3.Service.Telemetry.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -17374,1102 +16026,1188 @@ }; /** - * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * Decodes a Service message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest + * @returns {google.monitoring.v3.Service} Service * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { + Service.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateServiceLevelObjectiveRequest message. + * Verifies a Service message. * @function verify - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateServiceLevelObjectiveRequest.verify = function verify(message) { + Service.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) - if (!$util.isString(message.serviceLevelObjectiveId)) - return "serviceLevelObjectiveId: string expected"; - if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) { - var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjective); + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.custom != null && message.hasOwnProperty("custom")) { + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.Custom.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.appEngine != null && message.hasOwnProperty("appEngine")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.AppEngine.verify(message.appEngine); + if (error) + return "appEngine." + error; + } + } + if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.CloudEndpoints.verify(message.cloudEndpoints); + if (error) + return "cloudEndpoints." + error; + } + } + if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) { + if (properties.identifier === 1) + return "identifier: multiple values"; + properties.identifier = 1; + { + var error = $root.google.monitoring.v3.Service.ClusterIstio.verify(message.clusterIstio); + if (error) + return "clusterIstio." + error; + } + } + if (message.telemetry != null && message.hasOwnProperty("telemetry")) { + var error = $root.google.monitoring.v3.Service.Telemetry.verify(message.telemetry); if (error) - return "serviceLevelObjective." + error; + return "telemetry." + error; } return null; }; /** - * Creates a CreateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Service message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest + * @returns {google.monitoring.v3.Service} Service */ - CreateServiceLevelObjectiveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest) + Service.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service) return object; - var message = new $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.serviceLevelObjectiveId != null) - message.serviceLevelObjectiveId = String(object.serviceLevelObjectiveId); - if (object.serviceLevelObjective != null) { - if (typeof object.serviceLevelObjective !== "object") - throw TypeError(".google.monitoring.v3.CreateServiceLevelObjectiveRequest.serviceLevelObjective: object expected"); - message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjective); + var message = new $root.google.monitoring.v3.Service(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.monitoring.v3.Service.custom: object expected"); + message.custom = $root.google.monitoring.v3.Service.Custom.fromObject(object.custom); + } + if (object.appEngine != null) { + if (typeof object.appEngine !== "object") + throw TypeError(".google.monitoring.v3.Service.appEngine: object expected"); + message.appEngine = $root.google.monitoring.v3.Service.AppEngine.fromObject(object.appEngine); + } + if (object.cloudEndpoints != null) { + if (typeof object.cloudEndpoints !== "object") + throw TypeError(".google.monitoring.v3.Service.cloudEndpoints: object expected"); + message.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.fromObject(object.cloudEndpoints); + } + if (object.clusterIstio != null) { + if (typeof object.clusterIstio !== "object") + throw TypeError(".google.monitoring.v3.Service.clusterIstio: object expected"); + message.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.fromObject(object.clusterIstio); + } + if (object.telemetry != null) { + if (typeof object.telemetry !== "object") + throw TypeError(".google.monitoring.v3.Service.telemetry: object expected"); + message.telemetry = $root.google.monitoring.v3.Service.Telemetry.fromObject(object.telemetry); } return message; }; /** - * Creates a plain object from a CreateServiceLevelObjectiveRequest message. Also converts values to other types if specified. + * Creates a plain object from a Service message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @static - * @param {google.monitoring.v3.CreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest + * @param {google.monitoring.v3.Service} message Service * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateServiceLevelObjectiveRequest.toObject = function toObject(message, options) { + Service.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.serviceLevelObjective = null; - object.serviceLevelObjectiveId = ""; + object.name = ""; + object.displayName = ""; + object.telemetry = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) - object.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjective, options); - if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) - object.serviceLevelObjectiveId = message.serviceLevelObjectiveId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.monitoring.v3.Service.Custom.toObject(message.custom, options); + if (options.oneofs) + object.identifier = "custom"; + } + if (message.appEngine != null && message.hasOwnProperty("appEngine")) { + object.appEngine = $root.google.monitoring.v3.Service.AppEngine.toObject(message.appEngine, options); + if (options.oneofs) + object.identifier = "appEngine"; + } + if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) { + object.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.toObject(message.cloudEndpoints, options); + if (options.oneofs) + object.identifier = "cloudEndpoints"; + } + if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) { + object.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.toObject(message.clusterIstio, options); + if (options.oneofs) + object.identifier = "clusterIstio"; + } + if (message.telemetry != null && message.hasOwnProperty("telemetry")) + object.telemetry = $root.google.monitoring.v3.Service.Telemetry.toObject(message.telemetry, options); return object; }; /** - * Converts this CreateServiceLevelObjectiveRequest to JSON. + * Converts this Service to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.Service * @instance * @returns {Object.} JSON object */ - CreateServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { + Service.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateServiceLevelObjectiveRequest; - })(); - - v3.GetServiceLevelObjectiveRequest = (function() { + Service.Custom = (function() { - /** - * Properties of a GetServiceLevelObjectiveRequest. - * @memberof google.monitoring.v3 - * @interface IGetServiceLevelObjectiveRequest - * @property {string|null} [name] GetServiceLevelObjectiveRequest name - * @property {google.monitoring.v3.ServiceLevelObjective.View|null} [view] GetServiceLevelObjectiveRequest view - */ + /** + * Properties of a Custom. + * @memberof google.monitoring.v3.Service + * @interface ICustom + */ - /** - * Constructs a new GetServiceLevelObjectiveRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a GetServiceLevelObjectiveRequest. - * @implements IGetServiceLevelObjectiveRequest - * @constructor - * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest=} [properties] Properties to set - */ - function GetServiceLevelObjectiveRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetServiceLevelObjectiveRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @instance - */ - GetServiceLevelObjectiveRequest.prototype.name = ""; - - /** - * GetServiceLevelObjectiveRequest view. - * @member {google.monitoring.v3.ServiceLevelObjective.View} view - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @instance - */ - GetServiceLevelObjectiveRequest.prototype.view = 0; + /** + * Constructs a new Custom. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a Custom. + * @implements ICustom + * @constructor + * @param {google.monitoring.v3.Service.ICustom=} [properties] Properties to set + */ + function Custom(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new GetServiceLevelObjectiveRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest instance - */ - GetServiceLevelObjectiveRequest.create = function create(properties) { - return new GetServiceLevelObjectiveRequest(properties); - }; + /** + * Creates a new Custom instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.ICustom=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.Custom} Custom instance + */ + Custom.create = function create(properties) { + return new Custom(properties); + }; - /** - * Encodes the specified GetServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetServiceLevelObjectiveRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && message.hasOwnProperty("view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; + /** + * Encodes the specified Custom message. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.ICustom} message Custom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Custom.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Encodes the specified GetServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Custom message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.ICustom} message Custom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Custom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetServiceLevelObjectiveRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetServiceLevelObjectiveRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.view = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a Custom message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.Custom} Custom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Custom.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.Custom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Custom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.Custom} Custom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Custom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a GetServiceLevelObjectiveRequest message. - * @function verify - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetServiceLevelObjectiveRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 2: - case 1: - break; - } - return null; - }; + /** + * Verifies a Custom message. + * @function verify + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Custom.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - /** - * Creates a GetServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest - */ - GetServiceLevelObjectiveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetServiceLevelObjectiveRequest) - return object; - var message = new $root.google.monitoring.v3.GetServiceLevelObjectiveRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - case "VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "FULL": - case 2: - message.view = 2; - break; - case "EXPLICIT": - case 1: - message.view = 1; - break; - } - return message; - }; + /** + * Creates a Custom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.Custom} Custom + */ + Custom.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.Custom) + return object; + return new $root.google.monitoring.v3.Service.Custom(); + }; - /** - * Creates a plain object from a GetServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.GetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetServiceLevelObjectiveRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.monitoring.v3.ServiceLevelObjective.View[message.view] : message.view; - return object; - }; + /** + * Creates a plain object from a Custom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.Custom + * @static + * @param {google.monitoring.v3.Service.Custom} message Custom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Custom.toObject = function toObject() { + return {}; + }; - /** - * Converts this GetServiceLevelObjectiveRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest - * @instance - * @returns {Object.} JSON object - */ - GetServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Custom to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.Custom + * @instance + * @returns {Object.} JSON object + */ + Custom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return GetServiceLevelObjectiveRequest; - })(); + return Custom; + })(); - v3.ListServiceLevelObjectivesRequest = (function() { + Service.AppEngine = (function() { - /** - * Properties of a ListServiceLevelObjectivesRequest. - * @memberof google.monitoring.v3 - * @interface IListServiceLevelObjectivesRequest - * @property {string|null} [parent] ListServiceLevelObjectivesRequest parent - * @property {string|null} [filter] ListServiceLevelObjectivesRequest filter - * @property {number|null} [pageSize] ListServiceLevelObjectivesRequest pageSize - * @property {string|null} [pageToken] ListServiceLevelObjectivesRequest pageToken - * @property {google.monitoring.v3.ServiceLevelObjective.View|null} [view] ListServiceLevelObjectivesRequest view - */ + /** + * Properties of an AppEngine. + * @memberof google.monitoring.v3.Service + * @interface IAppEngine + * @property {string|null} [moduleId] AppEngine moduleId + */ - /** - * Constructs a new ListServiceLevelObjectivesRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListServiceLevelObjectivesRequest. - * @implements IListServiceLevelObjectivesRequest - * @constructor - * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest=} [properties] Properties to set - */ - function ListServiceLevelObjectivesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new AppEngine. + * @memberof google.monitoring.v3.Service + * @classdesc Represents an AppEngine. + * @implements IAppEngine + * @constructor + * @param {google.monitoring.v3.Service.IAppEngine=} [properties] Properties to set + */ + function AppEngine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListServiceLevelObjectivesRequest parent. - * @member {string} parent - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @instance - */ - ListServiceLevelObjectivesRequest.prototype.parent = ""; + /** + * AppEngine moduleId. + * @member {string} moduleId + * @memberof google.monitoring.v3.Service.AppEngine + * @instance + */ + AppEngine.prototype.moduleId = ""; - /** - * ListServiceLevelObjectivesRequest filter. - * @member {string} filter - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @instance - */ - ListServiceLevelObjectivesRequest.prototype.filter = ""; + /** + * Creates a new AppEngine instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.IAppEngine=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine instance + */ + AppEngine.create = function create(properties) { + return new AppEngine(properties); + }; - /** - * ListServiceLevelObjectivesRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @instance - */ - ListServiceLevelObjectivesRequest.prototype.pageSize = 0; + /** + * Encodes the specified AppEngine message. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.IAppEngine} message AppEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppEngine.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moduleId != null && message.hasOwnProperty("moduleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.moduleId); + return writer; + }; - /** - * ListServiceLevelObjectivesRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @instance - */ - ListServiceLevelObjectivesRequest.prototype.pageToken = ""; + /** + * Encodes the specified AppEngine message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.IAppEngine} message AppEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppEngine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ListServiceLevelObjectivesRequest view. - * @member {google.monitoring.v3.ServiceLevelObjective.View} view - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @instance - */ - ListServiceLevelObjectivesRequest.prototype.view = 0; + /** + * Decodes an AppEngine message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppEngine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.AppEngine(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new ListServiceLevelObjectivesRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest instance - */ - ListServiceLevelObjectivesRequest.create = function create(properties) { - return new ListServiceLevelObjectivesRequest(properties); - }; + /** + * Decodes an AppEngine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppEngine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListServiceLevelObjectivesRequest message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServiceLevelObjectivesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.view != null && message.hasOwnProperty("view")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.view); - return writer; - }; + /** + * Verifies an AppEngine message. + * @function verify + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppEngine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moduleId != null && message.hasOwnProperty("moduleId")) + if (!$util.isString(message.moduleId)) + return "moduleId: string expected"; + return null; + }; - /** - * Encodes the specified ListServiceLevelObjectivesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServiceLevelObjectivesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates an AppEngine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + */ + AppEngine.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.AppEngine) + return object; + var message = new $root.google.monitoring.v3.Service.AppEngine(); + if (object.moduleId != null) + message.moduleId = String(object.moduleId); + return message; + }; - /** - * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServiceLevelObjectivesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServiceLevelObjectivesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.filter = reader.string(); - break; - case 3: - message.pageSize = reader.int32(); - break; - case 4: - message.pageToken = reader.string(); - break; - case 5: - message.view = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from an AppEngine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.AppEngine + * @static + * @param {google.monitoring.v3.Service.AppEngine} message AppEngine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppEngine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.moduleId = ""; + if (message.moduleId != null && message.hasOwnProperty("moduleId")) + object.moduleId = message.moduleId; + return object; + }; - /** - * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServiceLevelObjectivesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this AppEngine to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.AppEngine + * @instance + * @returns {Object.} JSON object + */ + AppEngine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a ListServiceLevelObjectivesRequest message. - * @function verify - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListServiceLevelObjectivesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 2: - case 1: - break; - } - return null; - }; + return AppEngine; + })(); - /** - * Creates a ListServiceLevelObjectivesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest - */ - ListServiceLevelObjectivesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListServiceLevelObjectivesRequest) - return object; - var message = new $root.google.monitoring.v3.ListServiceLevelObjectivesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - 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); - switch (object.view) { - case "VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "FULL": - case 2: - message.view = 2; - break; - case "EXPLICIT": - case 1: - message.view = 1; - break; - } - return message; - }; + Service.CloudEndpoints = (function() { - /** - * Creates a plain object from a ListServiceLevelObjectivesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @static - * @param {google.monitoring.v3.ListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListServiceLevelObjectivesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + /** + * Properties of a CloudEndpoints. + * @memberof google.monitoring.v3.Service + * @interface ICloudEndpoints + * @property {string|null} [service] CloudEndpoints service + */ + + /** + * Constructs a new CloudEndpoints. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a CloudEndpoints. + * @implements ICloudEndpoints + * @constructor + * @param {google.monitoring.v3.Service.ICloudEndpoints=} [properties] Properties to set + */ + function CloudEndpoints(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.monitoring.v3.ServiceLevelObjective.View[message.view] : message.view; - return object; - }; - /** - * Converts this ListServiceLevelObjectivesRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest - * @instance - * @returns {Object.} JSON object - */ - ListServiceLevelObjectivesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CloudEndpoints service. + * @member {string} service + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @instance + */ + CloudEndpoints.prototype.service = ""; - return ListServiceLevelObjectivesRequest; - })(); + /** + * Creates a new CloudEndpoints instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.ICloudEndpoints=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints instance + */ + CloudEndpoints.create = function create(properties) { + return new CloudEndpoints(properties); + }; - v3.ListServiceLevelObjectivesResponse = (function() { + /** + * Encodes the specified CloudEndpoints message. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.ICloudEndpoints} message CloudEndpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEndpoints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && message.hasOwnProperty("service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + return writer; + }; - /** - * Properties of a ListServiceLevelObjectivesResponse. - * @memberof google.monitoring.v3 - * @interface IListServiceLevelObjectivesResponse - * @property {Array.|null} [serviceLevelObjectives] ListServiceLevelObjectivesResponse serviceLevelObjectives - * @property {string|null} [nextPageToken] ListServiceLevelObjectivesResponse nextPageToken - */ + /** + * Encodes the specified CloudEndpoints message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.ICloudEndpoints} message CloudEndpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEndpoints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new ListServiceLevelObjectivesResponse. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListServiceLevelObjectivesResponse. - * @implements IListServiceLevelObjectivesResponse - * @constructor - * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse=} [properties] Properties to set - */ - function ListServiceLevelObjectivesResponse(properties) { - this.serviceLevelObjectives = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a CloudEndpoints message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEndpoints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.CloudEndpoints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ListServiceLevelObjectivesResponse serviceLevelObjectives. - * @member {Array.} serviceLevelObjectives - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @instance - */ - ListServiceLevelObjectivesResponse.prototype.serviceLevelObjectives = $util.emptyArray; + /** + * Decodes a CloudEndpoints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEndpoints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ListServiceLevelObjectivesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @instance - */ - ListServiceLevelObjectivesResponse.prototype.nextPageToken = ""; + /** + * Verifies a CloudEndpoints message. + * @function verify + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudEndpoints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; - /** - * Creates a new ListServiceLevelObjectivesResponse instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse instance - */ - ListServiceLevelObjectivesResponse.create = function create(properties) { - return new ListServiceLevelObjectivesResponse(properties); - }; + /** + * Creates a CloudEndpoints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints + */ + CloudEndpoints.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.CloudEndpoints) + return object; + var message = new $root.google.monitoring.v3.Service.CloudEndpoints(); + if (object.service != null) + message.service = String(object.service); + return message; + }; - /** - * Encodes the specified ListServiceLevelObjectivesResponse message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServiceLevelObjectivesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceLevelObjectives != null && message.serviceLevelObjectives.length) - for (var i = 0; i < message.serviceLevelObjectives.length; ++i) - $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjectives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + /** + * Creates a plain object from a CloudEndpoints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @static + * @param {google.monitoring.v3.Service.CloudEndpoints} message CloudEndpoints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudEndpoints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; - /** - * Encodes the specified ListServiceLevelObjectivesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListServiceLevelObjectivesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this CloudEndpoints to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.CloudEndpoints + * @instance + * @returns {Object.} JSON object + */ + CloudEndpoints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServiceLevelObjectivesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServiceLevelObjectivesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.serviceLevelObjectives && message.serviceLevelObjectives.length)) - message.serviceLevelObjectives = []; - message.serviceLevelObjectives.push($root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return CloudEndpoints; + })(); - /** - * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListServiceLevelObjectivesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Service.ClusterIstio = (function() { - /** - * Verifies a ListServiceLevelObjectivesResponse message. - * @function verify - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListServiceLevelObjectivesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceLevelObjectives != null && message.hasOwnProperty("serviceLevelObjectives")) { - if (!Array.isArray(message.serviceLevelObjectives)) - return "serviceLevelObjectives: array expected"; - for (var i = 0; i < message.serviceLevelObjectives.length; ++i) { - var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjectives[i]); - if (error) - return "serviceLevelObjectives." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * Properties of a ClusterIstio. + * @memberof google.monitoring.v3.Service + * @interface IClusterIstio + * @property {string|null} [location] ClusterIstio location + * @property {string|null} [clusterName] ClusterIstio clusterName + * @property {string|null} [serviceNamespace] ClusterIstio serviceNamespace + * @property {string|null} [serviceName] ClusterIstio serviceName + */ - /** - * Creates a ListServiceLevelObjectivesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse - */ - ListServiceLevelObjectivesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListServiceLevelObjectivesResponse) - return object; - var message = new $root.google.monitoring.v3.ListServiceLevelObjectivesResponse(); - if (object.serviceLevelObjectives) { - if (!Array.isArray(object.serviceLevelObjectives)) - throw TypeError(".google.monitoring.v3.ListServiceLevelObjectivesResponse.serviceLevelObjectives: array expected"); - message.serviceLevelObjectives = []; - for (var i = 0; i < object.serviceLevelObjectives.length; ++i) { - if (typeof object.serviceLevelObjectives[i] !== "object") - throw TypeError(".google.monitoring.v3.ListServiceLevelObjectivesResponse.serviceLevelObjectives: object expected"); - message.serviceLevelObjectives[i] = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjectives[i]); - } + /** + * Constructs a new ClusterIstio. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a ClusterIstio. + * @implements IClusterIstio + * @constructor + * @param {google.monitoring.v3.Service.IClusterIstio=} [properties] Properties to set + */ + function ClusterIstio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - /** - * Creates a plain object from a ListServiceLevelObjectivesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @static - * @param {google.monitoring.v3.ListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListServiceLevelObjectivesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.serviceLevelObjectives = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.serviceLevelObjectives && message.serviceLevelObjectives.length) { - object.serviceLevelObjectives = []; - for (var j = 0; j < message.serviceLevelObjectives.length; ++j) - object.serviceLevelObjectives[j] = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjectives[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * ClusterIstio location. + * @member {string} location + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.location = ""; - /** - * Converts this ListServiceLevelObjectivesResponse to JSON. - * @function toJSON - * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse - * @instance - * @returns {Object.} JSON object - */ - ListServiceLevelObjectivesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ClusterIstio clusterName. + * @member {string} clusterName + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.clusterName = ""; - return ListServiceLevelObjectivesResponse; - })(); + /** + * ClusterIstio serviceNamespace. + * @member {string} serviceNamespace + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.serviceNamespace = ""; - v3.UpdateServiceLevelObjectiveRequest = (function() { + /** + * ClusterIstio serviceName. + * @member {string} serviceName + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + */ + ClusterIstio.prototype.serviceName = ""; - /** - * Properties of an UpdateServiceLevelObjectiveRequest. - * @memberof google.monitoring.v3 - * @interface IUpdateServiceLevelObjectiveRequest - * @property {google.monitoring.v3.IServiceLevelObjective|null} [serviceLevelObjective] UpdateServiceLevelObjectiveRequest serviceLevelObjective - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceLevelObjectiveRequest updateMask - */ + /** + * Creates a new ClusterIstio instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.IClusterIstio=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio instance + */ + ClusterIstio.create = function create(properties) { + return new ClusterIstio(properties); + }; - /** - * Constructs a new UpdateServiceLevelObjectiveRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents an UpdateServiceLevelObjectiveRequest. - * @implements IUpdateServiceLevelObjectiveRequest - * @constructor - * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest=} [properties] Properties to set - */ - function UpdateServiceLevelObjectiveRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified ClusterIstio message. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.IClusterIstio} message ClusterIstio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterIstio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.hasOwnProperty("location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceNamespace); + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceName); + return writer; + }; - /** - * UpdateServiceLevelObjectiveRequest serviceLevelObjective. - * @member {google.monitoring.v3.IServiceLevelObjective|null|undefined} serviceLevelObjective - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @instance - */ - UpdateServiceLevelObjectiveRequest.prototype.serviceLevelObjective = null; + /** + * Encodes the specified ClusterIstio message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.IClusterIstio} message ClusterIstio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterIstio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * UpdateServiceLevelObjectiveRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @instance - */ - UpdateServiceLevelObjectiveRequest.prototype.updateMask = null; + /** + * Decodes a ClusterIstio message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterIstio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.ClusterIstio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location = reader.string(); + break; + case 2: + message.clusterName = reader.string(); + break; + case 3: + message.serviceNamespace = reader.string(); + break; + case 4: + message.serviceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new UpdateServiceLevelObjectiveRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest instance - */ - UpdateServiceLevelObjectiveRequest.create = function create(properties) { - return new UpdateServiceLevelObjectiveRequest(properties); - }; + /** + * Decodes a ClusterIstio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterIstio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified UpdateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateServiceLevelObjectiveRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) - $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjective, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Verifies a ClusterIstio message. + * @function verify + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterIstio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) + if (!$util.isString(message.serviceNamespace)) + return "serviceNamespace: string expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + return null; + }; - /** - * Encodes the specified UpdateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a ClusterIstio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio + */ + ClusterIstio.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.ClusterIstio) + return object; + var message = new $root.google.monitoring.v3.Service.ClusterIstio(); + if (object.location != null) + message.location = String(object.location); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.serviceNamespace != null) + message.serviceNamespace = String(object.serviceNamespace); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + return message; + }; - /** - * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateServiceLevelObjectiveRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a ClusterIstio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.ClusterIstio + * @static + * @param {google.monitoring.v3.Service.ClusterIstio} message ClusterIstio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterIstio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.clusterName = ""; + object.serviceNamespace = ""; + object.serviceName = ""; } - } - return message; - }; - - /** - * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) + object.serviceNamespace = message.serviceNamespace; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + return object; + }; - /** - * Verifies an UpdateServiceLevelObjectiveRequest message. - * @function verify - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateServiceLevelObjectiveRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) { - var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjective); - if (error) - return "serviceLevelObjective." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + /** + * Converts this ClusterIstio to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.ClusterIstio + * @instance + * @returns {Object.} JSON object + */ + ClusterIstio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClusterIstio; + })(); + + Service.Telemetry = (function() { + + /** + * Properties of a Telemetry. + * @memberof google.monitoring.v3.Service + * @interface ITelemetry + * @property {string|null} [resourceName] Telemetry resourceName + */ + + /** + * Constructs a new Telemetry. + * @memberof google.monitoring.v3.Service + * @classdesc Represents a Telemetry. + * @implements ITelemetry + * @constructor + * @param {google.monitoring.v3.Service.ITelemetry=} [properties] Properties to set + */ + function Telemetry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return null; - }; - /** - * Creates an UpdateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest - */ - UpdateServiceLevelObjectiveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) + /** + * Telemetry resourceName. + * @member {string} resourceName + * @memberof google.monitoring.v3.Service.Telemetry + * @instance + */ + Telemetry.prototype.resourceName = ""; + + /** + * Creates a new Telemetry instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.ITelemetry=} [properties] Properties to set + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry instance + */ + Telemetry.create = function create(properties) { + return new Telemetry(properties); + }; + + /** + * Encodes the specified Telemetry message. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.ITelemetry} message Telemetry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Telemetry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); + return writer; + }; + + /** + * Encodes the specified Telemetry message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.ITelemetry} message Telemetry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Telemetry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Telemetry message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Telemetry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.Telemetry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Telemetry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Telemetry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Telemetry message. + * @function verify + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Telemetry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + return null; + }; + + /** + * Creates a Telemetry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Service.Telemetry} Telemetry + */ + Telemetry.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Service.Telemetry) + return object; + var message = new $root.google.monitoring.v3.Service.Telemetry(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + return message; + }; + + /** + * Creates a plain object from a Telemetry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Service.Telemetry + * @static + * @param {google.monitoring.v3.Service.Telemetry} message Telemetry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Telemetry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.resourceName = ""; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; return object; - var message = new $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); - if (object.serviceLevelObjective != null) { - if (typeof object.serviceLevelObjective !== "object") - throw TypeError(".google.monitoring.v3.UpdateServiceLevelObjectiveRequest.serviceLevelObjective: object expected"); - message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjective); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.monitoring.v3.UpdateServiceLevelObjectiveRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; + }; - /** - * Creates a plain object from an UpdateServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateServiceLevelObjectiveRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceLevelObjective = null; - object.updateMask = null; - } - if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) - object.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjective, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + /** + * Converts this Telemetry to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Service.Telemetry + * @instance + * @returns {Object.} JSON object + */ + Telemetry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UpdateServiceLevelObjectiveRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Telemetry; + })(); - return UpdateServiceLevelObjectiveRequest; + return Service; })(); - v3.DeleteServiceLevelObjectiveRequest = (function() { + v3.ServiceLevelObjective = (function() { /** - * Properties of a DeleteServiceLevelObjectiveRequest. + * Properties of a ServiceLevelObjective. * @memberof google.monitoring.v3 - * @interface IDeleteServiceLevelObjectiveRequest - * @property {string|null} [name] DeleteServiceLevelObjectiveRequest name + * @interface IServiceLevelObjective + * @property {string|null} [name] ServiceLevelObjective name + * @property {string|null} [displayName] ServiceLevelObjective displayName + * @property {google.monitoring.v3.IServiceLevelIndicator|null} [serviceLevelIndicator] ServiceLevelObjective serviceLevelIndicator + * @property {number|null} [goal] ServiceLevelObjective goal + * @property {google.protobuf.IDuration|null} [rollingPeriod] ServiceLevelObjective rollingPeriod + * @property {google.type.CalendarPeriod|null} [calendarPeriod] ServiceLevelObjective calendarPeriod */ /** - * Constructs a new DeleteServiceLevelObjectiveRequest. + * Constructs a new ServiceLevelObjective. * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteServiceLevelObjectiveRequest. - * @implements IDeleteServiceLevelObjectiveRequest + * @classdesc Represents a ServiceLevelObjective. + * @implements IServiceLevelObjective * @constructor - * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IServiceLevelObjective=} [properties] Properties to set */ - function DeleteServiceLevelObjectiveRequest(properties) { + function ServiceLevelObjective(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18477,76 +17215,155 @@ } /** - * DeleteServiceLevelObjectiveRequest name. + * ServiceLevelObjective name. * @member {string} name - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @instance */ - DeleteServiceLevelObjectiveRequest.prototype.name = ""; + ServiceLevelObjective.prototype.name = ""; /** - * Creates a new DeleteServiceLevelObjectiveRequest instance using the specified properties. + * ServiceLevelObjective displayName. + * @member {string} displayName + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.displayName = ""; + + /** + * ServiceLevelObjective serviceLevelIndicator. + * @member {google.monitoring.v3.IServiceLevelIndicator|null|undefined} serviceLevelIndicator + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.serviceLevelIndicator = null; + + /** + * ServiceLevelObjective goal. + * @member {number} goal + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.goal = 0; + + /** + * ServiceLevelObjective rollingPeriod. + * @member {google.protobuf.IDuration|null|undefined} rollingPeriod + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.rollingPeriod = null; + + /** + * ServiceLevelObjective calendarPeriod. + * @member {google.type.CalendarPeriod} calendarPeriod + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + ServiceLevelObjective.prototype.calendarPeriod = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServiceLevelObjective period. + * @member {"rollingPeriod"|"calendarPeriod"|undefined} period + * @memberof google.monitoring.v3.ServiceLevelObjective + * @instance + */ + Object.defineProperty(ServiceLevelObjective.prototype, "period", { + get: $util.oneOfGetter($oneOfFields = ["rollingPeriod", "calendarPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceLevelObjective instance using the specified properties. * @function create - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static - * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest instance + * @param {google.monitoring.v3.IServiceLevelObjective=} [properties] Properties to set + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective instance */ - DeleteServiceLevelObjectiveRequest.create = function create(properties) { - return new DeleteServiceLevelObjectiveRequest(properties); + ServiceLevelObjective.create = function create(properties) { + return new ServiceLevelObjective(properties); }; /** - * Encodes the specified DeleteServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * Encodes the specified ServiceLevelObjective message. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static - * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param {google.monitoring.v3.IServiceLevelObjective} message ServiceLevelObjective message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteServiceLevelObjectiveRequest.encode = function encode(message, writer) { + ServiceLevelObjective.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) + $root.google.monitoring.v3.ServiceLevelIndicator.encode(message.serviceLevelIndicator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.goal != null && message.hasOwnProperty("goal")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.goal); + if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) + $root.google.protobuf.Duration.encode(message.rollingPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.calendarPeriod); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName); return writer; }; /** - * Encodes the specified DeleteServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. + * Encodes the specified ServiceLevelObjective message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static - * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest message or plain object to encode + * @param {google.monitoring.v3.IServiceLevelObjective} message ServiceLevelObjective message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + ServiceLevelObjective.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer. + * Decodes a ServiceLevelObjective message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteServiceLevelObjectiveRequest.decode = function decode(reader, length) { + ServiceLevelObjective.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ServiceLevelObjective(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 11: + message.displayName = reader.string(); + break; + case 3: + message.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.decode(reader, reader.uint32()); + break; + case 4: + message.goal = reader.double(); + break; + case 5: + message.rollingPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 6: + message.calendarPeriod = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -18556,281 +17373,347 @@ }; /** - * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. + * Decodes a ServiceLevelObjective message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { + ServiceLevelObjective.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteServiceLevelObjectiveRequest message. + * Verifies a ServiceLevelObjective message. * @function verify - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteServiceLevelObjectiveRequest.verify = function verify(message) { + ServiceLevelObjective.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) { + var error = $root.google.monitoring.v3.ServiceLevelIndicator.verify(message.serviceLevelIndicator); + if (error) + return "serviceLevelIndicator." + error; + } + if (message.goal != null && message.hasOwnProperty("goal")) + if (typeof message.goal !== "number") + return "goal: number expected"; + if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) { + properties.period = 1; + { + var error = $root.google.protobuf.Duration.verify(message.rollingPeriod); + if (error) + return "rollingPeriod." + error; + } + } + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + if (properties.period === 1) + return "period: multiple values"; + properties.period = 1; + switch (message.calendarPeriod) { + default: + return "calendarPeriod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } return null; }; /** - * Creates a DeleteServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceLevelObjective message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest + * @memberof google.monitoring.v3.ServiceLevelObjective * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest + * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective */ - DeleteServiceLevelObjectiveRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) + ServiceLevelObjective.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ServiceLevelObjective) return object; - var message = new $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); + var message = new $root.google.monitoring.v3.ServiceLevelObjective(); if (object.name != null) message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteServiceLevelObjectiveRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest - * @static - * @param {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteServiceLevelObjectiveRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteServiceLevelObjectiveRequest to JSON. - * @function toJSON - * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DeleteServiceLevelObjectiveRequest; - })(); - - v3.Service = (function() { - - /** - * Properties of a Service. - * @memberof google.monitoring.v3 - * @interface IService - * @property {string|null} [name] Service name - * @property {string|null} [displayName] Service displayName - * @property {google.monitoring.v3.Service.ICustom|null} [custom] Service custom - * @property {google.monitoring.v3.Service.IAppEngine|null} [appEngine] Service appEngine - * @property {google.monitoring.v3.Service.ICloudEndpoints|null} [cloudEndpoints] Service cloudEndpoints - * @property {google.monitoring.v3.Service.IClusterIstio|null} [clusterIstio] Service clusterIstio - * @property {google.monitoring.v3.Service.ITelemetry|null} [telemetry] Service telemetry - */ + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.serviceLevelIndicator != null) { + if (typeof object.serviceLevelIndicator !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelObjective.serviceLevelIndicator: object expected"); + message.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.fromObject(object.serviceLevelIndicator); + } + if (object.goal != null) + message.goal = Number(object.goal); + if (object.rollingPeriod != null) { + if (typeof object.rollingPeriod !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelObjective.rollingPeriod: object expected"); + message.rollingPeriod = $root.google.protobuf.Duration.fromObject(object.rollingPeriod); + } + switch (object.calendarPeriod) { + case "CALENDAR_PERIOD_UNSPECIFIED": + case 0: + message.calendarPeriod = 0; + break; + case "DAY": + case 1: + message.calendarPeriod = 1; + break; + case "WEEK": + case 2: + message.calendarPeriod = 2; + break; + case "FORTNIGHT": + case 3: + message.calendarPeriod = 3; + break; + case "MONTH": + case 4: + message.calendarPeriod = 4; + break; + case "QUARTER": + case 5: + message.calendarPeriod = 5; + break; + case "HALF": + case 6: + message.calendarPeriod = 6; + break; + case "YEAR": + case 7: + message.calendarPeriod = 7; + break; + } + return message; + }; /** - * Constructs a new Service. - * @memberof google.monitoring.v3 - * @classdesc Represents a Service. - * @implements IService - * @constructor - * @param {google.monitoring.v3.IService=} [properties] Properties to set + * Creates a plain object from a ServiceLevelObjective message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ServiceLevelObjective + * @static + * @param {google.monitoring.v3.ServiceLevelObjective} message ServiceLevelObjective + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - function Service(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ServiceLevelObjective.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.serviceLevelIndicator = null; + object.goal = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) + object.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.toObject(message.serviceLevelIndicator, options); + if (message.goal != null && message.hasOwnProperty("goal")) + object.goal = options.json && !isFinite(message.goal) ? String(message.goal) : message.goal; + if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) { + object.rollingPeriod = $root.google.protobuf.Duration.toObject(message.rollingPeriod, options); + if (options.oneofs) + object.period = "rollingPeriod"; + } + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + object.calendarPeriod = options.enums === String ? $root.google.type.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; + if (options.oneofs) + object.period = "calendarPeriod"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; /** - * Service name. - * @member {string} name - * @memberof google.monitoring.v3.Service + * Converts this ServiceLevelObjective to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ServiceLevelObjective * @instance + * @returns {Object.} JSON object */ - Service.prototype.name = ""; + ServiceLevelObjective.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Service displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.Service - * @instance + * View enum. + * @name google.monitoring.v3.ServiceLevelObjective.View + * @enum {string} + * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value + * @property {number} FULL=2 FULL value + * @property {number} EXPLICIT=1 EXPLICIT value */ - Service.prototype.displayName = ""; + ServiceLevelObjective.View = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; + values[valuesById[2] = "FULL"] = 2; + values[valuesById[1] = "EXPLICIT"] = 1; + return values; + })(); + + return ServiceLevelObjective; + })(); + + v3.ServiceLevelIndicator = (function() { /** - * Service custom. - * @member {google.monitoring.v3.Service.ICustom|null|undefined} custom - * @memberof google.monitoring.v3.Service - * @instance + * Properties of a ServiceLevelIndicator. + * @memberof google.monitoring.v3 + * @interface IServiceLevelIndicator + * @property {google.monitoring.v3.IBasicSli|null} [basicSli] ServiceLevelIndicator basicSli + * @property {google.monitoring.v3.IRequestBasedSli|null} [requestBased] ServiceLevelIndicator requestBased + * @property {google.monitoring.v3.IWindowsBasedSli|null} [windowsBased] ServiceLevelIndicator windowsBased */ - Service.prototype.custom = null; /** - * Service appEngine. - * @member {google.monitoring.v3.Service.IAppEngine|null|undefined} appEngine - * @memberof google.monitoring.v3.Service - * @instance + * Constructs a new ServiceLevelIndicator. + * @memberof google.monitoring.v3 + * @classdesc Represents a ServiceLevelIndicator. + * @implements IServiceLevelIndicator + * @constructor + * @param {google.monitoring.v3.IServiceLevelIndicator=} [properties] Properties to set */ - Service.prototype.appEngine = null; + function ServiceLevelIndicator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Service cloudEndpoints. - * @member {google.monitoring.v3.Service.ICloudEndpoints|null|undefined} cloudEndpoints - * @memberof google.monitoring.v3.Service + * ServiceLevelIndicator basicSli. + * @member {google.monitoring.v3.IBasicSli|null|undefined} basicSli + * @memberof google.monitoring.v3.ServiceLevelIndicator * @instance */ - Service.prototype.cloudEndpoints = null; + ServiceLevelIndicator.prototype.basicSli = null; /** - * Service clusterIstio. - * @member {google.monitoring.v3.Service.IClusterIstio|null|undefined} clusterIstio - * @memberof google.monitoring.v3.Service + * ServiceLevelIndicator requestBased. + * @member {google.monitoring.v3.IRequestBasedSli|null|undefined} requestBased + * @memberof google.monitoring.v3.ServiceLevelIndicator * @instance */ - Service.prototype.clusterIstio = null; + ServiceLevelIndicator.prototype.requestBased = null; /** - * Service telemetry. - * @member {google.monitoring.v3.Service.ITelemetry|null|undefined} telemetry - * @memberof google.monitoring.v3.Service + * ServiceLevelIndicator windowsBased. + * @member {google.monitoring.v3.IWindowsBasedSli|null|undefined} windowsBased + * @memberof google.monitoring.v3.ServiceLevelIndicator * @instance */ - Service.prototype.telemetry = null; + ServiceLevelIndicator.prototype.windowsBased = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * Service identifier. - * @member {"custom"|"appEngine"|"cloudEndpoints"|"clusterIstio"|undefined} identifier - * @memberof google.monitoring.v3.Service + * ServiceLevelIndicator type. + * @member {"basicSli"|"requestBased"|"windowsBased"|undefined} type + * @memberof google.monitoring.v3.ServiceLevelIndicator * @instance */ - Object.defineProperty(Service.prototype, "identifier", { - get: $util.oneOfGetter($oneOfFields = ["custom", "appEngine", "cloudEndpoints", "clusterIstio"]), + Object.defineProperty(ServiceLevelIndicator.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["basicSli", "requestBased", "windowsBased"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new Service instance using the specified properties. + * Creates a new ServiceLevelIndicator instance using the specified properties. * @function create - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static - * @param {google.monitoring.v3.IService=} [properties] Properties to set - * @returns {google.monitoring.v3.Service} Service instance + * @param {google.monitoring.v3.IServiceLevelIndicator=} [properties] Properties to set + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator instance */ - Service.create = function create(properties) { - return new Service(properties); + ServiceLevelIndicator.create = function create(properties) { + return new ServiceLevelIndicator(properties); }; /** - * Encodes the specified Service message. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * Encodes the specified ServiceLevelIndicator message. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static - * @param {google.monitoring.v3.IService} message Service message or plain object to encode + * @param {google.monitoring.v3.IServiceLevelIndicator} message ServiceLevelIndicator message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Service.encode = function encode(message, writer) { + ServiceLevelIndicator.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.custom != null && message.hasOwnProperty("custom")) - $root.google.monitoring.v3.Service.Custom.encode(message.custom, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.appEngine != null && message.hasOwnProperty("appEngine")) - $root.google.monitoring.v3.Service.AppEngine.encode(message.appEngine, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) - $root.google.monitoring.v3.Service.CloudEndpoints.encode(message.cloudEndpoints, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) - $root.google.monitoring.v3.Service.ClusterIstio.encode(message.clusterIstio, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.telemetry != null && message.hasOwnProperty("telemetry")) - $root.google.monitoring.v3.Service.Telemetry.encode(message.telemetry, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.requestBased != null && message.hasOwnProperty("requestBased")) + $root.google.monitoring.v3.RequestBasedSli.encode(message.requestBased, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) + $root.google.monitoring.v3.WindowsBasedSli.encode(message.windowsBased, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.basicSli != null && message.hasOwnProperty("basicSli")) + $root.google.monitoring.v3.BasicSli.encode(message.basicSli, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.verify|verify} messages. + * Encodes the specified ServiceLevelIndicator message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static - * @param {google.monitoring.v3.IService} message Service message or plain object to encode + * @param {google.monitoring.v3.IServiceLevelIndicator} message ServiceLevelIndicator message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Service.encodeDelimited = function encodeDelimited(message, writer) { + ServiceLevelIndicator.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Service message from the specified reader or buffer. + * Decodes a ServiceLevelIndicator message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Service} Service + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Service.decode = function decode(reader, length) { + ServiceLevelIndicator.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ServiceLevelIndicator(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.basicSli = $root.google.monitoring.v3.BasicSli.decode(reader, reader.uint32()); + break; case 1: - message.name = reader.string(); + message.requestBased = $root.google.monitoring.v3.RequestBasedSli.decode(reader, reader.uint32()); break; case 2: - message.displayName = reader.string(); - break; - case 6: - message.custom = $root.google.monitoring.v3.Service.Custom.decode(reader, reader.uint32()); - break; - case 7: - message.appEngine = $root.google.monitoring.v3.Service.AppEngine.decode(reader, reader.uint32()); - break; - case 8: - message.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.decode(reader, reader.uint32()); - break; - case 9: - message.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.decode(reader, reader.uint32()); - break; - case 13: - message.telemetry = $root.google.monitoring.v3.Service.Telemetry.decode(reader, reader.uint32()); + message.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18841,265 +17724,575 @@ }; /** - * Decodes a Service message from the specified reader or buffer, length delimited. + * Decodes a ServiceLevelIndicator message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Service} Service + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Service.decodeDelimited = function decodeDelimited(reader) { + ServiceLevelIndicator.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Service message. + * Verifies a ServiceLevelIndicator message. * @function verify - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Service.verify = function verify(message) { + ServiceLevelIndicator.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.custom != null && message.hasOwnProperty("custom")) { - properties.identifier = 1; - { - var error = $root.google.monitoring.v3.Service.Custom.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.appEngine != null && message.hasOwnProperty("appEngine")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; + if (message.basicSli != null && message.hasOwnProperty("basicSli")) { + properties.type = 1; { - var error = $root.google.monitoring.v3.Service.AppEngine.verify(message.appEngine); + var error = $root.google.monitoring.v3.BasicSli.verify(message.basicSli); if (error) - return "appEngine." + error; + return "basicSli." + error; } } - if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; + if (message.requestBased != null && message.hasOwnProperty("requestBased")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; { - var error = $root.google.monitoring.v3.Service.CloudEndpoints.verify(message.cloudEndpoints); + var error = $root.google.monitoring.v3.RequestBasedSli.verify(message.requestBased); if (error) - return "cloudEndpoints." + error; + return "requestBased." + error; } } - if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) { - if (properties.identifier === 1) - return "identifier: multiple values"; - properties.identifier = 1; + if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; { - var error = $root.google.monitoring.v3.Service.ClusterIstio.verify(message.clusterIstio); + var error = $root.google.monitoring.v3.WindowsBasedSli.verify(message.windowsBased); if (error) - return "clusterIstio." + error; + return "windowsBased." + error; } } - if (message.telemetry != null && message.hasOwnProperty("telemetry")) { - var error = $root.google.monitoring.v3.Service.Telemetry.verify(message.telemetry); - if (error) - return "telemetry." + error; - } return null; }; /** - * Creates a Service message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceLevelIndicator message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Service} Service + * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator */ - Service.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Service) + ServiceLevelIndicator.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ServiceLevelIndicator) return object; - var message = new $root.google.monitoring.v3.Service(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.monitoring.v3.Service.custom: object expected"); - message.custom = $root.google.monitoring.v3.Service.Custom.fromObject(object.custom); - } - if (object.appEngine != null) { - if (typeof object.appEngine !== "object") - throw TypeError(".google.monitoring.v3.Service.appEngine: object expected"); - message.appEngine = $root.google.monitoring.v3.Service.AppEngine.fromObject(object.appEngine); - } - if (object.cloudEndpoints != null) { - if (typeof object.cloudEndpoints !== "object") - throw TypeError(".google.monitoring.v3.Service.cloudEndpoints: object expected"); - message.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.fromObject(object.cloudEndpoints); + var message = new $root.google.monitoring.v3.ServiceLevelIndicator(); + if (object.basicSli != null) { + if (typeof object.basicSli !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.basicSli: object expected"); + message.basicSli = $root.google.monitoring.v3.BasicSli.fromObject(object.basicSli); } - if (object.clusterIstio != null) { - if (typeof object.clusterIstio !== "object") - throw TypeError(".google.monitoring.v3.Service.clusterIstio: object expected"); - message.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.fromObject(object.clusterIstio); + if (object.requestBased != null) { + if (typeof object.requestBased !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.requestBased: object expected"); + message.requestBased = $root.google.monitoring.v3.RequestBasedSli.fromObject(object.requestBased); } - if (object.telemetry != null) { - if (typeof object.telemetry !== "object") - throw TypeError(".google.monitoring.v3.Service.telemetry: object expected"); - message.telemetry = $root.google.monitoring.v3.Service.Telemetry.fromObject(object.telemetry); + if (object.windowsBased != null) { + if (typeof object.windowsBased !== "object") + throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.windowsBased: object expected"); + message.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.fromObject(object.windowsBased); } return message; }; /** - * Creates a plain object from a Service message. Also converts values to other types if specified. + * Creates a plain object from a ServiceLevelIndicator message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @static - * @param {google.monitoring.v3.Service} message Service + * @param {google.monitoring.v3.ServiceLevelIndicator} message ServiceLevelIndicator * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Service.toObject = function toObject(message, options) { + ServiceLevelIndicator.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.telemetry = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.monitoring.v3.Service.Custom.toObject(message.custom, options); - if (options.oneofs) - object.identifier = "custom"; - } - if (message.appEngine != null && message.hasOwnProperty("appEngine")) { - object.appEngine = $root.google.monitoring.v3.Service.AppEngine.toObject(message.appEngine, options); + if (message.requestBased != null && message.hasOwnProperty("requestBased")) { + object.requestBased = $root.google.monitoring.v3.RequestBasedSli.toObject(message.requestBased, options); if (options.oneofs) - object.identifier = "appEngine"; + object.type = "requestBased"; } - if (message.cloudEndpoints != null && message.hasOwnProperty("cloudEndpoints")) { - object.cloudEndpoints = $root.google.monitoring.v3.Service.CloudEndpoints.toObject(message.cloudEndpoints, options); + if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) { + object.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.toObject(message.windowsBased, options); if (options.oneofs) - object.identifier = "cloudEndpoints"; + object.type = "windowsBased"; } - if (message.clusterIstio != null && message.hasOwnProperty("clusterIstio")) { - object.clusterIstio = $root.google.monitoring.v3.Service.ClusterIstio.toObject(message.clusterIstio, options); + if (message.basicSli != null && message.hasOwnProperty("basicSli")) { + object.basicSli = $root.google.monitoring.v3.BasicSli.toObject(message.basicSli, options); if (options.oneofs) - object.identifier = "clusterIstio"; + object.type = "basicSli"; } - if (message.telemetry != null && message.hasOwnProperty("telemetry")) - object.telemetry = $root.google.monitoring.v3.Service.Telemetry.toObject(message.telemetry, options); return object; }; /** - * Converts this Service to JSON. + * Converts this ServiceLevelIndicator to JSON. * @function toJSON - * @memberof google.monitoring.v3.Service + * @memberof google.monitoring.v3.ServiceLevelIndicator * @instance * @returns {Object.} JSON object */ - Service.prototype.toJSON = function toJSON() { + ServiceLevelIndicator.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Service.Custom = (function() { - - /** - * Properties of a Custom. - * @memberof google.monitoring.v3.Service - * @interface ICustom - */ + return ServiceLevelIndicator; + })(); - /** - * Constructs a new Custom. - * @memberof google.monitoring.v3.Service - * @classdesc Represents a Custom. - * @implements ICustom - * @constructor - * @param {google.monitoring.v3.Service.ICustom=} [properties] Properties to set - */ - function Custom(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v3.BasicSli = (function() { - /** - * Creates a new Custom instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.Service.Custom - * @static - * @param {google.monitoring.v3.Service.ICustom=} [properties] Properties to set - * @returns {google.monitoring.v3.Service.Custom} Custom instance - */ - Custom.create = function create(properties) { - return new Custom(properties); - }; + /** + * Properties of a BasicSli. + * @memberof google.monitoring.v3 + * @interface IBasicSli + * @property {Array.|null} [method] BasicSli method + * @property {Array.|null} [location] BasicSli location + * @property {Array.|null} [version] BasicSli version + * @property {google.monitoring.v3.BasicSli.IAvailabilityCriteria|null} [availability] BasicSli availability + * @property {google.monitoring.v3.BasicSli.ILatencyCriteria|null} [latency] BasicSli latency + */ - /** - * Encodes the specified Custom message. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.Service.Custom - * @static - * @param {google.monitoring.v3.Service.ICustom} message Custom message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Custom.encode = function encode(message, writer) { - if (!writer) + /** + * Constructs a new BasicSli. + * @memberof google.monitoring.v3 + * @classdesc Represents a BasicSli. + * @implements IBasicSli + * @constructor + * @param {google.monitoring.v3.IBasicSli=} [properties] Properties to set + */ + function BasicSli(properties) { + this.method = []; + this.location = []; + this.version = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BasicSli method. + * @member {Array.} method + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.method = $util.emptyArray; + + /** + * BasicSli location. + * @member {Array.} location + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.location = $util.emptyArray; + + /** + * BasicSli version. + * @member {Array.} version + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.version = $util.emptyArray; + + /** + * BasicSli availability. + * @member {google.monitoring.v3.BasicSli.IAvailabilityCriteria|null|undefined} availability + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.availability = null; + + /** + * BasicSli latency. + * @member {google.monitoring.v3.BasicSli.ILatencyCriteria|null|undefined} latency + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + BasicSli.prototype.latency = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BasicSli sliCriteria. + * @member {"availability"|"latency"|undefined} sliCriteria + * @memberof google.monitoring.v3.BasicSli + * @instance + */ + Object.defineProperty(BasicSli.prototype, "sliCriteria", { + get: $util.oneOfGetter($oneOfFields = ["availability", "latency"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BasicSli instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.IBasicSli=} [properties] Properties to set + * @returns {google.monitoring.v3.BasicSli} BasicSli instance + */ + BasicSli.create = function create(properties) { + return new BasicSli(properties); + }; + + /** + * Encodes the specified BasicSli message. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.IBasicSli} message BasicSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicSli.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availability != null && message.hasOwnProperty("availability")) + $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.encode(message.availability, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.latency != null && message.hasOwnProperty("latency")) + $root.google.monitoring.v3.BasicSli.LatencyCriteria.encode(message.latency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.method[i]); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location[i]); + if (message.version != null && message.version.length) + for (var i = 0; i < message.version.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.version[i]); + return writer; + }; + + /** + * Encodes the specified BasicSli message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.IBasicSli} message BasicSli message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicSli.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicSli message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.BasicSli} BasicSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicSli.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push(reader.string()); + break; + case 8: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push(reader.string()); + break; + case 9: + if (!(message.version && message.version.length)) + message.version = []; + message.version.push(reader.string()); + break; + case 2: + message.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.decode(reader, reader.uint32()); + break; + case 3: + message.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicSli message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.BasicSli} BasicSli + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicSli.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicSli message. + * @function verify + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicSli.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) + if (!$util.isString(message.method[i])) + return "method: string[] expected"; + } + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) + if (!$util.isString(message.location[i])) + return "location: string[] expected"; + } + if (message.version != null && message.hasOwnProperty("version")) { + if (!Array.isArray(message.version)) + return "version: array expected"; + for (var i = 0; i < message.version.length; ++i) + if (!$util.isString(message.version[i])) + return "version: string[] expected"; + } + if (message.availability != null && message.hasOwnProperty("availability")) { + properties.sliCriteria = 1; + { + var error = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.verify(message.availability); + if (error) + return "availability." + error; + } + } + if (message.latency != null && message.hasOwnProperty("latency")) { + if (properties.sliCriteria === 1) + return "sliCriteria: multiple values"; + properties.sliCriteria = 1; + { + var error = $root.google.monitoring.v3.BasicSli.LatencyCriteria.verify(message.latency); + if (error) + return "latency." + error; + } + } + return null; + }; + + /** + * Creates a BasicSli message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.BasicSli} BasicSli + */ + BasicSli.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.BasicSli) + return object; + var message = new $root.google.monitoring.v3.BasicSli(); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.monitoring.v3.BasicSli.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) + message.method[i] = String(object.method[i]); + } + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.monitoring.v3.BasicSli.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) + message.location[i] = String(object.location[i]); + } + if (object.version) { + if (!Array.isArray(object.version)) + throw TypeError(".google.monitoring.v3.BasicSli.version: array expected"); + message.version = []; + for (var i = 0; i < object.version.length; ++i) + message.version[i] = String(object.version[i]); + } + if (object.availability != null) { + if (typeof object.availability !== "object") + throw TypeError(".google.monitoring.v3.BasicSli.availability: object expected"); + message.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.fromObject(object.availability); + } + if (object.latency != null) { + if (typeof object.latency !== "object") + throw TypeError(".google.monitoring.v3.BasicSli.latency: object expected"); + message.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.fromObject(object.latency); + } + return message; + }; + + /** + * Creates a plain object from a BasicSli message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.BasicSli + * @static + * @param {google.monitoring.v3.BasicSli} message BasicSli + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicSli.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.method = []; + object.location = []; + object.version = []; + } + if (message.availability != null && message.hasOwnProperty("availability")) { + object.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.toObject(message.availability, options); + if (options.oneofs) + object.sliCriteria = "availability"; + } + if (message.latency != null && message.hasOwnProperty("latency")) { + object.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.toObject(message.latency, options); + if (options.oneofs) + object.sliCriteria = "latency"; + } + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = message.method[j]; + } + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = message.location[j]; + } + if (message.version && message.version.length) { + object.version = []; + for (var j = 0; j < message.version.length; ++j) + object.version[j] = message.version[j]; + } + return object; + }; + + /** + * Converts this BasicSli to JSON. + * @function toJSON + * @memberof google.monitoring.v3.BasicSli + * @instance + * @returns {Object.} JSON object + */ + BasicSli.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BasicSli.AvailabilityCriteria = (function() { + + /** + * Properties of an AvailabilityCriteria. + * @memberof google.monitoring.v3.BasicSli + * @interface IAvailabilityCriteria + */ + + /** + * Constructs a new AvailabilityCriteria. + * @memberof google.monitoring.v3.BasicSli + * @classdesc Represents an AvailabilityCriteria. + * @implements IAvailabilityCriteria + * @constructor + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria=} [properties] Properties to set + */ + function AvailabilityCriteria(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AvailabilityCriteria instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria=} [properties] Properties to set + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria instance + */ + AvailabilityCriteria.create = function create(properties) { + return new AvailabilityCriteria(properties); + }; + + /** + * Encodes the specified AvailabilityCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @static + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria} message AvailabilityCriteria message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailabilityCriteria.encode = function encode(message, writer) { + if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified Custom message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Custom.verify|verify} messages. + * Encodes the specified AvailabilityCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @static - * @param {google.monitoring.v3.Service.ICustom} message Custom message or plain object to encode + * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria} message AvailabilityCriteria message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Custom.encodeDelimited = function encodeDelimited(message, writer) { + AvailabilityCriteria.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Custom message from the specified reader or buffer. + * Decodes an AvailabilityCriteria message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Service.Custom} Custom + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Custom.decode = function decode(reader, length) { + AvailabilityCriteria.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.Custom(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli.AvailabilityCriteria(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -19112,94 +18305,94 @@ }; /** - * Decodes a Custom message from the specified reader or buffer, length delimited. + * Decodes an AvailabilityCriteria message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Service.Custom} Custom + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Custom.decodeDelimited = function decodeDelimited(reader) { + AvailabilityCriteria.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Custom message. + * Verifies an AvailabilityCriteria message. * @function verify - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Custom.verify = function verify(message) { + AvailabilityCriteria.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a Custom message from a plain object. Also converts values to their respective internal types. + * Creates an AvailabilityCriteria message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Service.Custom} Custom + * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria */ - Custom.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Service.Custom) + AvailabilityCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.BasicSli.AvailabilityCriteria) return object; - return new $root.google.monitoring.v3.Service.Custom(); + return new $root.google.monitoring.v3.BasicSli.AvailabilityCriteria(); }; /** - * Creates a plain object from a Custom message. Also converts values to other types if specified. + * Creates a plain object from an AvailabilityCriteria message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @static - * @param {google.monitoring.v3.Service.Custom} message Custom + * @param {google.monitoring.v3.BasicSli.AvailabilityCriteria} message AvailabilityCriteria * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Custom.toObject = function toObject() { + AvailabilityCriteria.toObject = function toObject() { return {}; }; /** - * Converts this Custom to JSON. + * Converts this AvailabilityCriteria to JSON. * @function toJSON - * @memberof google.monitoring.v3.Service.Custom + * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria * @instance * @returns {Object.} JSON object */ - Custom.prototype.toJSON = function toJSON() { + AvailabilityCriteria.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Custom; + return AvailabilityCriteria; })(); - Service.AppEngine = (function() { + BasicSli.LatencyCriteria = (function() { /** - * Properties of an AppEngine. - * @memberof google.monitoring.v3.Service - * @interface IAppEngine - * @property {string|null} [moduleId] AppEngine moduleId + * Properties of a LatencyCriteria. + * @memberof google.monitoring.v3.BasicSli + * @interface ILatencyCriteria + * @property {google.protobuf.IDuration|null} [threshold] LatencyCriteria threshold */ /** - * Constructs a new AppEngine. - * @memberof google.monitoring.v3.Service - * @classdesc Represents an AppEngine. - * @implements IAppEngine + * Constructs a new LatencyCriteria. + * @memberof google.monitoring.v3.BasicSli + * @classdesc Represents a LatencyCriteria. + * @implements ILatencyCriteria * @constructor - * @param {google.monitoring.v3.Service.IAppEngine=} [properties] Properties to set + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria=} [properties] Properties to set */ - function AppEngine(properties) { + function LatencyCriteria(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19207,75 +18400,75 @@ } /** - * AppEngine moduleId. - * @member {string} moduleId - * @memberof google.monitoring.v3.Service.AppEngine + * LatencyCriteria threshold. + * @member {google.protobuf.IDuration|null|undefined} threshold + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @instance */ - AppEngine.prototype.moduleId = ""; + LatencyCriteria.prototype.threshold = null; /** - * Creates a new AppEngine instance using the specified properties. + * Creates a new LatencyCriteria instance using the specified properties. * @function create - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static - * @param {google.monitoring.v3.Service.IAppEngine=} [properties] Properties to set - * @returns {google.monitoring.v3.Service.AppEngine} AppEngine instance + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria=} [properties] Properties to set + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria instance */ - AppEngine.create = function create(properties) { - return new AppEngine(properties); + LatencyCriteria.create = function create(properties) { + return new LatencyCriteria(properties); }; /** - * Encodes the specified AppEngine message. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * Encodes the specified LatencyCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static - * @param {google.monitoring.v3.Service.IAppEngine} message AppEngine message or plain object to encode + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria} message LatencyCriteria message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppEngine.encode = function encode(message, writer) { + LatencyCriteria.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.moduleId != null && message.hasOwnProperty("moduleId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.moduleId); + if (message.threshold != null && message.hasOwnProperty("threshold")) + $root.google.protobuf.Duration.encode(message.threshold, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AppEngine message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.AppEngine.verify|verify} messages. + * Encodes the specified LatencyCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static - * @param {google.monitoring.v3.Service.IAppEngine} message AppEngine message or plain object to encode + * @param {google.monitoring.v3.BasicSli.ILatencyCriteria} message LatencyCriteria message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppEngine.encodeDelimited = function encodeDelimited(message, writer) { + LatencyCriteria.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppEngine message from the specified reader or buffer. + * Decodes a LatencyCriteria message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppEngine.decode = function decode(reader, length) { + LatencyCriteria.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.AppEngine(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli.LatencyCriteria(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.moduleId = reader.string(); + case 3: + message.threshold = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -19286,743 +18479,326 @@ }; /** - * Decodes an AppEngine message from the specified reader or buffer, length delimited. + * Decodes a LatencyCriteria message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppEngine.decodeDelimited = function decodeDelimited(reader) { + LatencyCriteria.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppEngine message. + * Verifies a LatencyCriteria message. * @function verify - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppEngine.verify = function verify(message) { + LatencyCriteria.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.moduleId != null && message.hasOwnProperty("moduleId")) - if (!$util.isString(message.moduleId)) - return "moduleId: string expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) { + var error = $root.google.protobuf.Duration.verify(message.threshold); + if (error) + return "threshold." + error; + } return null; }; /** - * Creates an AppEngine message from a plain object. Also converts values to their respective internal types. + * Creates a LatencyCriteria message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Service.AppEngine} AppEngine + * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria */ - AppEngine.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Service.AppEngine) + LatencyCriteria.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.BasicSli.LatencyCriteria) return object; - var message = new $root.google.monitoring.v3.Service.AppEngine(); - if (object.moduleId != null) - message.moduleId = String(object.moduleId); + var message = new $root.google.monitoring.v3.BasicSli.LatencyCriteria(); + if (object.threshold != null) { + if (typeof object.threshold !== "object") + throw TypeError(".google.monitoring.v3.BasicSli.LatencyCriteria.threshold: object expected"); + message.threshold = $root.google.protobuf.Duration.fromObject(object.threshold); + } return message; }; /** - * Creates a plain object from an AppEngine message. Also converts values to other types if specified. + * Creates a plain object from a LatencyCriteria message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @static - * @param {google.monitoring.v3.Service.AppEngine} message AppEngine + * @param {google.monitoring.v3.BasicSli.LatencyCriteria} message LatencyCriteria * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppEngine.toObject = function toObject(message, options) { + LatencyCriteria.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.moduleId = ""; - if (message.moduleId != null && message.hasOwnProperty("moduleId")) - object.moduleId = message.moduleId; + object.threshold = null; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = $root.google.protobuf.Duration.toObject(message.threshold, options); return object; }; /** - * Converts this AppEngine to JSON. + * Converts this LatencyCriteria to JSON. * @function toJSON - * @memberof google.monitoring.v3.Service.AppEngine + * @memberof google.monitoring.v3.BasicSli.LatencyCriteria * @instance * @returns {Object.} JSON object */ - AppEngine.prototype.toJSON = function toJSON() { + LatencyCriteria.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppEngine; + return LatencyCriteria; })(); - Service.CloudEndpoints = (function() { - - /** - * Properties of a CloudEndpoints. - * @memberof google.monitoring.v3.Service - * @interface ICloudEndpoints - * @property {string|null} [service] CloudEndpoints service - */ - - /** - * Constructs a new CloudEndpoints. - * @memberof google.monitoring.v3.Service - * @classdesc Represents a CloudEndpoints. - * @implements ICloudEndpoints - * @constructor - * @param {google.monitoring.v3.Service.ICloudEndpoints=} [properties] Properties to set - */ - function CloudEndpoints(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudEndpoints service. - * @member {string} service - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @instance - */ - CloudEndpoints.prototype.service = ""; + return BasicSli; + })(); - /** - * Creates a new CloudEndpoints instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {google.monitoring.v3.Service.ICloudEndpoints=} [properties] Properties to set - * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints instance - */ - CloudEndpoints.create = function create(properties) { - return new CloudEndpoints(properties); - }; + v3.Range = (function() { - /** - * Encodes the specified CloudEndpoints message. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {google.monitoring.v3.Service.ICloudEndpoints} message CloudEndpoints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudEndpoints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && message.hasOwnProperty("service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - return writer; - }; + /** + * Properties of a Range. + * @memberof google.monitoring.v3 + * @interface IRange + * @property {number|null} [min] Range min + * @property {number|null} [max] Range max + */ - /** - * Encodes the specified CloudEndpoints message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.CloudEndpoints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {google.monitoring.v3.Service.ICloudEndpoints} message CloudEndpoints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudEndpoints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new Range. + * @memberof google.monitoring.v3 + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.monitoring.v3.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a CloudEndpoints message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudEndpoints.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.CloudEndpoints(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.service = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Range min. + * @member {number} min + * @memberof google.monitoring.v3.Range + * @instance + */ + Range.prototype.min = 0; - /** - * Decodes a CloudEndpoints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudEndpoints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Range max. + * @member {number} max + * @memberof google.monitoring.v3.Range + * @instance + */ + Range.prototype.max = 0; - /** - * Verifies a CloudEndpoints message. - * @function verify - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudEndpoints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - return null; - }; + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.IRange=} [properties] Properties to set + * @returns {google.monitoring.v3.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; - /** - * Creates a CloudEndpoints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Service.CloudEndpoints} CloudEndpoints - */ - CloudEndpoints.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Service.CloudEndpoints) - return object; - var message = new $root.google.monitoring.v3.Service.CloudEndpoints(); - if (object.service != null) - message.service = String(object.service); - return message; - }; + /** + * Encodes the specified Range message. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && message.hasOwnProperty("min")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); + if (message.max != null && message.hasOwnProperty("max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + return writer; + }; - /** - * Creates a plain object from a CloudEndpoints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @static - * @param {google.monitoring.v3.Service.CloudEndpoints} message CloudEndpoints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudEndpoints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - return object; - }; + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this CloudEndpoints to JSON. - * @function toJSON - * @memberof google.monitoring.v3.Service.CloudEndpoints - * @instance - * @returns {Object.} JSON object - */ - CloudEndpoints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.min = reader.double(); + break; + case 2: + message.max = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return CloudEndpoints; - })(); + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.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()); + }; - Service.ClusterIstio = (function() { + /** + * Verifies a Range message. + * @function verify + * @memberof google.monitoring.v3.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + return null; + }; - /** - * Properties of a ClusterIstio. - * @memberof google.monitoring.v3.Service - * @interface IClusterIstio - * @property {string|null} [location] ClusterIstio location - * @property {string|null} [clusterName] ClusterIstio clusterName - * @property {string|null} [serviceNamespace] ClusterIstio serviceNamespace - * @property {string|null} [serviceName] ClusterIstio serviceName - */ + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.Range + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.Range) + return object; + var message = new $root.google.monitoring.v3.Range(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + return message; + }; - /** - * Constructs a new ClusterIstio. - * @memberof google.monitoring.v3.Service - * @classdesc Represents a ClusterIstio. - * @implements IClusterIstio - * @constructor - * @param {google.monitoring.v3.Service.IClusterIstio=} [properties] Properties to set - */ - function ClusterIstio(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.Range + * @static + * @param {google.monitoring.v3.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; } + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + return object; + }; - /** - * ClusterIstio location. - * @member {string} location - * @memberof google.monitoring.v3.Service.ClusterIstio - * @instance - */ - ClusterIstio.prototype.location = ""; + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.monitoring.v3.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ClusterIstio clusterName. - * @member {string} clusterName - * @memberof google.monitoring.v3.Service.ClusterIstio - * @instance - */ - ClusterIstio.prototype.clusterName = ""; + return Range; + })(); - /** - * ClusterIstio serviceNamespace. - * @member {string} serviceNamespace - * @memberof google.monitoring.v3.Service.ClusterIstio - * @instance - */ - ClusterIstio.prototype.serviceNamespace = ""; + v3.RequestBasedSli = (function() { - /** - * ClusterIstio serviceName. - * @member {string} serviceName - * @memberof google.monitoring.v3.Service.ClusterIstio - * @instance - */ - ClusterIstio.prototype.serviceName = ""; - - /** - * Creates a new ClusterIstio instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {google.monitoring.v3.Service.IClusterIstio=} [properties] Properties to set - * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio instance - */ - ClusterIstio.create = function create(properties) { - return new ClusterIstio(properties); - }; - - /** - * Encodes the specified ClusterIstio message. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {google.monitoring.v3.Service.IClusterIstio} message ClusterIstio message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterIstio.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.hasOwnProperty("location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceNamespace); - if (message.serviceName != null && message.hasOwnProperty("serviceName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceName); - return writer; - }; - - /** - * Encodes the specified ClusterIstio message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.ClusterIstio.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {google.monitoring.v3.Service.IClusterIstio} message ClusterIstio message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterIstio.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterIstio message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterIstio.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.ClusterIstio(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.location = reader.string(); - break; - case 2: - message.clusterName = reader.string(); - break; - case 3: - message.serviceNamespace = reader.string(); - break; - case 4: - message.serviceName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterIstio message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterIstio.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterIstio message. - * @function verify - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterIstio.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) - if (!$util.isString(message.serviceNamespace)) - return "serviceNamespace: string expected"; - if (message.serviceName != null && message.hasOwnProperty("serviceName")) - if (!$util.isString(message.serviceName)) - return "serviceName: string expected"; - return null; - }; - - /** - * Creates a ClusterIstio message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Service.ClusterIstio} ClusterIstio - */ - ClusterIstio.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Service.ClusterIstio) - return object; - var message = new $root.google.monitoring.v3.Service.ClusterIstio(); - if (object.location != null) - message.location = String(object.location); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.serviceNamespace != null) - message.serviceNamespace = String(object.serviceNamespace); - if (object.serviceName != null) - message.serviceName = String(object.serviceName); - return message; - }; - - /** - * Creates a plain object from a ClusterIstio message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.Service.ClusterIstio - * @static - * @param {google.monitoring.v3.Service.ClusterIstio} message ClusterIstio - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterIstio.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.location = ""; - object.clusterName = ""; - object.serviceNamespace = ""; - object.serviceName = ""; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.serviceNamespace != null && message.hasOwnProperty("serviceNamespace")) - object.serviceNamespace = message.serviceNamespace; - if (message.serviceName != null && message.hasOwnProperty("serviceName")) - object.serviceName = message.serviceName; - return object; - }; - - /** - * Converts this ClusterIstio to JSON. - * @function toJSON - * @memberof google.monitoring.v3.Service.ClusterIstio - * @instance - * @returns {Object.} JSON object - */ - ClusterIstio.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ClusterIstio; - })(); - - Service.Telemetry = (function() { - - /** - * Properties of a Telemetry. - * @memberof google.monitoring.v3.Service - * @interface ITelemetry - * @property {string|null} [resourceName] Telemetry resourceName - */ - - /** - * Constructs a new Telemetry. - * @memberof google.monitoring.v3.Service - * @classdesc Represents a Telemetry. - * @implements ITelemetry - * @constructor - * @param {google.monitoring.v3.Service.ITelemetry=} [properties] Properties to set - */ - function Telemetry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Telemetry resourceName. - * @member {string} resourceName - * @memberof google.monitoring.v3.Service.Telemetry - * @instance - */ - Telemetry.prototype.resourceName = ""; - - /** - * Creates a new Telemetry instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {google.monitoring.v3.Service.ITelemetry=} [properties] Properties to set - * @returns {google.monitoring.v3.Service.Telemetry} Telemetry instance - */ - Telemetry.create = function create(properties) { - return new Telemetry(properties); - }; - - /** - * Encodes the specified Telemetry message. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {google.monitoring.v3.Service.ITelemetry} message Telemetry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Telemetry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceName); - return writer; - }; - - /** - * Encodes the specified Telemetry message, length delimited. Does not implicitly {@link google.monitoring.v3.Service.Telemetry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {google.monitoring.v3.Service.ITelemetry} message Telemetry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Telemetry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Telemetry message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Service.Telemetry} Telemetry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Telemetry.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Service.Telemetry(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resourceName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Telemetry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Service.Telemetry} Telemetry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Telemetry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Telemetry message. - * @function verify - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Telemetry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - if (!$util.isString(message.resourceName)) - return "resourceName: string expected"; - return null; - }; - - /** - * Creates a Telemetry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Service.Telemetry} Telemetry - */ - Telemetry.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Service.Telemetry) - return object; - var message = new $root.google.monitoring.v3.Service.Telemetry(); - if (object.resourceName != null) - message.resourceName = String(object.resourceName); - return message; - }; - - /** - * Creates a plain object from a Telemetry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.Service.Telemetry - * @static - * @param {google.monitoring.v3.Service.Telemetry} message Telemetry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Telemetry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.resourceName = ""; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) - object.resourceName = message.resourceName; - return object; - }; - - /** - * Converts this Telemetry to JSON. - * @function toJSON - * @memberof google.monitoring.v3.Service.Telemetry - * @instance - * @returns {Object.} JSON object - */ - Telemetry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Telemetry; - })(); - - return Service; - })(); - - v3.ServiceLevelObjective = (function() { + /** + * Properties of a RequestBasedSli. + * @memberof google.monitoring.v3 + * @interface IRequestBasedSli + * @property {google.monitoring.v3.ITimeSeriesRatio|null} [goodTotalRatio] RequestBasedSli goodTotalRatio + * @property {google.monitoring.v3.IDistributionCut|null} [distributionCut] RequestBasedSli distributionCut + */ /** - * Properties of a ServiceLevelObjective. - * @memberof google.monitoring.v3 - * @interface IServiceLevelObjective - * @property {string|null} [name] ServiceLevelObjective name - * @property {string|null} [displayName] ServiceLevelObjective displayName - * @property {google.monitoring.v3.IServiceLevelIndicator|null} [serviceLevelIndicator] ServiceLevelObjective serviceLevelIndicator - * @property {number|null} [goal] ServiceLevelObjective goal - * @property {google.protobuf.IDuration|null} [rollingPeriod] ServiceLevelObjective rollingPeriod - * @property {google.type.CalendarPeriod|null} [calendarPeriod] ServiceLevelObjective calendarPeriod - */ - - /** - * Constructs a new ServiceLevelObjective. + * Constructs a new RequestBasedSli. * @memberof google.monitoring.v3 - * @classdesc Represents a ServiceLevelObjective. - * @implements IServiceLevelObjective + * @classdesc Represents a RequestBasedSli. + * @implements IRequestBasedSli * @constructor - * @param {google.monitoring.v3.IServiceLevelObjective=} [properties] Properties to set + * @param {google.monitoring.v3.IRequestBasedSli=} [properties] Properties to set */ - function ServiceLevelObjective(properties) { + function RequestBasedSli(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20030,154 +18806,102 @@ } /** - * ServiceLevelObjective name. - * @member {string} name - * @memberof google.monitoring.v3.ServiceLevelObjective - * @instance - */ - ServiceLevelObjective.prototype.name = ""; - - /** - * ServiceLevelObjective displayName. - * @member {string} displayName - * @memberof google.monitoring.v3.ServiceLevelObjective - * @instance - */ - ServiceLevelObjective.prototype.displayName = ""; - - /** - * ServiceLevelObjective serviceLevelIndicator. - * @member {google.monitoring.v3.IServiceLevelIndicator|null|undefined} serviceLevelIndicator - * @memberof google.monitoring.v3.ServiceLevelObjective - * @instance - */ - ServiceLevelObjective.prototype.serviceLevelIndicator = null; - - /** - * ServiceLevelObjective goal. - * @member {number} goal - * @memberof google.monitoring.v3.ServiceLevelObjective - * @instance - */ - ServiceLevelObjective.prototype.goal = 0; - - /** - * ServiceLevelObjective rollingPeriod. - * @member {google.protobuf.IDuration|null|undefined} rollingPeriod - * @memberof google.monitoring.v3.ServiceLevelObjective + * RequestBasedSli goodTotalRatio. + * @member {google.monitoring.v3.ITimeSeriesRatio|null|undefined} goodTotalRatio + * @memberof google.monitoring.v3.RequestBasedSli * @instance */ - ServiceLevelObjective.prototype.rollingPeriod = null; + RequestBasedSli.prototype.goodTotalRatio = null; /** - * ServiceLevelObjective calendarPeriod. - * @member {google.type.CalendarPeriod} calendarPeriod - * @memberof google.monitoring.v3.ServiceLevelObjective + * RequestBasedSli distributionCut. + * @member {google.monitoring.v3.IDistributionCut|null|undefined} distributionCut + * @memberof google.monitoring.v3.RequestBasedSli * @instance */ - ServiceLevelObjective.prototype.calendarPeriod = 0; + RequestBasedSli.prototype.distributionCut = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * ServiceLevelObjective period. - * @member {"rollingPeriod"|"calendarPeriod"|undefined} period - * @memberof google.monitoring.v3.ServiceLevelObjective + * RequestBasedSli method. + * @member {"goodTotalRatio"|"distributionCut"|undefined} method + * @memberof google.monitoring.v3.RequestBasedSli * @instance */ - Object.defineProperty(ServiceLevelObjective.prototype, "period", { - get: $util.oneOfGetter($oneOfFields = ["rollingPeriod", "calendarPeriod"]), + Object.defineProperty(RequestBasedSli.prototype, "method", { + get: $util.oneOfGetter($oneOfFields = ["goodTotalRatio", "distributionCut"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new ServiceLevelObjective instance using the specified properties. + * Creates a new RequestBasedSli instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static - * @param {google.monitoring.v3.IServiceLevelObjective=} [properties] Properties to set - * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective instance + * @param {google.monitoring.v3.IRequestBasedSli=} [properties] Properties to set + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli instance */ - ServiceLevelObjective.create = function create(properties) { - return new ServiceLevelObjective(properties); + RequestBasedSli.create = function create(properties) { + return new RequestBasedSli(properties); }; /** - * Encodes the specified ServiceLevelObjective message. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * Encodes the specified RequestBasedSli message. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static - * @param {google.monitoring.v3.IServiceLevelObjective} message ServiceLevelObjective message or plain object to encode + * @param {google.monitoring.v3.IRequestBasedSli} message RequestBasedSli message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceLevelObjective.encode = function encode(message, writer) { + RequestBasedSli.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) - $root.google.monitoring.v3.ServiceLevelIndicator.encode(message.serviceLevelIndicator, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.goal != null && message.hasOwnProperty("goal")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.goal); - if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) - $root.google.protobuf.Duration.encode(message.rollingPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.calendarPeriod); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName); + if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) + $root.google.monitoring.v3.TimeSeriesRatio.encode(message.goodTotalRatio, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) + $root.google.monitoring.v3.DistributionCut.encode(message.distributionCut, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ServiceLevelObjective message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelObjective.verify|verify} messages. + * Encodes the specified RequestBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static - * @param {google.monitoring.v3.IServiceLevelObjective} message ServiceLevelObjective message or plain object to encode + * @param {google.monitoring.v3.IRequestBasedSli} message RequestBasedSli message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceLevelObjective.encodeDelimited = function encodeDelimited(message, writer) { + RequestBasedSli.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceLevelObjective message from the specified reader or buffer. + * Decodes a RequestBasedSli message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceLevelObjective.decode = function decode(reader, length) { + RequestBasedSli.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ServiceLevelObjective(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.RequestBasedSli(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 11: - message.displayName = reader.string(); + message.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.decode(reader, reader.uint32()); break; case 3: - message.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.decode(reader, reader.uint32()); - break; - case 4: - message.goal = reader.double(); - break; - case 5: - message.rollingPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 6: - message.calendarPeriod = reader.int32(); + message.distributionCut = $root.google.monitoring.v3.DistributionCut.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20188,231 +18912,139 @@ }; /** - * Decodes a ServiceLevelObjective message from the specified reader or buffer, length delimited. + * Decodes a RequestBasedSli message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceLevelObjective.decodeDelimited = function decodeDelimited(reader) { + RequestBasedSli.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceLevelObjective message. + * Verifies a RequestBasedSli message. * @function verify - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServiceLevelObjective.verify = function verify(message) { + RequestBasedSli.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) { - var error = $root.google.monitoring.v3.ServiceLevelIndicator.verify(message.serviceLevelIndicator); - if (error) - return "serviceLevelIndicator." + error; - } - if (message.goal != null && message.hasOwnProperty("goal")) - if (typeof message.goal !== "number") - return "goal: number expected"; - if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) { - properties.period = 1; + if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) { + properties.method = 1; { - var error = $root.google.protobuf.Duration.verify(message.rollingPeriod); + var error = $root.google.monitoring.v3.TimeSeriesRatio.verify(message.goodTotalRatio); if (error) - return "rollingPeriod." + error; + return "goodTotalRatio." + error; } } - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { - if (properties.period === 1) - return "period: multiple values"; - properties.period = 1; - switch (message.calendarPeriod) { - default: - return "calendarPeriod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; + if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) { + if (properties.method === 1) + return "method: multiple values"; + properties.method = 1; + { + var error = $root.google.monitoring.v3.DistributionCut.verify(message.distributionCut); + if (error) + return "distributionCut." + error; } } return null; }; /** - * Creates a ServiceLevelObjective message from a plain object. Also converts values to their respective internal types. + * Creates a RequestBasedSli message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ServiceLevelObjective} ServiceLevelObjective + * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli */ - ServiceLevelObjective.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ServiceLevelObjective) + RequestBasedSli.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.RequestBasedSli) return object; - var message = new $root.google.monitoring.v3.ServiceLevelObjective(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.serviceLevelIndicator != null) { - if (typeof object.serviceLevelIndicator !== "object") - throw TypeError(".google.monitoring.v3.ServiceLevelObjective.serviceLevelIndicator: object expected"); - message.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.fromObject(object.serviceLevelIndicator); - } - if (object.goal != null) - message.goal = Number(object.goal); - if (object.rollingPeriod != null) { - if (typeof object.rollingPeriod !== "object") - throw TypeError(".google.monitoring.v3.ServiceLevelObjective.rollingPeriod: object expected"); - message.rollingPeriod = $root.google.protobuf.Duration.fromObject(object.rollingPeriod); + var message = new $root.google.monitoring.v3.RequestBasedSli(); + if (object.goodTotalRatio != null) { + if (typeof object.goodTotalRatio !== "object") + throw TypeError(".google.monitoring.v3.RequestBasedSli.goodTotalRatio: object expected"); + message.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.fromObject(object.goodTotalRatio); } - switch (object.calendarPeriod) { - case "CALENDAR_PERIOD_UNSPECIFIED": - case 0: - message.calendarPeriod = 0; - break; - case "DAY": - case 1: - message.calendarPeriod = 1; - break; - case "WEEK": - case 2: - message.calendarPeriod = 2; - break; - case "FORTNIGHT": - case 3: - message.calendarPeriod = 3; - break; - case "MONTH": - case 4: - message.calendarPeriod = 4; - break; - case "QUARTER": - case 5: - message.calendarPeriod = 5; - break; - case "HALF": - case 6: - message.calendarPeriod = 6; - break; - case "YEAR": - case 7: - message.calendarPeriod = 7; - break; + if (object.distributionCut != null) { + if (typeof object.distributionCut !== "object") + throw TypeError(".google.monitoring.v3.RequestBasedSli.distributionCut: object expected"); + message.distributionCut = $root.google.monitoring.v3.DistributionCut.fromObject(object.distributionCut); } return message; }; /** - * Creates a plain object from a ServiceLevelObjective message. Also converts values to other types if specified. + * Creates a plain object from a RequestBasedSli message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @static - * @param {google.monitoring.v3.ServiceLevelObjective} message ServiceLevelObjective + * @param {google.monitoring.v3.RequestBasedSli} message RequestBasedSli * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceLevelObjective.toObject = function toObject(message, options) { + RequestBasedSli.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.serviceLevelIndicator = null; - object.goal = 0; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.serviceLevelIndicator != null && message.hasOwnProperty("serviceLevelIndicator")) - object.serviceLevelIndicator = $root.google.monitoring.v3.ServiceLevelIndicator.toObject(message.serviceLevelIndicator, options); - if (message.goal != null && message.hasOwnProperty("goal")) - object.goal = options.json && !isFinite(message.goal) ? String(message.goal) : message.goal; - if (message.rollingPeriod != null && message.hasOwnProperty("rollingPeriod")) { - object.rollingPeriod = $root.google.protobuf.Duration.toObject(message.rollingPeriod, options); + if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) { + object.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.toObject(message.goodTotalRatio, options); if (options.oneofs) - object.period = "rollingPeriod"; + object.method = "goodTotalRatio"; } - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { - object.calendarPeriod = options.enums === String ? $root.google.type.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; + if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) { + object.distributionCut = $root.google.monitoring.v3.DistributionCut.toObject(message.distributionCut, options); if (options.oneofs) - object.period = "calendarPeriod"; + object.method = "distributionCut"; } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; return object; }; /** - * Converts this ServiceLevelObjective to JSON. + * Converts this RequestBasedSli to JSON. * @function toJSON - * @memberof google.monitoring.v3.ServiceLevelObjective + * @memberof google.monitoring.v3.RequestBasedSli * @instance * @returns {Object.} JSON object */ - ServiceLevelObjective.prototype.toJSON = function toJSON() { + RequestBasedSli.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * View enum. - * @name google.monitoring.v3.ServiceLevelObjective.View - * @enum {string} - * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value - * @property {number} FULL=2 FULL value - * @property {number} EXPLICIT=1 EXPLICIT value - */ - ServiceLevelObjective.View = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; - values[valuesById[2] = "FULL"] = 2; - values[valuesById[1] = "EXPLICIT"] = 1; - return values; - })(); - - return ServiceLevelObjective; + return RequestBasedSli; })(); - v3.ServiceLevelIndicator = (function() { + v3.TimeSeriesRatio = (function() { /** - * Properties of a ServiceLevelIndicator. + * Properties of a TimeSeriesRatio. * @memberof google.monitoring.v3 - * @interface IServiceLevelIndicator - * @property {google.monitoring.v3.IBasicSli|null} [basicSli] ServiceLevelIndicator basicSli - * @property {google.monitoring.v3.IRequestBasedSli|null} [requestBased] ServiceLevelIndicator requestBased - * @property {google.monitoring.v3.IWindowsBasedSli|null} [windowsBased] ServiceLevelIndicator windowsBased + * @interface ITimeSeriesRatio + * @property {string|null} [goodServiceFilter] TimeSeriesRatio goodServiceFilter + * @property {string|null} [badServiceFilter] TimeSeriesRatio badServiceFilter + * @property {string|null} [totalServiceFilter] TimeSeriesRatio totalServiceFilter */ /** - * Constructs a new ServiceLevelIndicator. + * Constructs a new TimeSeriesRatio. * @memberof google.monitoring.v3 - * @classdesc Represents a ServiceLevelIndicator. - * @implements IServiceLevelIndicator + * @classdesc Represents a TimeSeriesRatio. + * @implements ITimeSeriesRatio * @constructor - * @param {google.monitoring.v3.IServiceLevelIndicator=} [properties] Properties to set + * @param {google.monitoring.v3.ITimeSeriesRatio=} [properties] Properties to set */ - function ServiceLevelIndicator(properties) { + function TimeSeriesRatio(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20420,115 +19052,101 @@ } /** - * ServiceLevelIndicator basicSli. - * @member {google.monitoring.v3.IBasicSli|null|undefined} basicSli - * @memberof google.monitoring.v3.ServiceLevelIndicator - * @instance - */ - ServiceLevelIndicator.prototype.basicSli = null; - - /** - * ServiceLevelIndicator requestBased. - * @member {google.monitoring.v3.IRequestBasedSli|null|undefined} requestBased - * @memberof google.monitoring.v3.ServiceLevelIndicator + * TimeSeriesRatio goodServiceFilter. + * @member {string} goodServiceFilter + * @memberof google.monitoring.v3.TimeSeriesRatio * @instance */ - ServiceLevelIndicator.prototype.requestBased = null; + TimeSeriesRatio.prototype.goodServiceFilter = ""; /** - * ServiceLevelIndicator windowsBased. - * @member {google.monitoring.v3.IWindowsBasedSli|null|undefined} windowsBased - * @memberof google.monitoring.v3.ServiceLevelIndicator + * TimeSeriesRatio badServiceFilter. + * @member {string} badServiceFilter + * @memberof google.monitoring.v3.TimeSeriesRatio * @instance */ - ServiceLevelIndicator.prototype.windowsBased = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + TimeSeriesRatio.prototype.badServiceFilter = ""; /** - * ServiceLevelIndicator type. - * @member {"basicSli"|"requestBased"|"windowsBased"|undefined} type - * @memberof google.monitoring.v3.ServiceLevelIndicator + * TimeSeriesRatio totalServiceFilter. + * @member {string} totalServiceFilter + * @memberof google.monitoring.v3.TimeSeriesRatio * @instance */ - Object.defineProperty(ServiceLevelIndicator.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["basicSli", "requestBased", "windowsBased"]), - set: $util.oneOfSetter($oneOfFields) - }); + TimeSeriesRatio.prototype.totalServiceFilter = ""; /** - * Creates a new ServiceLevelIndicator instance using the specified properties. + * Creates a new TimeSeriesRatio instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static - * @param {google.monitoring.v3.IServiceLevelIndicator=} [properties] Properties to set - * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator instance + * @param {google.monitoring.v3.ITimeSeriesRatio=} [properties] Properties to set + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio instance */ - ServiceLevelIndicator.create = function create(properties) { - return new ServiceLevelIndicator(properties); + TimeSeriesRatio.create = function create(properties) { + return new TimeSeriesRatio(properties); }; /** - * Encodes the specified ServiceLevelIndicator message. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * Encodes the specified TimeSeriesRatio message. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static - * @param {google.monitoring.v3.IServiceLevelIndicator} message ServiceLevelIndicator message or plain object to encode + * @param {google.monitoring.v3.ITimeSeriesRatio} message TimeSeriesRatio message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceLevelIndicator.encode = function encode(message, writer) { + TimeSeriesRatio.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.requestBased != null && message.hasOwnProperty("requestBased")) - $root.google.monitoring.v3.RequestBasedSli.encode(message.requestBased, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) - $root.google.monitoring.v3.WindowsBasedSli.encode(message.windowsBased, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.basicSli != null && message.hasOwnProperty("basicSli")) - $root.google.monitoring.v3.BasicSli.encode(message.basicSli, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.goodServiceFilter); + if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.badServiceFilter); + if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.totalServiceFilter); return writer; }; /** - * Encodes the specified ServiceLevelIndicator message, length delimited. Does not implicitly {@link google.monitoring.v3.ServiceLevelIndicator.verify|verify} messages. + * Encodes the specified TimeSeriesRatio message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static - * @param {google.monitoring.v3.IServiceLevelIndicator} message ServiceLevelIndicator message or plain object to encode + * @param {google.monitoring.v3.ITimeSeriesRatio} message TimeSeriesRatio message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceLevelIndicator.encodeDelimited = function encodeDelimited(message, writer) { + TimeSeriesRatio.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceLevelIndicator message from the specified reader or buffer. + * Decodes a TimeSeriesRatio message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceLevelIndicator.decode = function decode(reader, length) { + TimeSeriesRatio.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ServiceLevelIndicator(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeSeriesRatio(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 4: - message.basicSli = $root.google.monitoring.v3.BasicSli.decode(reader, reader.uint32()); + message.goodServiceFilter = reader.string(); break; - case 1: - message.requestBased = $root.google.monitoring.v3.RequestBasedSli.decode(reader, reader.uint32()); + case 5: + message.badServiceFilter = reader.string(); break; - case 2: - message.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.decode(reader, reader.uint32()); + case 6: + message.totalServiceFilter = reader.string(); break; default: reader.skipType(tag & 7); @@ -20539,164 +19157,125 @@ }; /** - * Decodes a ServiceLevelIndicator message from the specified reader or buffer, length delimited. + * Decodes a TimeSeriesRatio message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceLevelIndicator.decodeDelimited = function decodeDelimited(reader) { + TimeSeriesRatio.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceLevelIndicator message. + * Verifies a TimeSeriesRatio message. * @function verify - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServiceLevelIndicator.verify = function verify(message) { + TimeSeriesRatio.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.basicSli != null && message.hasOwnProperty("basicSli")) { - properties.type = 1; - { - var error = $root.google.monitoring.v3.BasicSli.verify(message.basicSli); - if (error) - return "basicSli." + error; - } - } - if (message.requestBased != null && message.hasOwnProperty("requestBased")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.monitoring.v3.RequestBasedSli.verify(message.requestBased); - if (error) - return "requestBased." + error; - } - } - if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.monitoring.v3.WindowsBasedSli.verify(message.windowsBased); - if (error) - return "windowsBased." + error; - } - } + if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) + if (!$util.isString(message.goodServiceFilter)) + return "goodServiceFilter: string expected"; + if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) + if (!$util.isString(message.badServiceFilter)) + return "badServiceFilter: string expected"; + if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) + if (!$util.isString(message.totalServiceFilter)) + return "totalServiceFilter: string expected"; return null; }; /** - * Creates a ServiceLevelIndicator message from a plain object. Also converts values to their respective internal types. + * Creates a TimeSeriesRatio message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ServiceLevelIndicator} ServiceLevelIndicator + * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio */ - ServiceLevelIndicator.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ServiceLevelIndicator) + TimeSeriesRatio.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.TimeSeriesRatio) return object; - var message = new $root.google.monitoring.v3.ServiceLevelIndicator(); - if (object.basicSli != null) { - if (typeof object.basicSli !== "object") - throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.basicSli: object expected"); - message.basicSli = $root.google.monitoring.v3.BasicSli.fromObject(object.basicSli); - } - if (object.requestBased != null) { - if (typeof object.requestBased !== "object") - throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.requestBased: object expected"); - message.requestBased = $root.google.monitoring.v3.RequestBasedSli.fromObject(object.requestBased); - } - if (object.windowsBased != null) { - if (typeof object.windowsBased !== "object") - throw TypeError(".google.monitoring.v3.ServiceLevelIndicator.windowsBased: object expected"); - message.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.fromObject(object.windowsBased); - } + var message = new $root.google.monitoring.v3.TimeSeriesRatio(); + if (object.goodServiceFilter != null) + message.goodServiceFilter = String(object.goodServiceFilter); + if (object.badServiceFilter != null) + message.badServiceFilter = String(object.badServiceFilter); + if (object.totalServiceFilter != null) + message.totalServiceFilter = String(object.totalServiceFilter); return message; }; /** - * Creates a plain object from a ServiceLevelIndicator message. Also converts values to other types if specified. + * Creates a plain object from a TimeSeriesRatio message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @static - * @param {google.monitoring.v3.ServiceLevelIndicator} message ServiceLevelIndicator + * @param {google.monitoring.v3.TimeSeriesRatio} message TimeSeriesRatio * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceLevelIndicator.toObject = function toObject(message, options) { + TimeSeriesRatio.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.requestBased != null && message.hasOwnProperty("requestBased")) { - object.requestBased = $root.google.monitoring.v3.RequestBasedSli.toObject(message.requestBased, options); - if (options.oneofs) - object.type = "requestBased"; - } - if (message.windowsBased != null && message.hasOwnProperty("windowsBased")) { - object.windowsBased = $root.google.monitoring.v3.WindowsBasedSli.toObject(message.windowsBased, options); - if (options.oneofs) - object.type = "windowsBased"; - } - if (message.basicSli != null && message.hasOwnProperty("basicSli")) { - object.basicSli = $root.google.monitoring.v3.BasicSli.toObject(message.basicSli, options); - if (options.oneofs) - object.type = "basicSli"; + if (options.defaults) { + object.goodServiceFilter = ""; + object.badServiceFilter = ""; + object.totalServiceFilter = ""; } + if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) + object.goodServiceFilter = message.goodServiceFilter; + if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) + object.badServiceFilter = message.badServiceFilter; + if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) + object.totalServiceFilter = message.totalServiceFilter; return object; }; /** - * Converts this ServiceLevelIndicator to JSON. + * Converts this TimeSeriesRatio to JSON. * @function toJSON - * @memberof google.monitoring.v3.ServiceLevelIndicator + * @memberof google.monitoring.v3.TimeSeriesRatio * @instance * @returns {Object.} JSON object */ - ServiceLevelIndicator.prototype.toJSON = function toJSON() { + TimeSeriesRatio.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ServiceLevelIndicator; + return TimeSeriesRatio; })(); - v3.BasicSli = (function() { + v3.DistributionCut = (function() { /** - * Properties of a BasicSli. + * Properties of a DistributionCut. * @memberof google.monitoring.v3 - * @interface IBasicSli - * @property {Array.|null} [method] BasicSli method - * @property {Array.|null} [location] BasicSli location - * @property {Array.|null} [version] BasicSli version - * @property {google.monitoring.v3.BasicSli.IAvailabilityCriteria|null} [availability] BasicSli availability - * @property {google.monitoring.v3.BasicSli.ILatencyCriteria|null} [latency] BasicSli latency + * @interface IDistributionCut + * @property {string|null} [distributionFilter] DistributionCut distributionFilter + * @property {google.monitoring.v3.IRange|null} [range] DistributionCut range */ /** - * Constructs a new BasicSli. + * Constructs a new DistributionCut. * @memberof google.monitoring.v3 - * @classdesc Represents a BasicSli. - * @implements IBasicSli + * @classdesc Represents a DistributionCut. + * @implements IDistributionCut * @constructor - * @param {google.monitoring.v3.IBasicSli=} [properties] Properties to set + * @param {google.monitoring.v3.IDistributionCut=} [properties] Properties to set */ - function BasicSli(properties) { - this.method = []; - this.location = []; - this.version = []; + function DistributionCut(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20704,150 +19283,359 @@ } /** - * BasicSli method. - * @member {Array.} method - * @memberof google.monitoring.v3.BasicSli + * DistributionCut distributionFilter. + * @member {string} distributionFilter + * @memberof google.monitoring.v3.DistributionCut * @instance */ - BasicSli.prototype.method = $util.emptyArray; + DistributionCut.prototype.distributionFilter = ""; /** - * BasicSli location. - * @member {Array.} location - * @memberof google.monitoring.v3.BasicSli + * DistributionCut range. + * @member {google.monitoring.v3.IRange|null|undefined} range + * @memberof google.monitoring.v3.DistributionCut * @instance */ - BasicSli.prototype.location = $util.emptyArray; + DistributionCut.prototype.range = null; /** - * BasicSli version. - * @member {Array.} version - * @memberof google.monitoring.v3.BasicSli - * @instance + * Creates a new DistributionCut instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.IDistributionCut=} [properties] Properties to set + * @returns {google.monitoring.v3.DistributionCut} DistributionCut instance */ - BasicSli.prototype.version = $util.emptyArray; + DistributionCut.create = function create(properties) { + return new DistributionCut(properties); + }; /** - * BasicSli availability. - * @member {google.monitoring.v3.BasicSli.IAvailabilityCriteria|null|undefined} availability - * @memberof google.monitoring.v3.BasicSli + * Encodes the specified DistributionCut message. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.IDistributionCut} message DistributionCut message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionCut.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.distributionFilter); + if (message.range != null && message.hasOwnProperty("range")) + $root.google.monitoring.v3.Range.encode(message.range, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DistributionCut message, length delimited. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.IDistributionCut} message DistributionCut message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionCut.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DistributionCut message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionCut.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DistributionCut(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.distributionFilter = reader.string(); + break; + case 5: + message.range = $root.google.monitoring.v3.Range.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DistributionCut message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionCut.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DistributionCut message. + * @function verify + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DistributionCut.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) + if (!$util.isString(message.distributionFilter)) + return "distributionFilter: string expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.monitoring.v3.Range.verify(message.range); + if (error) + return "range." + error; + } + return null; + }; + + /** + * Creates a DistributionCut message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.DistributionCut} DistributionCut + */ + DistributionCut.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DistributionCut) + return object; + var message = new $root.google.monitoring.v3.DistributionCut(); + if (object.distributionFilter != null) + message.distributionFilter = String(object.distributionFilter); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.monitoring.v3.DistributionCut.range: object expected"); + message.range = $root.google.monitoring.v3.Range.fromObject(object.range); + } + return message; + }; + + /** + * Creates a plain object from a DistributionCut message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.DistributionCut + * @static + * @param {google.monitoring.v3.DistributionCut} message DistributionCut + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DistributionCut.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.distributionFilter = ""; + object.range = null; + } + if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) + object.distributionFilter = message.distributionFilter; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.monitoring.v3.Range.toObject(message.range, options); + return object; + }; + + /** + * Converts this DistributionCut to JSON. + * @function toJSON + * @memberof google.monitoring.v3.DistributionCut * @instance + * @returns {Object.} JSON object */ - BasicSli.prototype.availability = null; + DistributionCut.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DistributionCut; + })(); + + v3.WindowsBasedSli = (function() { /** - * BasicSli latency. - * @member {google.monitoring.v3.BasicSli.ILatencyCriteria|null|undefined} latency - * @memberof google.monitoring.v3.BasicSli + * Properties of a WindowsBasedSli. + * @memberof google.monitoring.v3 + * @interface IWindowsBasedSli + * @property {string|null} [goodBadMetricFilter] WindowsBasedSli goodBadMetricFilter + * @property {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null} [goodTotalRatioThreshold] WindowsBasedSli goodTotalRatioThreshold + * @property {google.monitoring.v3.WindowsBasedSli.IMetricRange|null} [metricMeanInRange] WindowsBasedSli metricMeanInRange + * @property {google.monitoring.v3.WindowsBasedSli.IMetricRange|null} [metricSumInRange] WindowsBasedSli metricSumInRange + * @property {google.protobuf.IDuration|null} [windowPeriod] WindowsBasedSli windowPeriod + */ + + /** + * Constructs a new WindowsBasedSli. + * @memberof google.monitoring.v3 + * @classdesc Represents a WindowsBasedSli. + * @implements IWindowsBasedSli + * @constructor + * @param {google.monitoring.v3.IWindowsBasedSli=} [properties] Properties to set + */ + function WindowsBasedSli(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowsBasedSli goodBadMetricFilter. + * @member {string} goodBadMetricFilter + * @memberof google.monitoring.v3.WindowsBasedSli * @instance */ - BasicSli.prototype.latency = null; + WindowsBasedSli.prototype.goodBadMetricFilter = ""; + + /** + * WindowsBasedSli goodTotalRatioThreshold. + * @member {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null|undefined} goodTotalRatioThreshold + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.goodTotalRatioThreshold = null; + + /** + * WindowsBasedSli metricMeanInRange. + * @member {google.monitoring.v3.WindowsBasedSli.IMetricRange|null|undefined} metricMeanInRange + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.metricMeanInRange = null; + + /** + * WindowsBasedSli metricSumInRange. + * @member {google.monitoring.v3.WindowsBasedSli.IMetricRange|null|undefined} metricSumInRange + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.metricSumInRange = null; + + /** + * WindowsBasedSli windowPeriod. + * @member {google.protobuf.IDuration|null|undefined} windowPeriod + * @memberof google.monitoring.v3.WindowsBasedSli + * @instance + */ + WindowsBasedSli.prototype.windowPeriod = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * BasicSli sliCriteria. - * @member {"availability"|"latency"|undefined} sliCriteria - * @memberof google.monitoring.v3.BasicSli + * WindowsBasedSli windowCriterion. + * @member {"goodBadMetricFilter"|"goodTotalRatioThreshold"|"metricMeanInRange"|"metricSumInRange"|undefined} windowCriterion + * @memberof google.monitoring.v3.WindowsBasedSli * @instance */ - Object.defineProperty(BasicSli.prototype, "sliCriteria", { - get: $util.oneOfGetter($oneOfFields = ["availability", "latency"]), + Object.defineProperty(WindowsBasedSli.prototype, "windowCriterion", { + get: $util.oneOfGetter($oneOfFields = ["goodBadMetricFilter", "goodTotalRatioThreshold", "metricMeanInRange", "metricSumInRange"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new BasicSli instance using the specified properties. + * Creates a new WindowsBasedSli instance using the specified properties. * @function create - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static - * @param {google.monitoring.v3.IBasicSli=} [properties] Properties to set - * @returns {google.monitoring.v3.BasicSli} BasicSli instance + * @param {google.monitoring.v3.IWindowsBasedSli=} [properties] Properties to set + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli instance */ - BasicSli.create = function create(properties) { - return new BasicSli(properties); + WindowsBasedSli.create = function create(properties) { + return new WindowsBasedSli(properties); }; /** - * Encodes the specified BasicSli message. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * Encodes the specified WindowsBasedSli message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static - * @param {google.monitoring.v3.IBasicSli} message BasicSli message or plain object to encode + * @param {google.monitoring.v3.IWindowsBasedSli} message WindowsBasedSli message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BasicSli.encode = function encode(message, writer) { + WindowsBasedSli.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.availability != null && message.hasOwnProperty("availability")) - $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.encode(message.availability, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.latency != null && message.hasOwnProperty("latency")) - $root.google.monitoring.v3.BasicSli.LatencyCriteria.encode(message.latency, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.method[i]); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.location[i]); - if (message.version != null && message.version.length) - for (var i = 0; i < message.version.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.version[i]); + if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) + $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.encode(message.goodTotalRatioThreshold, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) + $root.google.protobuf.Duration.encode(message.windowPeriod, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.goodBadMetricFilter); + if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) + $root.google.monitoring.v3.WindowsBasedSli.MetricRange.encode(message.metricMeanInRange, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) + $root.google.monitoring.v3.WindowsBasedSli.MetricRange.encode(message.metricSumInRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified BasicSli message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.verify|verify} messages. + * Encodes the specified WindowsBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static - * @param {google.monitoring.v3.IBasicSli} message BasicSli message or plain object to encode + * @param {google.monitoring.v3.IWindowsBasedSli} message WindowsBasedSli message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BasicSli.encodeDelimited = function encodeDelimited(message, writer) { + WindowsBasedSli.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BasicSli message from the specified reader or buffer. + * Decodes a WindowsBasedSli message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.BasicSli} BasicSli + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BasicSli.decode = function decode(reader, length) { + WindowsBasedSli.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 7: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push(reader.string()); + case 5: + message.goodBadMetricFilter = reader.string(); break; - case 8: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push(reader.string()); + case 2: + message.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.decode(reader, reader.uint32()); break; - case 9: - if (!(message.version && message.version.length)) - message.version = []; - message.version.push(reader.string()); + case 6: + message.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.decode(reader, reader.uint32()); break; - case 2: - message.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.decode(reader, reader.uint32()); + case 7: + message.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.decode(reader, reader.uint32()); break; - case 3: - message.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.decode(reader, reader.uint32()); + case 4: + message.windowPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20858,195 +19646,184 @@ }; /** - * Decodes a BasicSli message from the specified reader or buffer, length delimited. + * Decodes a WindowsBasedSli message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.BasicSli} BasicSli + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BasicSli.decodeDelimited = function decodeDelimited(reader) { + WindowsBasedSli.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BasicSli message. + * Verifies a WindowsBasedSli message. * @function verify - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BasicSli.verify = function verify(message) { + WindowsBasedSli.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) - if (!$util.isString(message.method[i])) - return "method: string[] expected"; - } - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) - if (!$util.isString(message.location[i])) - return "location: string[] expected"; + if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) { + properties.windowCriterion = 1; + if (!$util.isString(message.goodBadMetricFilter)) + return "goodBadMetricFilter: string expected"; } - if (message.version != null && message.hasOwnProperty("version")) { - if (!Array.isArray(message.version)) - return "version: array expected"; - for (var i = 0; i < message.version.length; ++i) - if (!$util.isString(message.version[i])) - return "version: string[] expected"; + if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) { + if (properties.windowCriterion === 1) + return "windowCriterion: multiple values"; + properties.windowCriterion = 1; + { + var error = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify(message.goodTotalRatioThreshold); + if (error) + return "goodTotalRatioThreshold." + error; + } } - if (message.availability != null && message.hasOwnProperty("availability")) { - properties.sliCriteria = 1; + if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) { + if (properties.windowCriterion === 1) + return "windowCriterion: multiple values"; + properties.windowCriterion = 1; { - var error = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.verify(message.availability); + var error = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.verify(message.metricMeanInRange); if (error) - return "availability." + error; + return "metricMeanInRange." + error; } } - if (message.latency != null && message.hasOwnProperty("latency")) { - if (properties.sliCriteria === 1) - return "sliCriteria: multiple values"; - properties.sliCriteria = 1; + if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) { + if (properties.windowCriterion === 1) + return "windowCriterion: multiple values"; + properties.windowCriterion = 1; { - var error = $root.google.monitoring.v3.BasicSli.LatencyCriteria.verify(message.latency); + var error = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.verify(message.metricSumInRange); if (error) - return "latency." + error; + return "metricSumInRange." + error; } } + if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.windowPeriod); + if (error) + return "windowPeriod." + error; + } return null; }; /** - * Creates a BasicSli message from a plain object. Also converts values to their respective internal types. + * Creates a WindowsBasedSli message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.BasicSli} BasicSli + * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli */ - BasicSli.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.BasicSli) + WindowsBasedSli.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.WindowsBasedSli) return object; - var message = new $root.google.monitoring.v3.BasicSli(); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.monitoring.v3.BasicSli.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) - message.method[i] = String(object.method[i]); - } - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.monitoring.v3.BasicSli.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) - message.location[i] = String(object.location[i]); + var message = new $root.google.monitoring.v3.WindowsBasedSli(); + if (object.goodBadMetricFilter != null) + message.goodBadMetricFilter = String(object.goodBadMetricFilter); + if (object.goodTotalRatioThreshold != null) { + if (typeof object.goodTotalRatioThreshold !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.goodTotalRatioThreshold: object expected"); + message.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.fromObject(object.goodTotalRatioThreshold); } - if (object.version) { - if (!Array.isArray(object.version)) - throw TypeError(".google.monitoring.v3.BasicSli.version: array expected"); - message.version = []; - for (var i = 0; i < object.version.length; ++i) - message.version[i] = String(object.version[i]); + if (object.metricMeanInRange != null) { + if (typeof object.metricMeanInRange !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.metricMeanInRange: object expected"); + message.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.fromObject(object.metricMeanInRange); } - if (object.availability != null) { - if (typeof object.availability !== "object") - throw TypeError(".google.monitoring.v3.BasicSli.availability: object expected"); - message.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.fromObject(object.availability); + if (object.metricSumInRange != null) { + if (typeof object.metricSumInRange !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.metricSumInRange: object expected"); + message.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.fromObject(object.metricSumInRange); } - if (object.latency != null) { - if (typeof object.latency !== "object") - throw TypeError(".google.monitoring.v3.BasicSli.latency: object expected"); - message.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.fromObject(object.latency); + if (object.windowPeriod != null) { + if (typeof object.windowPeriod !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.windowPeriod: object expected"); + message.windowPeriod = $root.google.protobuf.Duration.fromObject(object.windowPeriod); } return message; }; /** - * Creates a plain object from a BasicSli message. Also converts values to other types if specified. + * Creates a plain object from a WindowsBasedSli message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @static - * @param {google.monitoring.v3.BasicSli} message BasicSli + * @param {google.monitoring.v3.WindowsBasedSli} message WindowsBasedSli * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BasicSli.toObject = function toObject(message, options) { + WindowsBasedSli.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.method = []; - object.location = []; - object.version = []; - } - if (message.availability != null && message.hasOwnProperty("availability")) { - object.availability = $root.google.monitoring.v3.BasicSli.AvailabilityCriteria.toObject(message.availability, options); + if (options.defaults) + object.windowPeriod = null; + if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) { + object.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.toObject(message.goodTotalRatioThreshold, options); if (options.oneofs) - object.sliCriteria = "availability"; + object.windowCriterion = "goodTotalRatioThreshold"; } - if (message.latency != null && message.hasOwnProperty("latency")) { - object.latency = $root.google.monitoring.v3.BasicSli.LatencyCriteria.toObject(message.latency, options); + if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) + object.windowPeriod = $root.google.protobuf.Duration.toObject(message.windowPeriod, options); + if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) { + object.goodBadMetricFilter = message.goodBadMetricFilter; if (options.oneofs) - object.sliCriteria = "latency"; - } - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = message.method[j]; + object.windowCriterion = "goodBadMetricFilter"; } - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = message.location[j]; + if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) { + object.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.toObject(message.metricMeanInRange, options); + if (options.oneofs) + object.windowCriterion = "metricMeanInRange"; } - if (message.version && message.version.length) { - object.version = []; - for (var j = 0; j < message.version.length; ++j) - object.version[j] = message.version[j]; + if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) { + object.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.toObject(message.metricSumInRange, options); + if (options.oneofs) + object.windowCriterion = "metricSumInRange"; } return object; }; /** - * Converts this BasicSli to JSON. + * Converts this WindowsBasedSli to JSON. * @function toJSON - * @memberof google.monitoring.v3.BasicSli + * @memberof google.monitoring.v3.WindowsBasedSli * @instance * @returns {Object.} JSON object */ - BasicSli.prototype.toJSON = function toJSON() { + WindowsBasedSli.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - BasicSli.AvailabilityCriteria = (function() { + WindowsBasedSli.PerformanceThreshold = (function() { /** - * Properties of an AvailabilityCriteria. - * @memberof google.monitoring.v3.BasicSli - * @interface IAvailabilityCriteria + * Properties of a PerformanceThreshold. + * @memberof google.monitoring.v3.WindowsBasedSli + * @interface IPerformanceThreshold + * @property {google.monitoring.v3.IRequestBasedSli|null} [performance] PerformanceThreshold performance + * @property {google.monitoring.v3.IBasicSli|null} [basicSliPerformance] PerformanceThreshold basicSliPerformance + * @property {number|null} [threshold] PerformanceThreshold threshold */ /** - * Constructs a new AvailabilityCriteria. - * @memberof google.monitoring.v3.BasicSli - * @classdesc Represents an AvailabilityCriteria. - * @implements IAvailabilityCriteria + * Constructs a new PerformanceThreshold. + * @memberof google.monitoring.v3.WindowsBasedSli + * @classdesc Represents a PerformanceThreshold. + * @implements IPerformanceThreshold * @constructor - * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria=} [properties] Properties to set + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold=} [properties] Properties to set */ - function AvailabilityCriteria(properties) { + function PerformanceThreshold(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21054,63 +19831,116 @@ } /** - * Creates a new AvailabilityCriteria instance using the specified properties. + * PerformanceThreshold performance. + * @member {google.monitoring.v3.IRequestBasedSli|null|undefined} performance + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + PerformanceThreshold.prototype.performance = null; + + /** + * PerformanceThreshold basicSliPerformance. + * @member {google.monitoring.v3.IBasicSli|null|undefined} basicSliPerformance + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + PerformanceThreshold.prototype.basicSliPerformance = null; + + /** + * PerformanceThreshold threshold. + * @member {number} threshold + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + PerformanceThreshold.prototype.threshold = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PerformanceThreshold type. + * @member {"performance"|"basicSliPerformance"|undefined} type + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold + * @instance + */ + Object.defineProperty(PerformanceThreshold.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["performance", "basicSliPerformance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PerformanceThreshold instance using the specified properties. * @function create - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static - * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria=} [properties] Properties to set - * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria instance + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold=} [properties] Properties to set + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold instance */ - AvailabilityCriteria.create = function create(properties) { - return new AvailabilityCriteria(properties); + PerformanceThreshold.create = function create(properties) { + return new PerformanceThreshold(properties); }; /** - * Encodes the specified AvailabilityCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * Encodes the specified PerformanceThreshold message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static - * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria} message AvailabilityCriteria message or plain object to encode + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold} message PerformanceThreshold message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailabilityCriteria.encode = function encode(message, writer) { + PerformanceThreshold.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.performance != null && message.hasOwnProperty("performance")) + $root.google.monitoring.v3.RequestBasedSli.encode(message.performance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.threshold != null && message.hasOwnProperty("threshold")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.threshold); + if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) + $root.google.monitoring.v3.BasicSli.encode(message.basicSliPerformance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AvailabilityCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.AvailabilityCriteria.verify|verify} messages. + * Encodes the specified PerformanceThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static - * @param {google.monitoring.v3.BasicSli.IAvailabilityCriteria} message AvailabilityCriteria message or plain object to encode + * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold} message PerformanceThreshold message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailabilityCriteria.encodeDelimited = function encodeDelimited(message, writer) { + PerformanceThreshold.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvailabilityCriteria message from the specified reader or buffer. + * Decodes a PerformanceThreshold message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvailabilityCriteria.decode = function decode(reader, length) { + PerformanceThreshold.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli.AvailabilityCriteria(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.performance = $root.google.monitoring.v3.RequestBasedSli.decode(reader, reader.uint32()); + break; + case 3: + message.basicSliPerformance = $root.google.monitoring.v3.BasicSli.decode(reader, reader.uint32()); + break; + case 2: + message.threshold = reader.double(); + break; default: reader.skipType(tag & 7); break; @@ -21120,94 +19950,147 @@ }; /** - * Decodes an AvailabilityCriteria message from the specified reader or buffer, length delimited. + * Decodes a PerformanceThreshold message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvailabilityCriteria.decodeDelimited = function decodeDelimited(reader) { + PerformanceThreshold.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvailabilityCriteria message. + * Verifies a PerformanceThreshold message. * @function verify - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AvailabilityCriteria.verify = function verify(message) { + PerformanceThreshold.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.performance != null && message.hasOwnProperty("performance")) { + properties.type = 1; + { + var error = $root.google.monitoring.v3.RequestBasedSli.verify(message.performance); + if (error) + return "performance." + error; + } + } + if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.monitoring.v3.BasicSli.verify(message.basicSliPerformance); + if (error) + return "basicSliPerformance." + error; + } + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (typeof message.threshold !== "number") + return "threshold: number expected"; return null; }; /** - * Creates an AvailabilityCriteria message from a plain object. Also converts values to their respective internal types. + * Creates a PerformanceThreshold message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.BasicSli.AvailabilityCriteria} AvailabilityCriteria + * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold */ - AvailabilityCriteria.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.BasicSli.AvailabilityCriteria) + PerformanceThreshold.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) return object; - return new $root.google.monitoring.v3.BasicSli.AvailabilityCriteria(); + var message = new $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); + if (object.performance != null) { + if (typeof object.performance !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.performance: object expected"); + message.performance = $root.google.monitoring.v3.RequestBasedSli.fromObject(object.performance); + } + if (object.basicSliPerformance != null) { + if (typeof object.basicSliPerformance !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.basicSliPerformance: object expected"); + message.basicSliPerformance = $root.google.monitoring.v3.BasicSli.fromObject(object.basicSliPerformance); + } + if (object.threshold != null) + message.threshold = Number(object.threshold); + return message; }; /** - * Creates a plain object from an AvailabilityCriteria message. Also converts values to other types if specified. + * Creates a plain object from a PerformanceThreshold message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @static - * @param {google.monitoring.v3.BasicSli.AvailabilityCriteria} message AvailabilityCriteria + * @param {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} message PerformanceThreshold * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvailabilityCriteria.toObject = function toObject() { - return {}; + PerformanceThreshold.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.threshold = 0; + if (message.performance != null && message.hasOwnProperty("performance")) { + object.performance = $root.google.monitoring.v3.RequestBasedSli.toObject(message.performance, options); + if (options.oneofs) + object.type = "performance"; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.json && !isFinite(message.threshold) ? String(message.threshold) : message.threshold; + if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) { + object.basicSliPerformance = $root.google.monitoring.v3.BasicSli.toObject(message.basicSliPerformance, options); + if (options.oneofs) + object.type = "basicSliPerformance"; + } + return object; }; /** - * Converts this AvailabilityCriteria to JSON. + * Converts this PerformanceThreshold to JSON. * @function toJSON - * @memberof google.monitoring.v3.BasicSli.AvailabilityCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold * @instance * @returns {Object.} JSON object */ - AvailabilityCriteria.prototype.toJSON = function toJSON() { + PerformanceThreshold.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AvailabilityCriteria; + return PerformanceThreshold; })(); - BasicSli.LatencyCriteria = (function() { + WindowsBasedSli.MetricRange = (function() { /** - * Properties of a LatencyCriteria. - * @memberof google.monitoring.v3.BasicSli - * @interface ILatencyCriteria - * @property {google.protobuf.IDuration|null} [threshold] LatencyCriteria threshold + * Properties of a MetricRange. + * @memberof google.monitoring.v3.WindowsBasedSli + * @interface IMetricRange + * @property {string|null} [timeSeries] MetricRange timeSeries + * @property {google.monitoring.v3.IRange|null} [range] MetricRange range */ /** - * Constructs a new LatencyCriteria. - * @memberof google.monitoring.v3.BasicSli - * @classdesc Represents a LatencyCriteria. - * @implements ILatencyCriteria + * Constructs a new MetricRange. + * @memberof google.monitoring.v3.WindowsBasedSli + * @classdesc Represents a MetricRange. + * @implements IMetricRange * @constructor - * @param {google.monitoring.v3.BasicSli.ILatencyCriteria=} [properties] Properties to set + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange=} [properties] Properties to set */ - function LatencyCriteria(properties) { + function MetricRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21215,75 +20098,88 @@ } /** - * LatencyCriteria threshold. - * @member {google.protobuf.IDuration|null|undefined} threshold - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * MetricRange timeSeries. + * @member {string} timeSeries + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @instance */ - LatencyCriteria.prototype.threshold = null; + MetricRange.prototype.timeSeries = ""; /** - * Creates a new LatencyCriteria instance using the specified properties. + * MetricRange range. + * @member {google.monitoring.v3.IRange|null|undefined} range + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange + * @instance + */ + MetricRange.prototype.range = null; + + /** + * Creates a new MetricRange instance using the specified properties. * @function create - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static - * @param {google.monitoring.v3.BasicSli.ILatencyCriteria=} [properties] Properties to set - * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria instance + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange=} [properties] Properties to set + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange instance */ - LatencyCriteria.create = function create(properties) { - return new LatencyCriteria(properties); + MetricRange.create = function create(properties) { + return new MetricRange(properties); }; /** - * Encodes the specified LatencyCriteria message. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * Encodes the specified MetricRange message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static - * @param {google.monitoring.v3.BasicSli.ILatencyCriteria} message LatencyCriteria message or plain object to encode + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange} message MetricRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LatencyCriteria.encode = function encode(message, writer) { + MetricRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.threshold != null && message.hasOwnProperty("threshold")) - $root.google.protobuf.Duration.encode(message.threshold, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeSeries); + if (message.range != null && message.hasOwnProperty("range")) + $root.google.monitoring.v3.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified LatencyCriteria message, length delimited. Does not implicitly {@link google.monitoring.v3.BasicSli.LatencyCriteria.verify|verify} messages. + * Encodes the specified MetricRange message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static - * @param {google.monitoring.v3.BasicSli.ILatencyCriteria} message LatencyCriteria message or plain object to encode + * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange} message MetricRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LatencyCriteria.encodeDelimited = function encodeDelimited(message, writer) { + MetricRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LatencyCriteria message from the specified reader or buffer. + * Decodes a MetricRange message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LatencyCriteria.decode = function decode(reader, length) { + MetricRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.BasicSli.LatencyCriteria(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli.MetricRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.threshold = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + case 1: + message.timeSeries = reader.string(); + break; + case 4: + message.range = $root.google.monitoring.v3.Range.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -21294,326 +20190,491 @@ }; /** - * Decodes a LatencyCriteria message from the specified reader or buffer, length delimited. + * Decodes a MetricRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LatencyCriteria.decodeDelimited = function decodeDelimited(reader) { + MetricRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LatencyCriteria message. + * Verifies a MetricRange message. * @function verify - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LatencyCriteria.verify = function verify(message) { + MetricRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.threshold != null && message.hasOwnProperty("threshold")) { - var error = $root.google.protobuf.Duration.verify(message.threshold); + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + if (!$util.isString(message.timeSeries)) + return "timeSeries: string expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.monitoring.v3.Range.verify(message.range); if (error) - return "threshold." + error; + return "range." + error; } return null; }; /** - * Creates a LatencyCriteria message from a plain object. Also converts values to their respective internal types. + * Creates a MetricRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.BasicSli.LatencyCriteria} LatencyCriteria + * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange */ - LatencyCriteria.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.BasicSli.LatencyCriteria) + MetricRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.WindowsBasedSli.MetricRange) return object; - var message = new $root.google.monitoring.v3.BasicSli.LatencyCriteria(); - if (object.threshold != null) { - if (typeof object.threshold !== "object") - throw TypeError(".google.monitoring.v3.BasicSli.LatencyCriteria.threshold: object expected"); - message.threshold = $root.google.protobuf.Duration.fromObject(object.threshold); + var message = new $root.google.monitoring.v3.WindowsBasedSli.MetricRange(); + if (object.timeSeries != null) + message.timeSeries = String(object.timeSeries); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.monitoring.v3.WindowsBasedSli.MetricRange.range: object expected"); + message.range = $root.google.monitoring.v3.Range.fromObject(object.range); } return message; }; /** - * Creates a plain object from a LatencyCriteria message. Also converts values to other types if specified. + * Creates a plain object from a MetricRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @static - * @param {google.monitoring.v3.BasicSli.LatencyCriteria} message LatencyCriteria + * @param {google.monitoring.v3.WindowsBasedSli.MetricRange} message MetricRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LatencyCriteria.toObject = function toObject(message, options) { + MetricRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.threshold = null; - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = $root.google.protobuf.Duration.toObject(message.threshold, options); + if (options.defaults) { + object.timeSeries = ""; + object.range = null; + } + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + object.timeSeries = message.timeSeries; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.monitoring.v3.Range.toObject(message.range, options); return object; }; /** - * Converts this LatencyCriteria to JSON. + * Converts this MetricRange to JSON. * @function toJSON - * @memberof google.monitoring.v3.BasicSli.LatencyCriteria + * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange * @instance * @returns {Object.} JSON object */ - LatencyCriteria.prototype.toJSON = function toJSON() { + MetricRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LatencyCriteria; + return MetricRange; })(); - return BasicSli; + return WindowsBasedSli; })(); - v3.Range = (function() { + v3.ServiceMonitoringService = (function() { /** - * Properties of a Range. + * Constructs a new ServiceMonitoringService service. * @memberof google.monitoring.v3 - * @interface IRange - * @property {number|null} [min] Range min - * @property {number|null} [max] Range max + * @classdesc Represents a ServiceMonitoringService + * @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 ServiceMonitoringService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ServiceMonitoringService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ServiceMonitoringService; /** - * Constructs a new Range. - * @memberof google.monitoring.v3 - * @classdesc Represents a Range. - * @implements IRange - * @constructor - * @param {google.monitoring.v3.IRange=} [properties] Properties to set + * Creates new ServiceMonitoringService service using the specified rpc implementation. + * @function create + * @memberof google.monitoring.v3.ServiceMonitoringService + * @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 {ServiceMonitoringService} RPC service. Useful where requests and/or responses are streamed. */ - function Range(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ServiceMonitoringService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * Range min. - * @member {number} min - * @memberof google.monitoring.v3.Range + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef CreateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Service} [response] Service + */ + + /** + * Calls CreateService. + * @function createService + * @memberof google.monitoring.v3.ServiceMonitoringService * @instance + * @param {google.monitoring.v3.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.CreateServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 */ - Range.prototype.min = 0; + Object.defineProperty(ServiceMonitoringService.prototype.createService = function createService(request, callback) { + return this.rpcCall(createService, $root.google.monitoring.v3.CreateServiceRequest, $root.google.monitoring.v3.Service, request, callback); + }, "name", { value: "CreateService" }); /** - * Range max. - * @member {number} max - * @memberof google.monitoring.v3.Range + * Calls CreateService. + * @function createService + * @memberof google.monitoring.v3.ServiceMonitoringService * @instance + * @param {google.monitoring.v3.ICreateServiceRequest} request CreateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Range.prototype.max = 0; /** - * Creates a new Range instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.Range - * @static - * @param {google.monitoring.v3.IRange=} [properties] Properties to set - * @returns {google.monitoring.v3.Range} Range instance + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef GetServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Service} [response] Service */ - Range.create = function create(properties) { - return new Range(properties); - }; /** - * Encodes the specified Range message. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.Range - * @static - * @param {google.monitoring.v3.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetService. + * @function getService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceRequest} request GetServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.GetServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 */ - Range.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min != null && message.hasOwnProperty("min")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); - if (message.max != null && message.hasOwnProperty("max")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); - return writer; - }; + Object.defineProperty(ServiceMonitoringService.prototype.getService = function getService(request, callback) { + return this.rpcCall(getService, $root.google.monitoring.v3.GetServiceRequest, $root.google.monitoring.v3.Service, request, callback); + }, "name", { value: "GetService" }); /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.monitoring.v3.Range.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.Range - * @static - * @param {google.monitoring.v3.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetService. + * @function getService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceRequest} request GetServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a Range message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServices}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef ListServicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListServicesResponse} [response] ListServicesResponse */ - Range.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.Range(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.min = reader.double(); - break; - case 2: - message.max = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a Range message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.Range - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.Range} Range - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListServices. + * @function listServices + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServicesRequest} request ListServicesRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.ListServicesCallback} callback Node-style callback called with the error, if any, and ListServicesResponse + * @returns {undefined} + * @variation 1 */ - Range.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ServiceMonitoringService.prototype.listServices = function listServices(request, callback) { + return this.rpcCall(listServices, $root.google.monitoring.v3.ListServicesRequest, $root.google.monitoring.v3.ListServicesResponse, request, callback); + }, "name", { value: "ListServices" }); /** - * Verifies a Range message. - * @function verify - * @memberof google.monitoring.v3.Range - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListServices. + * @function listServices + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServicesRequest} request ListServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Range.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.min != null && message.hasOwnProperty("min")) - if (typeof message.min !== "number") - return "min: number expected"; - if (message.max != null && message.hasOwnProperty("max")) - if (typeof message.max !== "number") - return "max: number expected"; - return null; - }; /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.Range - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.Range} Range + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef UpdateServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.Service} [response] Service */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.Range) - return object; - var message = new $root.google.monitoring.v3.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.monitoring.v3.Range - * @static - * @param {google.monitoring.v3.Range} message Range - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls UpdateService. + * @function updateService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.UpdateServiceCallback} callback Node-style callback called with the error, if any, and Service + * @returns {undefined} + * @variation 1 */ - Range.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.min = 0; - object.max = 0; - } - if (message.min != null && message.hasOwnProperty("min")) - object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (message.max != null && message.hasOwnProperty("max")) - object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; - return object; - }; + Object.defineProperty(ServiceMonitoringService.prototype.updateService = function updateService(request, callback) { + return this.rpcCall(updateService, $root.google.monitoring.v3.UpdateServiceRequest, $root.google.monitoring.v3.Service, request, callback); + }, "name", { value: "UpdateService" }); /** - * Converts this Range to JSON. - * @function toJSON - * @memberof google.monitoring.v3.Range + * Calls UpdateService. + * @function updateService + * @memberof google.monitoring.v3.ServiceMonitoringService * @instance - * @returns {Object.} JSON object + * @param {google.monitoring.v3.IUpdateServiceRequest} request UpdateServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Range.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return Range; + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteService}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef DeleteServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.DeleteServiceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.deleteService = function deleteService(request, callback) { + return this.rpcCall(deleteService, $root.google.monitoring.v3.DeleteServiceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteService" }); + + /** + * Calls DeleteService. + * @function deleteService + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceRequest} request DeleteServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#createServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef CreateServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + */ + + /** + * Calls CreateServiceLevelObjective. + * @function createServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} request CreateServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.CreateServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.createServiceLevelObjective = function createServiceLevelObjective(request, callback) { + return this.rpcCall(createServiceLevelObjective, $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); + }, "name", { value: "CreateServiceLevelObjective" }); + + /** + * Calls CreateServiceLevelObjective. + * @function createServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} request CreateServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#getServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef GetServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + */ + + /** + * Calls GetServiceLevelObjective. + * @function getServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} request GetServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.GetServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.getServiceLevelObjective = function getServiceLevelObjective(request, callback) { + return this.rpcCall(getServiceLevelObjective, $root.google.monitoring.v3.GetServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); + }, "name", { value: "GetServiceLevelObjective" }); + + /** + * Calls GetServiceLevelObjective. + * @function getServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} request GetServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#listServiceLevelObjectives}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef ListServiceLevelObjectivesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListServiceLevelObjectivesResponse} [response] ListServiceLevelObjectivesResponse + */ + + /** + * Calls ListServiceLevelObjectives. + * @function listServiceLevelObjectives + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} request ListServiceLevelObjectivesRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.ListServiceLevelObjectivesCallback} callback Node-style callback called with the error, if any, and ListServiceLevelObjectivesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.listServiceLevelObjectives = function listServiceLevelObjectives(request, callback) { + return this.rpcCall(listServiceLevelObjectives, $root.google.monitoring.v3.ListServiceLevelObjectivesRequest, $root.google.monitoring.v3.ListServiceLevelObjectivesResponse, request, callback); + }, "name", { value: "ListServiceLevelObjectives" }); + + /** + * Calls ListServiceLevelObjectives. + * @function listServiceLevelObjectives + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} request ListServiceLevelObjectivesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#updateServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef UpdateServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ServiceLevelObjective} [response] ServiceLevelObjective + */ + + /** + * Calls UpdateServiceLevelObjective. + * @function updateServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} request UpdateServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.UpdateServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and ServiceLevelObjective + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.updateServiceLevelObjective = function updateServiceLevelObjective(request, callback) { + return this.rpcCall(updateServiceLevelObjective, $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest, $root.google.monitoring.v3.ServiceLevelObjective, request, callback); + }, "name", { value: "UpdateServiceLevelObjective" }); + + /** + * Calls UpdateServiceLevelObjective. + * @function updateServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} request UpdateServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.monitoring.v3.ServiceMonitoringService#deleteServiceLevelObjective}. + * @memberof google.monitoring.v3.ServiceMonitoringService + * @typedef DeleteServiceLevelObjectiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteServiceLevelObjective. + * @function deleteServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} request DeleteServiceLevelObjectiveRequest message or plain object + * @param {google.monitoring.v3.ServiceMonitoringService.DeleteServiceLevelObjectiveCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ServiceMonitoringService.prototype.deleteServiceLevelObjective = function deleteServiceLevelObjective(request, callback) { + return this.rpcCall(deleteServiceLevelObjective, $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteServiceLevelObjective" }); + + /** + * Calls DeleteServiceLevelObjective. + * @function deleteServiceLevelObjective + * @memberof google.monitoring.v3.ServiceMonitoringService + * @instance + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} request DeleteServiceLevelObjectiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ServiceMonitoringService; })(); - v3.RequestBasedSli = (function() { + v3.CreateServiceRequest = (function() { /** - * Properties of a RequestBasedSli. + * Properties of a CreateServiceRequest. * @memberof google.monitoring.v3 - * @interface IRequestBasedSli - * @property {google.monitoring.v3.ITimeSeriesRatio|null} [goodTotalRatio] RequestBasedSli goodTotalRatio - * @property {google.monitoring.v3.IDistributionCut|null} [distributionCut] RequestBasedSli distributionCut + * @interface ICreateServiceRequest + * @property {string|null} [parent] CreateServiceRequest parent + * @property {string|null} [serviceId] CreateServiceRequest serviceId + * @property {google.monitoring.v3.IService|null} [service] CreateServiceRequest service */ /** - * Constructs a new RequestBasedSli. + * Constructs a new CreateServiceRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a RequestBasedSli. - * @implements IRequestBasedSli + * @classdesc Represents a CreateServiceRequest. + * @implements ICreateServiceRequest * @constructor - * @param {google.monitoring.v3.IRequestBasedSli=} [properties] Properties to set + * @param {google.monitoring.v3.ICreateServiceRequest=} [properties] Properties to set */ - function RequestBasedSli(properties) { + function CreateServiceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21621,102 +20682,101 @@ } /** - * RequestBasedSli goodTotalRatio. - * @member {google.monitoring.v3.ITimeSeriesRatio|null|undefined} goodTotalRatio - * @memberof google.monitoring.v3.RequestBasedSli + * CreateServiceRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.CreateServiceRequest * @instance */ - RequestBasedSli.prototype.goodTotalRatio = null; + CreateServiceRequest.prototype.parent = ""; /** - * RequestBasedSli distributionCut. - * @member {google.monitoring.v3.IDistributionCut|null|undefined} distributionCut - * @memberof google.monitoring.v3.RequestBasedSli + * CreateServiceRequest serviceId. + * @member {string} serviceId + * @memberof google.monitoring.v3.CreateServiceRequest * @instance */ - RequestBasedSli.prototype.distributionCut = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateServiceRequest.prototype.serviceId = ""; /** - * RequestBasedSli method. - * @member {"goodTotalRatio"|"distributionCut"|undefined} method - * @memberof google.monitoring.v3.RequestBasedSli + * CreateServiceRequest service. + * @member {google.monitoring.v3.IService|null|undefined} service + * @memberof google.monitoring.v3.CreateServiceRequest * @instance */ - Object.defineProperty(RequestBasedSli.prototype, "method", { - get: $util.oneOfGetter($oneOfFields = ["goodTotalRatio", "distributionCut"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateServiceRequest.prototype.service = null; /** - * Creates a new RequestBasedSli instance using the specified properties. + * Creates a new CreateServiceRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static - * @param {google.monitoring.v3.IRequestBasedSli=} [properties] Properties to set - * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli instance + * @param {google.monitoring.v3.ICreateServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest instance */ - RequestBasedSli.create = function create(properties) { - return new RequestBasedSli(properties); + CreateServiceRequest.create = function create(properties) { + return new CreateServiceRequest(properties); }; /** - * Encodes the specified RequestBasedSli message. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * Encodes the specified CreateServiceRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static - * @param {google.monitoring.v3.IRequestBasedSli} message RequestBasedSli message or plain object to encode + * @param {google.monitoring.v3.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RequestBasedSli.encode = function encode(message, writer) { + CreateServiceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) - $root.google.monitoring.v3.TimeSeriesRatio.encode(message.goodTotalRatio, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) - $root.google.monitoring.v3.DistributionCut.encode(message.distributionCut, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.service != null && message.hasOwnProperty("service")) + $root.google.monitoring.v3.Service.encode(message.service, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceId); return writer; }; /** - * Encodes the specified RequestBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.RequestBasedSli.verify|verify} messages. + * Encodes the specified CreateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static - * @param {google.monitoring.v3.IRequestBasedSli} message RequestBasedSli message or plain object to encode + * @param {google.monitoring.v3.ICreateServiceRequest} message CreateServiceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RequestBasedSli.encodeDelimited = function encodeDelimited(message, writer) { + CreateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RequestBasedSli message from the specified reader or buffer. + * Decodes a CreateServiceRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RequestBasedSli.decode = function decode(reader, length) { + CreateServiceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.RequestBasedSli(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateServiceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 3: - message.distributionCut = $root.google.monitoring.v3.DistributionCut.decode(reader, reader.uint32()); + message.serviceId = reader.string(); + break; + case 2: + message.service = $root.google.monitoring.v3.Service.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -21727,139 +20787,129 @@ }; /** - * Decodes a RequestBasedSli message from the specified reader or buffer, length delimited. + * Decodes a CreateServiceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RequestBasedSli.decodeDelimited = function decodeDelimited(reader) { + CreateServiceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RequestBasedSli message. + * Verifies a CreateServiceRequest message. * @function verify - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RequestBasedSli.verify = function verify(message) { + CreateServiceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) { - properties.method = 1; - { - var error = $root.google.monitoring.v3.TimeSeriesRatio.verify(message.goodTotalRatio); - if (error) - return "goodTotalRatio." + error; - } - } - if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) { - if (properties.method === 1) - return "method: multiple values"; - properties.method = 1; - { - var error = $root.google.monitoring.v3.DistributionCut.verify(message.distributionCut); - if (error) - return "distributionCut." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + if (!$util.isString(message.serviceId)) + return "serviceId: string expected"; + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.monitoring.v3.Service.verify(message.service); + if (error) + return "service." + error; } return null; }; /** - * Creates a RequestBasedSli message from a plain object. Also converts values to their respective internal types. + * Creates a CreateServiceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.RequestBasedSli} RequestBasedSli + * @returns {google.monitoring.v3.CreateServiceRequest} CreateServiceRequest */ - RequestBasedSli.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.RequestBasedSli) + CreateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateServiceRequest) return object; - var message = new $root.google.monitoring.v3.RequestBasedSli(); - if (object.goodTotalRatio != null) { - if (typeof object.goodTotalRatio !== "object") - throw TypeError(".google.monitoring.v3.RequestBasedSli.goodTotalRatio: object expected"); - message.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.fromObject(object.goodTotalRatio); - } - if (object.distributionCut != null) { - if (typeof object.distributionCut !== "object") - throw TypeError(".google.monitoring.v3.RequestBasedSli.distributionCut: object expected"); - message.distributionCut = $root.google.monitoring.v3.DistributionCut.fromObject(object.distributionCut); + var message = new $root.google.monitoring.v3.CreateServiceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.serviceId != null) + message.serviceId = String(object.serviceId); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.monitoring.v3.CreateServiceRequest.service: object expected"); + message.service = $root.google.monitoring.v3.Service.fromObject(object.service); } return message; }; /** - * Creates a plain object from a RequestBasedSli message. Also converts values to other types if specified. + * Creates a plain object from a CreateServiceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @static - * @param {google.monitoring.v3.RequestBasedSli} message RequestBasedSli + * @param {google.monitoring.v3.CreateServiceRequest} message CreateServiceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RequestBasedSli.toObject = function toObject(message, options) { + CreateServiceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.goodTotalRatio != null && message.hasOwnProperty("goodTotalRatio")) { - object.goodTotalRatio = $root.google.monitoring.v3.TimeSeriesRatio.toObject(message.goodTotalRatio, options); - if (options.oneofs) - object.method = "goodTotalRatio"; - } - if (message.distributionCut != null && message.hasOwnProperty("distributionCut")) { - object.distributionCut = $root.google.monitoring.v3.DistributionCut.toObject(message.distributionCut, options); - if (options.oneofs) - object.method = "distributionCut"; + if (options.defaults) { + object.parent = ""; + object.service = null; + object.serviceId = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.monitoring.v3.Service.toObject(message.service, options); + if (message.serviceId != null && message.hasOwnProperty("serviceId")) + object.serviceId = message.serviceId; return object; }; /** - * Converts this RequestBasedSli to JSON. + * Converts this CreateServiceRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.RequestBasedSli + * @memberof google.monitoring.v3.CreateServiceRequest * @instance * @returns {Object.} JSON object */ - RequestBasedSli.prototype.toJSON = function toJSON() { + CreateServiceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RequestBasedSli; + return CreateServiceRequest; })(); - v3.TimeSeriesRatio = (function() { + v3.GetServiceRequest = (function() { /** - * Properties of a TimeSeriesRatio. + * Properties of a GetServiceRequest. * @memberof google.monitoring.v3 - * @interface ITimeSeriesRatio - * @property {string|null} [goodServiceFilter] TimeSeriesRatio goodServiceFilter - * @property {string|null} [badServiceFilter] TimeSeriesRatio badServiceFilter - * @property {string|null} [totalServiceFilter] TimeSeriesRatio totalServiceFilter + * @interface IGetServiceRequest + * @property {string|null} [name] GetServiceRequest name */ /** - * Constructs a new TimeSeriesRatio. + * Constructs a new GetServiceRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a TimeSeriesRatio. - * @implements ITimeSeriesRatio + * @classdesc Represents a GetServiceRequest. + * @implements IGetServiceRequest * @constructor - * @param {google.monitoring.v3.ITimeSeriesRatio=} [properties] Properties to set + * @param {google.monitoring.v3.IGetServiceRequest=} [properties] Properties to set */ - function TimeSeriesRatio(properties) { + function GetServiceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21867,101 +20917,75 @@ } /** - * TimeSeriesRatio goodServiceFilter. - * @member {string} goodServiceFilter - * @memberof google.monitoring.v3.TimeSeriesRatio - * @instance - */ - TimeSeriesRatio.prototype.goodServiceFilter = ""; - - /** - * TimeSeriesRatio badServiceFilter. - * @member {string} badServiceFilter - * @memberof google.monitoring.v3.TimeSeriesRatio - * @instance - */ - TimeSeriesRatio.prototype.badServiceFilter = ""; - - /** - * TimeSeriesRatio totalServiceFilter. - * @member {string} totalServiceFilter - * @memberof google.monitoring.v3.TimeSeriesRatio + * GetServiceRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetServiceRequest * @instance */ - TimeSeriesRatio.prototype.totalServiceFilter = ""; + GetServiceRequest.prototype.name = ""; /** - * Creates a new TimeSeriesRatio instance using the specified properties. + * Creates a new GetServiceRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static - * @param {google.monitoring.v3.ITimeSeriesRatio=} [properties] Properties to set - * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio instance + * @param {google.monitoring.v3.IGetServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest instance */ - TimeSeriesRatio.create = function create(properties) { - return new TimeSeriesRatio(properties); + GetServiceRequest.create = function create(properties) { + return new GetServiceRequest(properties); }; /** - * Encodes the specified TimeSeriesRatio message. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * Encodes the specified GetServiceRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static - * @param {google.monitoring.v3.ITimeSeriesRatio} message TimeSeriesRatio message or plain object to encode + * @param {google.monitoring.v3.IGetServiceRequest} message GetServiceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeriesRatio.encode = function encode(message, writer) { + GetServiceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.goodServiceFilter); - if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.badServiceFilter); - if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.totalServiceFilter); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified TimeSeriesRatio message, length delimited. Does not implicitly {@link google.monitoring.v3.TimeSeriesRatio.verify|verify} messages. + * Encodes the specified GetServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static - * @param {google.monitoring.v3.ITimeSeriesRatio} message TimeSeriesRatio message or plain object to encode + * @param {google.monitoring.v3.IGetServiceRequest} message GetServiceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeriesRatio.encodeDelimited = function encodeDelimited(message, writer) { + GetServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeSeriesRatio message from the specified reader or buffer. + * Decodes a GetServiceRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeriesRatio.decode = function decode(reader, length) { + GetServiceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.TimeSeriesRatio(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetServiceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.goodServiceFilter = reader.string(); - break; - case 5: - message.badServiceFilter = reader.string(); - break; - case 6: - message.totalServiceFilter = reader.string(); + case 1: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -21972,125 +20996,110 @@ }; /** - * Decodes a TimeSeriesRatio message from the specified reader or buffer, length delimited. + * Decodes a GetServiceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeriesRatio.decodeDelimited = function decodeDelimited(reader) { + GetServiceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeSeriesRatio message. + * Verifies a GetServiceRequest message. * @function verify - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeSeriesRatio.verify = function verify(message) { + GetServiceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) - if (!$util.isString(message.goodServiceFilter)) - return "goodServiceFilter: string expected"; - if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) - if (!$util.isString(message.badServiceFilter)) - return "badServiceFilter: string expected"; - if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) - if (!$util.isString(message.totalServiceFilter)) - return "totalServiceFilter: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TimeSeriesRatio message from a plain object. Also converts values to their respective internal types. + * Creates a GetServiceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.TimeSeriesRatio} TimeSeriesRatio + * @returns {google.monitoring.v3.GetServiceRequest} GetServiceRequest */ - TimeSeriesRatio.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.TimeSeriesRatio) + GetServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetServiceRequest) return object; - var message = new $root.google.monitoring.v3.TimeSeriesRatio(); - if (object.goodServiceFilter != null) - message.goodServiceFilter = String(object.goodServiceFilter); - if (object.badServiceFilter != null) - message.badServiceFilter = String(object.badServiceFilter); - if (object.totalServiceFilter != null) - message.totalServiceFilter = String(object.totalServiceFilter); + var message = new $root.google.monitoring.v3.GetServiceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TimeSeriesRatio message. Also converts values to other types if specified. + * Creates a plain object from a GetServiceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @static - * @param {google.monitoring.v3.TimeSeriesRatio} message TimeSeriesRatio + * @param {google.monitoring.v3.GetServiceRequest} message GetServiceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeSeriesRatio.toObject = function toObject(message, options) { + GetServiceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.goodServiceFilter = ""; - object.badServiceFilter = ""; - object.totalServiceFilter = ""; - } - if (message.goodServiceFilter != null && message.hasOwnProperty("goodServiceFilter")) - object.goodServiceFilter = message.goodServiceFilter; - if (message.badServiceFilter != null && message.hasOwnProperty("badServiceFilter")) - object.badServiceFilter = message.badServiceFilter; - if (message.totalServiceFilter != null && message.hasOwnProperty("totalServiceFilter")) - object.totalServiceFilter = message.totalServiceFilter; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TimeSeriesRatio to JSON. + * Converts this GetServiceRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.TimeSeriesRatio + * @memberof google.monitoring.v3.GetServiceRequest * @instance * @returns {Object.} JSON object */ - TimeSeriesRatio.prototype.toJSON = function toJSON() { + GetServiceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TimeSeriesRatio; + return GetServiceRequest; })(); - v3.DistributionCut = (function() { + v3.ListServicesRequest = (function() { /** - * Properties of a DistributionCut. + * Properties of a ListServicesRequest. * @memberof google.monitoring.v3 - * @interface IDistributionCut - * @property {string|null} [distributionFilter] DistributionCut distributionFilter - * @property {google.monitoring.v3.IRange|null} [range] DistributionCut range + * @interface IListServicesRequest + * @property {string|null} [parent] ListServicesRequest parent + * @property {string|null} [filter] ListServicesRequest filter + * @property {number|null} [pageSize] ListServicesRequest pageSize + * @property {string|null} [pageToken] ListServicesRequest pageToken */ /** - * Constructs a new DistributionCut. + * Constructs a new ListServicesRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a DistributionCut. - * @implements IDistributionCut + * @classdesc Represents a ListServicesRequest. + * @implements IListServicesRequest * @constructor - * @param {google.monitoring.v3.IDistributionCut=} [properties] Properties to set + * @param {google.monitoring.v3.IListServicesRequest=} [properties] Properties to set */ - function DistributionCut(properties) { + function ListServicesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22098,88 +21107,114 @@ } /** - * DistributionCut distributionFilter. - * @member {string} distributionFilter - * @memberof google.monitoring.v3.DistributionCut + * ListServicesRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.ListServicesRequest * @instance */ - DistributionCut.prototype.distributionFilter = ""; + ListServicesRequest.prototype.parent = ""; /** - * DistributionCut range. - * @member {google.monitoring.v3.IRange|null|undefined} range - * @memberof google.monitoring.v3.DistributionCut + * ListServicesRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListServicesRequest * @instance */ - DistributionCut.prototype.range = null; + ListServicesRequest.prototype.filter = ""; /** - * Creates a new DistributionCut instance using the specified properties. + * ListServicesRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageSize = 0; + + /** + * ListServicesRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListServicesRequest + * @instance + */ + ListServicesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListServicesRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static - * @param {google.monitoring.v3.IDistributionCut=} [properties] Properties to set - * @returns {google.monitoring.v3.DistributionCut} DistributionCut instance + * @param {google.monitoring.v3.IListServicesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest instance */ - DistributionCut.create = function create(properties) { - return new DistributionCut(properties); + ListServicesRequest.create = function create(properties) { + return new ListServicesRequest(properties); }; /** - * Encodes the specified DistributionCut message. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * Encodes the specified ListServicesRequest message. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static - * @param {google.monitoring.v3.IDistributionCut} message DistributionCut message or plain object to encode + * @param {google.monitoring.v3.IListServicesRequest} message ListServicesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DistributionCut.encode = function encode(message, writer) { + ListServicesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.distributionFilter); - if (message.range != null && message.hasOwnProperty("range")) - $root.google.monitoring.v3.Range.encode(message.range, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified DistributionCut message, length delimited. Does not implicitly {@link google.monitoring.v3.DistributionCut.verify|verify} messages. + * Encodes the specified ListServicesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static - * @param {google.monitoring.v3.IDistributionCut} message DistributionCut message or plain object to encode + * @param {google.monitoring.v3.IListServicesRequest} message ListServicesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DistributionCut.encodeDelimited = function encodeDelimited(message, writer) { + ListServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DistributionCut message from the specified reader or buffer. + * Decodes a ListServicesRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DistributionCut.decode = function decode(reader, length) { + ListServicesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DistributionCut(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServicesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.distributionFilter = reader.string(); + case 1: + message.parent = reader.string(); break; - case 5: - message.range = $root.google.monitoring.v3.Range.decode(reader, reader.uint32()); + case 2: + message.filter = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -22190,125 +21225,134 @@ }; /** - * Decodes a DistributionCut message from the specified reader or buffer, length delimited. + * Decodes a ListServicesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DistributionCut.decodeDelimited = function decodeDelimited(reader) { + ListServicesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DistributionCut message. + * Verifies a ListServicesRequest message. * @function verify - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DistributionCut.verify = function verify(message) { + ListServicesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) - if (!$util.isString(message.distributionFilter)) - return "distributionFilter: string expected"; - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.monitoring.v3.Range.verify(message.range); - if (error) - return "range." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a DistributionCut message from a plain object. Also converts values to their respective internal types. + * Creates a ListServicesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DistributionCut} DistributionCut + * @returns {google.monitoring.v3.ListServicesRequest} ListServicesRequest */ - DistributionCut.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DistributionCut) + ListServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServicesRequest) return object; - var message = new $root.google.monitoring.v3.DistributionCut(); - if (object.distributionFilter != null) - message.distributionFilter = String(object.distributionFilter); - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.monitoring.v3.DistributionCut.range: object expected"); - message.range = $root.google.monitoring.v3.Range.fromObject(object.range); - } + var message = new $root.google.monitoring.v3.ListServicesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 DistributionCut message. Also converts values to other types if specified. + * Creates a plain object from a ListServicesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @static - * @param {google.monitoring.v3.DistributionCut} message DistributionCut + * @param {google.monitoring.v3.ListServicesRequest} message ListServicesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DistributionCut.toObject = function toObject(message, options) { + ListServicesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.distributionFilter = ""; - object.range = null; + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.distributionFilter != null && message.hasOwnProperty("distributionFilter")) - object.distributionFilter = message.distributionFilter; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.monitoring.v3.Range.toObject(message.range, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this DistributionCut to JSON. + * Converts this ListServicesRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.DistributionCut + * @memberof google.monitoring.v3.ListServicesRequest * @instance * @returns {Object.} JSON object */ - DistributionCut.prototype.toJSON = function toJSON() { + ListServicesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DistributionCut; + return ListServicesRequest; })(); - v3.WindowsBasedSli = (function() { + v3.ListServicesResponse = (function() { /** - * Properties of a WindowsBasedSli. + * Properties of a ListServicesResponse. * @memberof google.monitoring.v3 - * @interface IWindowsBasedSli - * @property {string|null} [goodBadMetricFilter] WindowsBasedSli goodBadMetricFilter - * @property {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null} [goodTotalRatioThreshold] WindowsBasedSli goodTotalRatioThreshold - * @property {google.monitoring.v3.WindowsBasedSli.IMetricRange|null} [metricMeanInRange] WindowsBasedSli metricMeanInRange - * @property {google.monitoring.v3.WindowsBasedSli.IMetricRange|null} [metricSumInRange] WindowsBasedSli metricSumInRange - * @property {google.protobuf.IDuration|null} [windowPeriod] WindowsBasedSli windowPeriod + * @interface IListServicesResponse + * @property {Array.|null} [services] ListServicesResponse services + * @property {string|null} [nextPageToken] ListServicesResponse nextPageToken */ /** - * Constructs a new WindowsBasedSli. + * Constructs a new ListServicesResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a WindowsBasedSli. - * @implements IWindowsBasedSli + * @classdesc Represents a ListServicesResponse. + * @implements IListServicesResponse * @constructor - * @param {google.monitoring.v3.IWindowsBasedSli=} [properties] Properties to set + * @param {google.monitoring.v3.IListServicesResponse=} [properties] Properties to set */ - function WindowsBasedSli(properties) { + function ListServicesResponse(properties) { + this.services = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22316,141 +21360,318 @@ } /** - * WindowsBasedSli goodBadMetricFilter. - * @member {string} goodBadMetricFilter - * @memberof google.monitoring.v3.WindowsBasedSli + * ListServicesResponse services. + * @member {Array.} services + * @memberof google.monitoring.v3.ListServicesResponse * @instance */ - WindowsBasedSli.prototype.goodBadMetricFilter = ""; + ListServicesResponse.prototype.services = $util.emptyArray; /** - * WindowsBasedSli goodTotalRatioThreshold. - * @member {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold|null|undefined} goodTotalRatioThreshold - * @memberof google.monitoring.v3.WindowsBasedSli + * ListServicesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListServicesResponse * @instance */ - WindowsBasedSli.prototype.goodTotalRatioThreshold = null; + ListServicesResponse.prototype.nextPageToken = ""; /** - * WindowsBasedSli metricMeanInRange. - * @member {google.monitoring.v3.WindowsBasedSli.IMetricRange|null|undefined} metricMeanInRange - * @memberof google.monitoring.v3.WindowsBasedSli - * @instance + * Creates a new ListServicesResponse instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.IListServicesResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse instance */ - WindowsBasedSli.prototype.metricMeanInRange = null; + ListServicesResponse.create = function create(properties) { + return new ListServicesResponse(properties); + }; /** - * WindowsBasedSli metricSumInRange. - * @member {google.monitoring.v3.WindowsBasedSli.IMetricRange|null|undefined} metricSumInRange - * @memberof google.monitoring.v3.WindowsBasedSli - * @instance + * Encodes the specified ListServicesResponse message. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - WindowsBasedSli.prototype.metricSumInRange = null; + ListServicesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.services != null && message.services.length) + for (var i = 0; i < message.services.length; ++i) + $root.google.monitoring.v3.Service.encode(message.services[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * WindowsBasedSli windowPeriod. - * @member {google.protobuf.IDuration|null|undefined} windowPeriod - * @memberof google.monitoring.v3.WindowsBasedSli + * Encodes the specified ListServicesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServicesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.IListServicesResponse} message ListServicesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServicesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.services && message.services.length)) + message.services = []; + message.services.push($root.google.monitoring.v3.Service.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServicesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServicesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServicesResponse message. + * @function verify + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServicesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.services != null && message.hasOwnProperty("services")) { + if (!Array.isArray(message.services)) + return "services: array expected"; + for (var i = 0; i < message.services.length; ++i) { + var error = $root.google.monitoring.v3.Service.verify(message.services[i]); + if (error) + return "services." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServicesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListServicesResponse} ListServicesResponse + */ + ListServicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServicesResponse) + return object; + var message = new $root.google.monitoring.v3.ListServicesResponse(); + if (object.services) { + if (!Array.isArray(object.services)) + throw TypeError(".google.monitoring.v3.ListServicesResponse.services: array expected"); + message.services = []; + for (var i = 0; i < object.services.length; ++i) { + if (typeof object.services[i] !== "object") + throw TypeError(".google.monitoring.v3.ListServicesResponse.services: object expected"); + message.services[i] = $root.google.monitoring.v3.Service.fromObject(object.services[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServicesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListServicesResponse + * @static + * @param {google.monitoring.v3.ListServicesResponse} message ListServicesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServicesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.services = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.services && message.services.length) { + object.services = []; + for (var j = 0; j < message.services.length; ++j) + object.services[j] = $root.google.monitoring.v3.Service.toObject(message.services[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServicesResponse to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListServicesResponse * @instance + * @returns {Object.} JSON object */ - WindowsBasedSli.prototype.windowPeriod = null; + ListServicesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return ListServicesResponse; + })(); + + v3.UpdateServiceRequest = (function() { /** - * WindowsBasedSli windowCriterion. - * @member {"goodBadMetricFilter"|"goodTotalRatioThreshold"|"metricMeanInRange"|"metricSumInRange"|undefined} windowCriterion - * @memberof google.monitoring.v3.WindowsBasedSli + * Properties of an UpdateServiceRequest. + * @memberof google.monitoring.v3 + * @interface IUpdateServiceRequest + * @property {google.monitoring.v3.IService|null} [service] UpdateServiceRequest service + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceRequest updateMask + */ + + /** + * Constructs a new UpdateServiceRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents an UpdateServiceRequest. + * @implements IUpdateServiceRequest + * @constructor + * @param {google.monitoring.v3.IUpdateServiceRequest=} [properties] Properties to set + */ + function UpdateServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServiceRequest service. + * @member {google.monitoring.v3.IService|null|undefined} service + * @memberof google.monitoring.v3.UpdateServiceRequest * @instance */ - Object.defineProperty(WindowsBasedSli.prototype, "windowCriterion", { - get: $util.oneOfGetter($oneOfFields = ["goodBadMetricFilter", "goodTotalRatioThreshold", "metricMeanInRange", "metricSumInRange"]), - set: $util.oneOfSetter($oneOfFields) - }); + UpdateServiceRequest.prototype.service = null; /** - * Creates a new WindowsBasedSli instance using the specified properties. + * UpdateServiceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateServiceRequest + * @instance + */ + UpdateServiceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateServiceRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static - * @param {google.monitoring.v3.IWindowsBasedSli=} [properties] Properties to set - * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli instance + * @param {google.monitoring.v3.IUpdateServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest instance */ - WindowsBasedSli.create = function create(properties) { - return new WindowsBasedSli(properties); + UpdateServiceRequest.create = function create(properties) { + return new UpdateServiceRequest(properties); }; /** - * Encodes the specified WindowsBasedSli message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * Encodes the specified UpdateServiceRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static - * @param {google.monitoring.v3.IWindowsBasedSli} message WindowsBasedSli message or plain object to encode + * @param {google.monitoring.v3.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WindowsBasedSli.encode = function encode(message, writer) { + UpdateServiceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) - $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.encode(message.goodTotalRatioThreshold, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) - $root.google.protobuf.Duration.encode(message.windowPeriod, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.goodBadMetricFilter); - if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) - $root.google.monitoring.v3.WindowsBasedSli.MetricRange.encode(message.metricMeanInRange, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) - $root.google.monitoring.v3.WindowsBasedSli.MetricRange.encode(message.metricSumInRange, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.service != null && message.hasOwnProperty("service")) + $root.google.monitoring.v3.Service.encode(message.service, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified WindowsBasedSli message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.verify|verify} messages. + * Encodes the specified UpdateServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static - * @param {google.monitoring.v3.IWindowsBasedSli} message WindowsBasedSli message or plain object to encode + * @param {google.monitoring.v3.IUpdateServiceRequest} message UpdateServiceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WindowsBasedSli.encodeDelimited = function encodeDelimited(message, writer) { + UpdateServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WindowsBasedSli message from the specified reader or buffer. + * Decodes an UpdateServiceRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WindowsBasedSli.decode = function decode(reader, length) { + UpdateServiceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateServiceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 5: - message.goodBadMetricFilter = reader.string(); + case 1: + message.service = $root.google.monitoring.v3.Service.decode(reader, reader.uint32()); break; case 2: - message.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.decode(reader, reader.uint32()); - break; - case 6: - message.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.decode(reader, reader.uint32()); - break; - case 7: - message.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.decode(reader, reader.uint32()); - break; - case 4: - message.windowPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -22461,994 +21682,406 @@ }; /** - * Decodes a WindowsBasedSli message from the specified reader or buffer, length delimited. + * Decodes an UpdateServiceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WindowsBasedSli.decodeDelimited = function decodeDelimited(reader) { + UpdateServiceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WindowsBasedSli message. + * Verifies an UpdateServiceRequest message. * @function verify - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WindowsBasedSli.verify = function verify(message) { + UpdateServiceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) { - properties.windowCriterion = 1; - if (!$util.isString(message.goodBadMetricFilter)) - return "goodBadMetricFilter: string expected"; - } - if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) { - if (properties.windowCriterion === 1) - return "windowCriterion: multiple values"; - properties.windowCriterion = 1; - { - var error = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify(message.goodTotalRatioThreshold); - if (error) - return "goodTotalRatioThreshold." + error; - } - } - if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) { - if (properties.windowCriterion === 1) - return "windowCriterion: multiple values"; - properties.windowCriterion = 1; - { - var error = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.verify(message.metricMeanInRange); - if (error) - return "metricMeanInRange." + error; - } - } - if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) { - if (properties.windowCriterion === 1) - return "windowCriterion: multiple values"; - properties.windowCriterion = 1; - { - var error = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.verify(message.metricSumInRange); - if (error) - return "metricSumInRange." + error; - } + if (message.service != null && message.hasOwnProperty("service")) { + var error = $root.google.monitoring.v3.Service.verify(message.service); + if (error) + return "service." + error; } - if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.windowPeriod); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "windowPeriod." + error; + return "updateMask." + error; } return null; }; /** - * Creates a WindowsBasedSli message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateServiceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.WindowsBasedSli} WindowsBasedSli + * @returns {google.monitoring.v3.UpdateServiceRequest} UpdateServiceRequest */ - WindowsBasedSli.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.WindowsBasedSli) + UpdateServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateServiceRequest) return object; - var message = new $root.google.monitoring.v3.WindowsBasedSli(); - if (object.goodBadMetricFilter != null) - message.goodBadMetricFilter = String(object.goodBadMetricFilter); - if (object.goodTotalRatioThreshold != null) { - if (typeof object.goodTotalRatioThreshold !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.goodTotalRatioThreshold: object expected"); - message.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.fromObject(object.goodTotalRatioThreshold); - } - if (object.metricMeanInRange != null) { - if (typeof object.metricMeanInRange !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.metricMeanInRange: object expected"); - message.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.fromObject(object.metricMeanInRange); - } - if (object.metricSumInRange != null) { - if (typeof object.metricSumInRange !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.metricSumInRange: object expected"); - message.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.fromObject(object.metricSumInRange); + var message = new $root.google.monitoring.v3.UpdateServiceRequest(); + if (object.service != null) { + if (typeof object.service !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceRequest.service: object expected"); + message.service = $root.google.monitoring.v3.Service.fromObject(object.service); } - if (object.windowPeriod != null) { - if (typeof object.windowPeriod !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.windowPeriod: object expected"); - message.windowPeriod = $root.google.protobuf.Duration.fromObject(object.windowPeriod); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a WindowsBasedSli message. Also converts values to other types if specified. + * Creates a plain object from an UpdateServiceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @static - * @param {google.monitoring.v3.WindowsBasedSli} message WindowsBasedSli + * @param {google.monitoring.v3.UpdateServiceRequest} message UpdateServiceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WindowsBasedSli.toObject = function toObject(message, options) { + UpdateServiceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.windowPeriod = null; - if (message.goodTotalRatioThreshold != null && message.hasOwnProperty("goodTotalRatioThreshold")) { - object.goodTotalRatioThreshold = $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.toObject(message.goodTotalRatioThreshold, options); - if (options.oneofs) - object.windowCriterion = "goodTotalRatioThreshold"; - } - if (message.windowPeriod != null && message.hasOwnProperty("windowPeriod")) - object.windowPeriod = $root.google.protobuf.Duration.toObject(message.windowPeriod, options); - if (message.goodBadMetricFilter != null && message.hasOwnProperty("goodBadMetricFilter")) { - object.goodBadMetricFilter = message.goodBadMetricFilter; - if (options.oneofs) - object.windowCriterion = "goodBadMetricFilter"; - } - if (message.metricMeanInRange != null && message.hasOwnProperty("metricMeanInRange")) { - object.metricMeanInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.toObject(message.metricMeanInRange, options); - if (options.oneofs) - object.windowCriterion = "metricMeanInRange"; - } - if (message.metricSumInRange != null && message.hasOwnProperty("metricSumInRange")) { - object.metricSumInRange = $root.google.monitoring.v3.WindowsBasedSli.MetricRange.toObject(message.metricSumInRange, options); - if (options.oneofs) - object.windowCriterion = "metricSumInRange"; + if (options.defaults) { + object.service = null; + object.updateMask = null; } + if (message.service != null && message.hasOwnProperty("service")) + object.service = $root.google.monitoring.v3.Service.toObject(message.service, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this WindowsBasedSli to JSON. + * Converts this UpdateServiceRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.WindowsBasedSli + * @memberof google.monitoring.v3.UpdateServiceRequest * @instance * @returns {Object.} JSON object */ - WindowsBasedSli.prototype.toJSON = function toJSON() { + UpdateServiceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - WindowsBasedSli.PerformanceThreshold = (function() { - - /** - * Properties of a PerformanceThreshold. - * @memberof google.monitoring.v3.WindowsBasedSli - * @interface IPerformanceThreshold - * @property {google.monitoring.v3.IRequestBasedSli|null} [performance] PerformanceThreshold performance - * @property {google.monitoring.v3.IBasicSli|null} [basicSliPerformance] PerformanceThreshold basicSliPerformance - * @property {number|null} [threshold] PerformanceThreshold threshold - */ - - /** - * Constructs a new PerformanceThreshold. - * @memberof google.monitoring.v3.WindowsBasedSli - * @classdesc Represents a PerformanceThreshold. - * @implements IPerformanceThreshold - * @constructor - * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold=} [properties] Properties to set - */ - function PerformanceThreshold(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return UpdateServiceRequest; + })(); - /** - * PerformanceThreshold performance. - * @member {google.monitoring.v3.IRequestBasedSli|null|undefined} performance - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @instance - */ - PerformanceThreshold.prototype.performance = null; + v3.DeleteServiceRequest = (function() { - /** - * PerformanceThreshold basicSliPerformance. - * @member {google.monitoring.v3.IBasicSli|null|undefined} basicSliPerformance - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @instance - */ - PerformanceThreshold.prototype.basicSliPerformance = null; + /** + * Properties of a DeleteServiceRequest. + * @memberof google.monitoring.v3 + * @interface IDeleteServiceRequest + * @property {string|null} [name] DeleteServiceRequest name + */ - /** - * PerformanceThreshold threshold. - * @member {number} threshold - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @instance - */ - PerformanceThreshold.prototype.threshold = 0; + /** + * Constructs a new DeleteServiceRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a DeleteServiceRequest. + * @implements IDeleteServiceRequest + * @constructor + * @param {google.monitoring.v3.IDeleteServiceRequest=} [properties] Properties to set + */ + function DeleteServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * DeleteServiceRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteServiceRequest + * @instance + */ + DeleteServiceRequest.prototype.name = ""; - /** - * PerformanceThreshold type. - * @member {"performance"|"basicSliPerformance"|undefined} type - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @instance - */ - Object.defineProperty(PerformanceThreshold.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["performance", "basicSliPerformance"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a new DeleteServiceRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest instance + */ + DeleteServiceRequest.create = function create(properties) { + return new DeleteServiceRequest(properties); + }; - /** - * Creates a new PerformanceThreshold instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold=} [properties] Properties to set - * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold instance - */ - PerformanceThreshold.create = function create(properties) { - return new PerformanceThreshold(properties); - }; - - /** - * Encodes the specified PerformanceThreshold message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold} message PerformanceThreshold message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PerformanceThreshold.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.performance != null && message.hasOwnProperty("performance")) - $root.google.monitoring.v3.RequestBasedSli.encode(message.performance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.threshold != null && message.hasOwnProperty("threshold")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.threshold); - if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) - $root.google.monitoring.v3.BasicSli.encode(message.basicSliPerformance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified DeleteServiceRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Encodes the specified PerformanceThreshold message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {google.monitoring.v3.WindowsBasedSli.IPerformanceThreshold} message PerformanceThreshold message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PerformanceThreshold.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified DeleteServiceRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.IDeleteServiceRequest} message DeleteServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a PerformanceThreshold message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PerformanceThreshold.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.performance = $root.google.monitoring.v3.RequestBasedSli.decode(reader, reader.uint32()); - break; - case 3: - message.basicSliPerformance = $root.google.monitoring.v3.BasicSli.decode(reader, reader.uint32()); - break; - case 2: - message.threshold = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a PerformanceThreshold message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PerformanceThreshold.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a PerformanceThreshold message. - * @function verify - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PerformanceThreshold.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.performance != null && message.hasOwnProperty("performance")) { - properties.type = 1; - { - var error = $root.google.monitoring.v3.RequestBasedSli.verify(message.performance); - if (error) - return "performance." + error; - } - } - if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.monitoring.v3.BasicSli.verify(message.basicSliPerformance); - if (error) - return "basicSliPerformance." + error; - } - } - if (message.threshold != null && message.hasOwnProperty("threshold")) - if (typeof message.threshold !== "number") - return "threshold: number expected"; - return null; - }; + /** + * Decodes a DeleteServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a PerformanceThreshold message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} PerformanceThreshold - */ - PerformanceThreshold.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold) - return object; - var message = new $root.google.monitoring.v3.WindowsBasedSli.PerformanceThreshold(); - if (object.performance != null) { - if (typeof object.performance !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.performance: object expected"); - message.performance = $root.google.monitoring.v3.RequestBasedSli.fromObject(object.performance); - } - if (object.basicSliPerformance != null) { - if (typeof object.basicSliPerformance !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.PerformanceThreshold.basicSliPerformance: object expected"); - message.basicSliPerformance = $root.google.monitoring.v3.BasicSli.fromObject(object.basicSliPerformance); - } - if (object.threshold != null) - message.threshold = Number(object.threshold); - return message; - }; + /** + * Verifies a DeleteServiceRequest message. + * @function verify + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates a plain object from a PerformanceThreshold message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @static - * @param {google.monitoring.v3.WindowsBasedSli.PerformanceThreshold} message PerformanceThreshold - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PerformanceThreshold.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.threshold = 0; - if (message.performance != null && message.hasOwnProperty("performance")) { - object.performance = $root.google.monitoring.v3.RequestBasedSli.toObject(message.performance, options); - if (options.oneofs) - object.type = "performance"; - } - if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.json && !isFinite(message.threshold) ? String(message.threshold) : message.threshold; - if (message.basicSliPerformance != null && message.hasOwnProperty("basicSliPerformance")) { - object.basicSliPerformance = $root.google.monitoring.v3.BasicSli.toObject(message.basicSliPerformance, options); - if (options.oneofs) - object.type = "basicSliPerformance"; - } + /** + * Creates a DeleteServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.DeleteServiceRequest} DeleteServiceRequest + */ + DeleteServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteServiceRequest) return object; - }; + var message = new $root.google.monitoring.v3.DeleteServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Converts this PerformanceThreshold to JSON. - * @function toJSON - * @memberof google.monitoring.v3.WindowsBasedSli.PerformanceThreshold - * @instance - * @returns {Object.} JSON object - */ - PerformanceThreshold.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a DeleteServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.DeleteServiceRequest + * @static + * @param {google.monitoring.v3.DeleteServiceRequest} message DeleteServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - return PerformanceThreshold; - })(); + /** + * Converts this DeleteServiceRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.DeleteServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - WindowsBasedSli.MetricRange = (function() { + return DeleteServiceRequest; + })(); - /** - * Properties of a MetricRange. - * @memberof google.monitoring.v3.WindowsBasedSli - * @interface IMetricRange - * @property {string|null} [timeSeries] MetricRange timeSeries - * @property {google.monitoring.v3.IRange|null} [range] MetricRange range - */ + v3.CreateServiceLevelObjectiveRequest = (function() { - /** - * Constructs a new MetricRange. - * @memberof google.monitoring.v3.WindowsBasedSli - * @classdesc Represents a MetricRange. - * @implements IMetricRange - * @constructor - * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange=} [properties] Properties to set - */ - function MetricRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a CreateServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @interface ICreateServiceLevelObjectiveRequest + * @property {string|null} [parent] CreateServiceLevelObjectiveRequest parent + * @property {string|null} [serviceLevelObjectiveId] CreateServiceLevelObjectiveRequest serviceLevelObjectiveId + * @property {google.monitoring.v3.IServiceLevelObjective|null} [serviceLevelObjective] CreateServiceLevelObjectiveRequest serviceLevelObjective + */ - /** - * MetricRange timeSeries. - * @member {string} timeSeries - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @instance - */ - MetricRange.prototype.timeSeries = ""; + /** + * Constructs a new CreateServiceLevelObjectiveRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a CreateServiceLevelObjectiveRequest. + * @implements ICreateServiceLevelObjectiveRequest + * @constructor + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest=} [properties] Properties to set + */ + function CreateServiceLevelObjectiveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * MetricRange range. - * @member {google.monitoring.v3.IRange|null|undefined} range - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @instance - */ - MetricRange.prototype.range = null; + /** + * CreateServiceLevelObjectiveRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + */ + CreateServiceLevelObjectiveRequest.prototype.parent = ""; - /** - * Creates a new MetricRange instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange=} [properties] Properties to set - * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange instance - */ - MetricRange.create = function create(properties) { - return new MetricRange(properties); - }; + /** + * CreateServiceLevelObjectiveRequest serviceLevelObjectiveId. + * @member {string} serviceLevelObjectiveId + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + */ + CreateServiceLevelObjectiveRequest.prototype.serviceLevelObjectiveId = ""; - /** - * Encodes the specified MetricRange message. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange} message MetricRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeSeries); - if (message.range != null && message.hasOwnProperty("range")) - $root.google.monitoring.v3.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * CreateServiceLevelObjectiveRequest serviceLevelObjective. + * @member {google.monitoring.v3.IServiceLevelObjective|null|undefined} serviceLevelObjective + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @instance + */ + CreateServiceLevelObjectiveRequest.prototype.serviceLevelObjective = null; - /** - * Encodes the specified MetricRange message, length delimited. Does not implicitly {@link google.monitoring.v3.WindowsBasedSli.MetricRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {google.monitoring.v3.WindowsBasedSli.IMetricRange} message MetricRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new CreateServiceLevelObjectiveRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest instance + */ + CreateServiceLevelObjectiveRequest.create = function create(properties) { + return new CreateServiceLevelObjectiveRequest(properties); + }; - /** - * Decodes a MetricRange message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.WindowsBasedSli.MetricRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timeSeries = reader.string(); - break; - case 4: - message.range = $root.google.monitoring.v3.Range.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetricRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetricRange message. - * @function verify - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - if (!$util.isString(message.timeSeries)) - return "timeSeries: string expected"; - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.monitoring.v3.Range.verify(message.range); - if (error) - return "range." + error; - } - return null; - }; - - /** - * Creates a MetricRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.WindowsBasedSli.MetricRange} MetricRange - */ - MetricRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.WindowsBasedSli.MetricRange) - return object; - var message = new $root.google.monitoring.v3.WindowsBasedSli.MetricRange(); - if (object.timeSeries != null) - message.timeSeries = String(object.timeSeries); - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.monitoring.v3.WindowsBasedSli.MetricRange.range: object expected"); - message.range = $root.google.monitoring.v3.Range.fromObject(object.range); - } - return message; - }; - - /** - * Creates a plain object from a MetricRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @static - * @param {google.monitoring.v3.WindowsBasedSli.MetricRange} message MetricRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.timeSeries = ""; - object.range = null; - } - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - object.timeSeries = message.timeSeries; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.monitoring.v3.Range.toObject(message.range, options); - return object; - }; - - /** - * Converts this MetricRange to JSON. - * @function toJSON - * @memberof google.monitoring.v3.WindowsBasedSli.MetricRange - * @instance - * @returns {Object.} JSON object - */ - MetricRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MetricRange; - })(); - - return WindowsBasedSli; - })(); - - v3.UptimeCheckService = (function() { - - /** - * Constructs a new UptimeCheckService service. - * @memberof google.monitoring.v3 - * @classdesc Represents an UptimeCheckService - * @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 UptimeCheckService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (UptimeCheckService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UptimeCheckService; - - /** - * Creates new UptimeCheckService service using the specified rpc implementation. - * @function create - * @memberof google.monitoring.v3.UptimeCheckService - * @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 {UptimeCheckService} RPC service. Useful where requests and/or responses are streamed. - */ - UptimeCheckService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckConfigs}. - * @memberof google.monitoring.v3.UptimeCheckService - * @typedef ListUptimeCheckConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListUptimeCheckConfigsResponse} [response] ListUptimeCheckConfigsResponse - */ - - /** - * Calls ListUptimeCheckConfigs. - * @function listUptimeCheckConfigs - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} request ListUptimeCheckConfigsRequest message or plain object - * @param {google.monitoring.v3.UptimeCheckService.ListUptimeCheckConfigsCallback} callback Node-style callback called with the error, if any, and ListUptimeCheckConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UptimeCheckService.prototype.listUptimeCheckConfigs = function listUptimeCheckConfigs(request, callback) { - return this.rpcCall(listUptimeCheckConfigs, $root.google.monitoring.v3.ListUptimeCheckConfigsRequest, $root.google.monitoring.v3.ListUptimeCheckConfigsResponse, request, callback); - }, "name", { value: "ListUptimeCheckConfigs" }); - - /** - * Calls ListUptimeCheckConfigs. - * @function listUptimeCheckConfigs - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} request ListUptimeCheckConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#getUptimeCheckConfig}. - * @memberof google.monitoring.v3.UptimeCheckService - * @typedef GetUptimeCheckConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.UptimeCheckConfig} [response] UptimeCheckConfig - */ - - /** - * Calls GetUptimeCheckConfig. - * @function getUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} request GetUptimeCheckConfigRequest message or plain object - * @param {google.monitoring.v3.UptimeCheckService.GetUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and UptimeCheckConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UptimeCheckService.prototype.getUptimeCheckConfig = function getUptimeCheckConfig(request, callback) { - return this.rpcCall(getUptimeCheckConfig, $root.google.monitoring.v3.GetUptimeCheckConfigRequest, $root.google.monitoring.v3.UptimeCheckConfig, request, callback); - }, "name", { value: "GetUptimeCheckConfig" }); - - /** - * Calls GetUptimeCheckConfig. - * @function getUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} request GetUptimeCheckConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#createUptimeCheckConfig}. - * @memberof google.monitoring.v3.UptimeCheckService - * @typedef CreateUptimeCheckConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.UptimeCheckConfig} [response] UptimeCheckConfig - */ - - /** - * Calls CreateUptimeCheckConfig. - * @function createUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} request CreateUptimeCheckConfigRequest message or plain object - * @param {google.monitoring.v3.UptimeCheckService.CreateUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and UptimeCheckConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UptimeCheckService.prototype.createUptimeCheckConfig = function createUptimeCheckConfig(request, callback) { - return this.rpcCall(createUptimeCheckConfig, $root.google.monitoring.v3.CreateUptimeCheckConfigRequest, $root.google.monitoring.v3.UptimeCheckConfig, request, callback); - }, "name", { value: "CreateUptimeCheckConfig" }); - - /** - * Calls CreateUptimeCheckConfig. - * @function createUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} request CreateUptimeCheckConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#updateUptimeCheckConfig}. - * @memberof google.monitoring.v3.UptimeCheckService - * @typedef UpdateUptimeCheckConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.UptimeCheckConfig} [response] UptimeCheckConfig - */ - - /** - * Calls UpdateUptimeCheckConfig. - * @function updateUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} request UpdateUptimeCheckConfigRequest message or plain object - * @param {google.monitoring.v3.UptimeCheckService.UpdateUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and UptimeCheckConfig - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UptimeCheckService.prototype.updateUptimeCheckConfig = function updateUptimeCheckConfig(request, callback) { - return this.rpcCall(updateUptimeCheckConfig, $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest, $root.google.monitoring.v3.UptimeCheckConfig, request, callback); - }, "name", { value: "UpdateUptimeCheckConfig" }); - - /** - * Calls UpdateUptimeCheckConfig. - * @function updateUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} request UpdateUptimeCheckConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#deleteUptimeCheckConfig}. - * @memberof google.monitoring.v3.UptimeCheckService - * @typedef DeleteUptimeCheckConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteUptimeCheckConfig. - * @function deleteUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} request DeleteUptimeCheckConfigRequest message or plain object - * @param {google.monitoring.v3.UptimeCheckService.DeleteUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UptimeCheckService.prototype.deleteUptimeCheckConfig = function deleteUptimeCheckConfig(request, callback) { - return this.rpcCall(deleteUptimeCheckConfig, $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteUptimeCheckConfig" }); - - /** - * Calls DeleteUptimeCheckConfig. - * @function deleteUptimeCheckConfig - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} request DeleteUptimeCheckConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckIps}. - * @memberof google.monitoring.v3.UptimeCheckService - * @typedef ListUptimeCheckIpsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.monitoring.v3.ListUptimeCheckIpsResponse} [response] ListUptimeCheckIpsResponse - */ - - /** - * Calls ListUptimeCheckIps. - * @function listUptimeCheckIps - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} request ListUptimeCheckIpsRequest message or plain object - * @param {google.monitoring.v3.UptimeCheckService.ListUptimeCheckIpsCallback} callback Node-style callback called with the error, if any, and ListUptimeCheckIpsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UptimeCheckService.prototype.listUptimeCheckIps = function listUptimeCheckIps(request, callback) { - return this.rpcCall(listUptimeCheckIps, $root.google.monitoring.v3.ListUptimeCheckIpsRequest, $root.google.monitoring.v3.ListUptimeCheckIpsResponse, request, callback); - }, "name", { value: "ListUptimeCheckIps" }); - - /** - * Calls ListUptimeCheckIps. - * @function listUptimeCheckIps - * @memberof google.monitoring.v3.UptimeCheckService - * @instance - * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} request ListUptimeCheckIpsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return UptimeCheckService; - })(); - - v3.ListUptimeCheckConfigsRequest = (function() { - - /** - * Properties of a ListUptimeCheckConfigsRequest. - * @memberof google.monitoring.v3 - * @interface IListUptimeCheckConfigsRequest - * @property {string|null} [parent] ListUptimeCheckConfigsRequest parent - * @property {number|null} [pageSize] ListUptimeCheckConfigsRequest pageSize - * @property {string|null} [pageToken] ListUptimeCheckConfigsRequest pageToken - */ - - /** - * Constructs a new ListUptimeCheckConfigsRequest. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListUptimeCheckConfigsRequest. - * @implements IListUptimeCheckConfigsRequest - * @constructor - * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest=} [properties] Properties to set - */ - function ListUptimeCheckConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUptimeCheckConfigsRequest parent. - * @member {string} parent - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest - * @instance - */ - ListUptimeCheckConfigsRequest.prototype.parent = ""; - - /** - * ListUptimeCheckConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest - * @instance - */ - ListUptimeCheckConfigsRequest.prototype.pageSize = 0; - - /** - * ListUptimeCheckConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest - * @instance - */ - ListUptimeCheckConfigsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListUptimeCheckConfigsRequest instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest - * @static - * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest instance - */ - ListUptimeCheckConfigsRequest.create = function create(properties) { - return new ListUptimeCheckConfigsRequest(properties); - }; - - /** - * Encodes the specified ListUptimeCheckConfigsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest - * @static - * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} message ListUptimeCheckConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUptimeCheckConfigsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; + /** + * Encodes the specified CreateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest + * @static + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceLevelObjectiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjective, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceLevelObjectiveId); + return writer; + }; /** - * Encodes the specified ListUptimeCheckConfigsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. + * Encodes the specified CreateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateServiceLevelObjectiveRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} message ListUptimeCheckConfigsRequest message or plain object to encode + * @param {google.monitoring.v3.ICreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListUptimeCheckConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer. + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListUptimeCheckConfigsRequest.decode = function decode(reader, length) { + CreateServiceLevelObjectiveRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckConfigsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -23456,10 +22089,10 @@ message.parent = reader.string(); break; case 3: - message.pageSize = reader.int32(); + message.serviceLevelObjectiveId = reader.string(); break; - case 4: - message.pageToken = reader.string(); + case 2: + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -23470,127 +22103,130 @@ }; /** - * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListUptimeCheckConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListUptimeCheckConfigsRequest message. + * Verifies a CreateServiceLevelObjectiveRequest message. * @function verify - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListUptimeCheckConfigsRequest.verify = function verify(message) { + CreateServiceLevelObjectiveRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) + if (!$util.isString(message.serviceLevelObjectiveId)) + return "serviceLevelObjectiveId: string expected"; + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) { + var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjective); + if (error) + return "serviceLevelObjective." + error; + } return null; }; /** - * Creates a ListUptimeCheckConfigsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest + * @returns {google.monitoring.v3.CreateServiceLevelObjectiveRequest} CreateServiceLevelObjectiveRequest */ - ListUptimeCheckConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListUptimeCheckConfigsRequest) + CreateServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest) return object; - var message = new $root.google.monitoring.v3.ListUptimeCheckConfigsRequest(); + var message = new $root.google.monitoring.v3.CreateServiceLevelObjectiveRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + if (object.serviceLevelObjectiveId != null) + message.serviceLevelObjectiveId = String(object.serviceLevelObjectiveId); + if (object.serviceLevelObjective != null) { + if (typeof object.serviceLevelObjective !== "object") + throw TypeError(".google.monitoring.v3.CreateServiceLevelObjectiveRequest.serviceLevelObjective: object expected"); + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjective); + } return message; }; /** - * Creates a plain object from a ListUptimeCheckConfigsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateServiceLevelObjectiveRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.ListUptimeCheckConfigsRequest} message ListUptimeCheckConfigsRequest + * @param {google.monitoring.v3.CreateServiceLevelObjectiveRequest} message CreateServiceLevelObjectiveRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListUptimeCheckConfigsRequest.toObject = function toObject(message, options) { + CreateServiceLevelObjectiveRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.serviceLevelObjective = null; + object.serviceLevelObjectiveId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + object.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjective, options); + if (message.serviceLevelObjectiveId != null && message.hasOwnProperty("serviceLevelObjectiveId")) + object.serviceLevelObjectiveId = message.serviceLevelObjectiveId; return object; }; /** - * Converts this ListUptimeCheckConfigsRequest to JSON. + * Converts this CreateServiceLevelObjectiveRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @memberof google.monitoring.v3.CreateServiceLevelObjectiveRequest * @instance * @returns {Object.} JSON object */ - ListUptimeCheckConfigsRequest.prototype.toJSON = function toJSON() { + CreateServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListUptimeCheckConfigsRequest; + return CreateServiceLevelObjectiveRequest; })(); - v3.ListUptimeCheckConfigsResponse = (function() { + v3.GetServiceLevelObjectiveRequest = (function() { /** - * Properties of a ListUptimeCheckConfigsResponse. + * Properties of a GetServiceLevelObjectiveRequest. * @memberof google.monitoring.v3 - * @interface IListUptimeCheckConfigsResponse - * @property {Array.|null} [uptimeCheckConfigs] ListUptimeCheckConfigsResponse uptimeCheckConfigs - * @property {string|null} [nextPageToken] ListUptimeCheckConfigsResponse nextPageToken - * @property {number|null} [totalSize] ListUptimeCheckConfigsResponse totalSize + * @interface IGetServiceLevelObjectiveRequest + * @property {string|null} [name] GetServiceLevelObjectiveRequest name + * @property {google.monitoring.v3.ServiceLevelObjective.View|null} [view] GetServiceLevelObjectiveRequest view */ /** - * Constructs a new ListUptimeCheckConfigsResponse. + * Constructs a new GetServiceLevelObjectiveRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a ListUptimeCheckConfigsResponse. - * @implements IListUptimeCheckConfigsResponse + * @classdesc Represents a GetServiceLevelObjectiveRequest. + * @implements IGetServiceLevelObjectiveRequest * @constructor - * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse=} [properties] Properties to set + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest=} [properties] Properties to set */ - function ListUptimeCheckConfigsResponse(properties) { - this.uptimeCheckConfigs = []; + function GetServiceLevelObjectiveRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23598,104 +22234,88 @@ } /** - * ListUptimeCheckConfigsResponse uptimeCheckConfigs. - * @member {Array.} uptimeCheckConfigs - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse - * @instance - */ - ListUptimeCheckConfigsResponse.prototype.uptimeCheckConfigs = $util.emptyArray; - - /** - * ListUptimeCheckConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * GetServiceLevelObjectiveRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @instance */ - ListUptimeCheckConfigsResponse.prototype.nextPageToken = ""; + GetServiceLevelObjectiveRequest.prototype.name = ""; /** - * ListUptimeCheckConfigsResponse totalSize. - * @member {number} totalSize - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * GetServiceLevelObjectiveRequest view. + * @member {google.monitoring.v3.ServiceLevelObjective.View} view + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @instance */ - ListUptimeCheckConfigsResponse.prototype.totalSize = 0; + GetServiceLevelObjectiveRequest.prototype.view = 0; /** - * Creates a new ListUptimeCheckConfigsResponse instance using the specified properties. + * Creates a new GetServiceLevelObjectiveRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse instance + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest instance */ - ListUptimeCheckConfigsResponse.create = function create(properties) { - return new ListUptimeCheckConfigsResponse(properties); + GetServiceLevelObjectiveRequest.create = function create(properties) { + return new GetServiceLevelObjectiveRequest(properties); }; /** - * Encodes the specified ListUptimeCheckConfigsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. + * Encodes the specified GetServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse} message ListUptimeCheckConfigsResponse message or plain object to encode + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListUptimeCheckConfigsResponse.encode = function encode(message, writer) { + GetServiceLevelObjectiveRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uptimeCheckConfigs != null && message.uptimeCheckConfigs.length) - for (var i = 0; i < message.uptimeCheckConfigs.length; ++i) - $root.google.monitoring.v3.UptimeCheckConfig.encode(message.uptimeCheckConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); return writer; }; /** - * Encodes the specified ListUptimeCheckConfigsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. + * Encodes the specified GetServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetServiceLevelObjectiveRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse} message ListUptimeCheckConfigsResponse message or plain object to encode + * @param {google.monitoring.v3.IGetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListUptimeCheckConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer. + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListUptimeCheckConfigsResponse.decode = function decode(reader, length) { + GetServiceLevelObjectiveRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckConfigsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetServiceLevelObjectiveRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.uptimeCheckConfigs && message.uptimeCheckConfigs.length)) - message.uptimeCheckConfigs = []; - message.uptimeCheckConfigs.push($root.google.monitoring.v3.UptimeCheckConfig.decode(reader, reader.uint32())); + message.name = reader.string(); break; case 2: - message.nextPageToken = reader.string(); - break; - case 3: - message.totalSize = reader.int32(); + message.view = reader.int32(); break; default: reader.skipType(tag & 7); @@ -23706,142 +22326,138 @@ }; /** - * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListUptimeCheckConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + GetServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListUptimeCheckConfigsResponse message. + * Verifies a GetServiceLevelObjectiveRequest message. * @function verify - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListUptimeCheckConfigsResponse.verify = function verify(message) { + GetServiceLevelObjectiveRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uptimeCheckConfigs != null && message.hasOwnProperty("uptimeCheckConfigs")) { - if (!Array.isArray(message.uptimeCheckConfigs)) - return "uptimeCheckConfigs: array expected"; - for (var i = 0; i < message.uptimeCheckConfigs.length; ++i) { - var error = $root.google.monitoring.v3.UptimeCheckConfig.verify(message.uptimeCheckConfigs[i]); - if (error) - return "uptimeCheckConfigs." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 2: + case 1: + break; } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - if (!$util.isInteger(message.totalSize)) - return "totalSize: integer expected"; return null; }; /** - * Creates a ListUptimeCheckConfigsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse + * @returns {google.monitoring.v3.GetServiceLevelObjectiveRequest} GetServiceLevelObjectiveRequest */ - ListUptimeCheckConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListUptimeCheckConfigsResponse) + GetServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetServiceLevelObjectiveRequest) return object; - var message = new $root.google.monitoring.v3.ListUptimeCheckConfigsResponse(); - if (object.uptimeCheckConfigs) { - if (!Array.isArray(object.uptimeCheckConfigs)) - throw TypeError(".google.monitoring.v3.ListUptimeCheckConfigsResponse.uptimeCheckConfigs: array expected"); - message.uptimeCheckConfigs = []; - for (var i = 0; i < object.uptimeCheckConfigs.length; ++i) { - if (typeof object.uptimeCheckConfigs[i] !== "object") - throw TypeError(".google.monitoring.v3.ListUptimeCheckConfigsResponse.uptimeCheckConfigs: object expected"); - message.uptimeCheckConfigs[i] = $root.google.monitoring.v3.UptimeCheckConfig.fromObject(object.uptimeCheckConfigs[i]); - } + var message = new $root.google.monitoring.v3.GetServiceLevelObjectiveRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 2: + message.view = 2; + break; + case "EXPLICIT": + case 1: + message.view = 1; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; return message; }; /** - * Creates a plain object from a ListUptimeCheckConfigsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetServiceLevelObjectiveRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.ListUptimeCheckConfigsResponse} message ListUptimeCheckConfigsResponse + * @param {google.monitoring.v3.GetServiceLevelObjectiveRequest} message GetServiceLevelObjectiveRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListUptimeCheckConfigsResponse.toObject = function toObject(message, options) { + GetServiceLevelObjectiveRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uptimeCheckConfigs = []; if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.uptimeCheckConfigs && message.uptimeCheckConfigs.length) { - object.uptimeCheckConfigs = []; - for (var j = 0; j < message.uptimeCheckConfigs.length; ++j) - object.uptimeCheckConfigs[j] = $root.google.monitoring.v3.UptimeCheckConfig.toObject(message.uptimeCheckConfigs[j], options); + object.name = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.monitoring.v3.ServiceLevelObjective.View[message.view] : message.view; return object; }; /** - * Converts this ListUptimeCheckConfigsResponse to JSON. + * Converts this GetServiceLevelObjectiveRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @memberof google.monitoring.v3.GetServiceLevelObjectiveRequest * @instance * @returns {Object.} JSON object */ - ListUptimeCheckConfigsResponse.prototype.toJSON = function toJSON() { + GetServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListUptimeCheckConfigsResponse; + return GetServiceLevelObjectiveRequest; })(); - v3.GetUptimeCheckConfigRequest = (function() { + v3.ListServiceLevelObjectivesRequest = (function() { /** - * Properties of a GetUptimeCheckConfigRequest. + * Properties of a ListServiceLevelObjectivesRequest. * @memberof google.monitoring.v3 - * @interface IGetUptimeCheckConfigRequest - * @property {string|null} [name] GetUptimeCheckConfigRequest name + * @interface IListServiceLevelObjectivesRequest + * @property {string|null} [parent] ListServiceLevelObjectivesRequest parent + * @property {string|null} [filter] ListServiceLevelObjectivesRequest filter + * @property {number|null} [pageSize] ListServiceLevelObjectivesRequest pageSize + * @property {string|null} [pageToken] ListServiceLevelObjectivesRequest pageToken + * @property {google.monitoring.v3.ServiceLevelObjective.View|null} [view] ListServiceLevelObjectivesRequest view */ /** - * Constructs a new GetUptimeCheckConfigRequest. + * Constructs a new ListServiceLevelObjectivesRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a GetUptimeCheckConfigRequest. - * @implements IGetUptimeCheckConfigRequest + * @classdesc Represents a ListServiceLevelObjectivesRequest. + * @implements IListServiceLevelObjectivesRequest * @constructor - * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest=} [properties] Properties to set */ - function GetUptimeCheckConfigRequest(properties) { + function ListServiceLevelObjectivesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23849,75 +22465,127 @@ } /** - * GetUptimeCheckConfigRequest name. - * @member {string} name - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * ListServiceLevelObjectivesRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @instance */ - GetUptimeCheckConfigRequest.prototype.name = ""; + ListServiceLevelObjectivesRequest.prototype.parent = ""; /** - * Creates a new GetUptimeCheckConfigRequest instance using the specified properties. + * ListServiceLevelObjectivesRequest filter. + * @member {string} filter + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.filter = ""; + + /** + * ListServiceLevelObjectivesRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.pageSize = 0; + + /** + * ListServiceLevelObjectivesRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.pageToken = ""; + + /** + * ListServiceLevelObjectivesRequest view. + * @member {google.monitoring.v3.ServiceLevelObjective.View} view + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest + * @instance + */ + ListServiceLevelObjectivesRequest.prototype.view = 0; + + /** + * Creates a new ListServiceLevelObjectivesRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static - * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest instance + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest instance */ - GetUptimeCheckConfigRequest.create = function create(properties) { - return new GetUptimeCheckConfigRequest(properties); + ListServiceLevelObjectivesRequest.create = function create(properties) { + return new ListServiceLevelObjectivesRequest(properties); }; /** - * Encodes the specified GetUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified ListServiceLevelObjectivesRequest message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static - * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} message GetUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetUptimeCheckConfigRequest.encode = function encode(message, writer) { + ListServiceLevelObjectivesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.view != null && message.hasOwnProperty("view")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.view); return writer; }; /** - * Encodes the specified GetUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified ListServiceLevelObjectivesRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static - * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} message GetUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListServiceLevelObjectivesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer. + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetUptimeCheckConfigRequest.decode = function decode(reader, length) { + ListServiceLevelObjectivesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetUptimeCheckConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServiceLevelObjectivesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.filter = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + case 5: + message.view = reader.int32(); break; default: reader.skipType(tag & 7); @@ -23928,108 +22596,160 @@ }; /** - * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a ListServiceLevelObjectivesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + ListServiceLevelObjectivesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetUptimeCheckConfigRequest message. + * Verifies a ListServiceLevelObjectivesRequest message. * @function verify - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetUptimeCheckConfigRequest.verify = function verify(message) { + ListServiceLevelObjectivesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 2: + case 1: + break; + } return null; }; /** - * Creates a GetUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListServiceLevelObjectivesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest + * @returns {google.monitoring.v3.ListServiceLevelObjectivesRequest} ListServiceLevelObjectivesRequest */ - GetUptimeCheckConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.GetUptimeCheckConfigRequest) + ListServiceLevelObjectivesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServiceLevelObjectivesRequest) return object; - var message = new $root.google.monitoring.v3.GetUptimeCheckConfigRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.monitoring.v3.ListServiceLevelObjectivesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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); + switch (object.view) { + case "VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 2: + message.view = 2; + break; + case "EXPLICIT": + case 1: + message.view = 1; + break; + } return message; }; /** - * Creates a plain object from a GetUptimeCheckConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListServiceLevelObjectivesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @static - * @param {google.monitoring.v3.GetUptimeCheckConfigRequest} message GetUptimeCheckConfigRequest + * @param {google.monitoring.v3.ListServiceLevelObjectivesRequest} message ListServiceLevelObjectivesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetUptimeCheckConfigRequest.toObject = function toObject(message, options) { + ListServiceLevelObjectivesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.monitoring.v3.ServiceLevelObjective.View[message.view] : message.view; return object; }; /** - * Converts this GetUptimeCheckConfigRequest to JSON. + * Converts this ListServiceLevelObjectivesRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesRequest * @instance * @returns {Object.} JSON object */ - GetUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + ListServiceLevelObjectivesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetUptimeCheckConfigRequest; + return ListServiceLevelObjectivesRequest; })(); - v3.CreateUptimeCheckConfigRequest = (function() { + v3.ListServiceLevelObjectivesResponse = (function() { /** - * Properties of a CreateUptimeCheckConfigRequest. + * Properties of a ListServiceLevelObjectivesResponse. * @memberof google.monitoring.v3 - * @interface ICreateUptimeCheckConfigRequest - * @property {string|null} [parent] CreateUptimeCheckConfigRequest parent - * @property {google.monitoring.v3.IUptimeCheckConfig|null} [uptimeCheckConfig] CreateUptimeCheckConfigRequest uptimeCheckConfig + * @interface IListServiceLevelObjectivesResponse + * @property {Array.|null} [serviceLevelObjectives] ListServiceLevelObjectivesResponse serviceLevelObjectives + * @property {string|null} [nextPageToken] ListServiceLevelObjectivesResponse nextPageToken */ /** - * Constructs a new CreateUptimeCheckConfigRequest. + * Constructs a new ListServiceLevelObjectivesResponse. * @memberof google.monitoring.v3 - * @classdesc Represents a CreateUptimeCheckConfigRequest. - * @implements ICreateUptimeCheckConfigRequest + * @classdesc Represents a ListServiceLevelObjectivesResponse. + * @implements IListServiceLevelObjectivesResponse * @constructor - * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse=} [properties] Properties to set */ - function CreateUptimeCheckConfigRequest(properties) { + function ListServiceLevelObjectivesResponse(properties) { + this.serviceLevelObjectives = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24037,88 +22757,91 @@ } /** - * CreateUptimeCheckConfigRequest parent. - * @member {string} parent - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * ListServiceLevelObjectivesResponse serviceLevelObjectives. + * @member {Array.} serviceLevelObjectives + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @instance */ - CreateUptimeCheckConfigRequest.prototype.parent = ""; + ListServiceLevelObjectivesResponse.prototype.serviceLevelObjectives = $util.emptyArray; /** - * CreateUptimeCheckConfigRequest uptimeCheckConfig. - * @member {google.monitoring.v3.IUptimeCheckConfig|null|undefined} uptimeCheckConfig - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * ListServiceLevelObjectivesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @instance */ - CreateUptimeCheckConfigRequest.prototype.uptimeCheckConfig = null; + ListServiceLevelObjectivesResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateUptimeCheckConfigRequest instance using the specified properties. + * Creates a new ListServiceLevelObjectivesResponse instance using the specified properties. * @function create - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static - * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest instance + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse instance */ - CreateUptimeCheckConfigRequest.create = function create(properties) { - return new CreateUptimeCheckConfigRequest(properties); + ListServiceLevelObjectivesResponse.create = function create(properties) { + return new ListServiceLevelObjectivesResponse(properties); }; /** - * Encodes the specified CreateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified ListServiceLevelObjectivesResponse message. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static - * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} message CreateUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateUptimeCheckConfigRequest.encode = function encode(message, writer) { + ListServiceLevelObjectivesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) - $root.google.monitoring.v3.UptimeCheckConfig.encode(message.uptimeCheckConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serviceLevelObjectives != null && message.serviceLevelObjectives.length) + for (var i = 0; i < message.serviceLevelObjectives.length; ++i) + $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjectives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CreateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified ListServiceLevelObjectivesResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListServiceLevelObjectivesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static - * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} message CreateUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListServiceLevelObjectivesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer. + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateUptimeCheckConfigRequest.decode = function decode(reader, length) { + ListServiceLevelObjectivesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateUptimeCheckConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListServiceLevelObjectivesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.serviceLevelObjectives && message.serviceLevelObjectives.length)) + message.serviceLevelObjectives = []; + message.serviceLevelObjectives.push($root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32())); break; case 2: - message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -24129,122 +22852,134 @@ }; /** - * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a ListServiceLevelObjectivesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + ListServiceLevelObjectivesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateUptimeCheckConfigRequest message. + * Verifies a ListServiceLevelObjectivesResponse message. * @function verify - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateUptimeCheckConfigRequest.verify = function verify(message) { + ListServiceLevelObjectivesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) { - var error = $root.google.monitoring.v3.UptimeCheckConfig.verify(message.uptimeCheckConfig); - if (error) - return "uptimeCheckConfig." + error; + if (message.serviceLevelObjectives != null && message.hasOwnProperty("serviceLevelObjectives")) { + if (!Array.isArray(message.serviceLevelObjectives)) + return "serviceLevelObjectives: array expected"; + for (var i = 0; i < message.serviceLevelObjectives.length; ++i) { + var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjectives[i]); + if (error) + return "serviceLevelObjectives." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListServiceLevelObjectivesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest + * @returns {google.monitoring.v3.ListServiceLevelObjectivesResponse} ListServiceLevelObjectivesResponse */ - CreateUptimeCheckConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.CreateUptimeCheckConfigRequest) + ListServiceLevelObjectivesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListServiceLevelObjectivesResponse) return object; - var message = new $root.google.monitoring.v3.CreateUptimeCheckConfigRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.uptimeCheckConfig != null) { - if (typeof object.uptimeCheckConfig !== "object") - throw TypeError(".google.monitoring.v3.CreateUptimeCheckConfigRequest.uptimeCheckConfig: object expected"); - message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.fromObject(object.uptimeCheckConfig); + var message = new $root.google.monitoring.v3.ListServiceLevelObjectivesResponse(); + if (object.serviceLevelObjectives) { + if (!Array.isArray(object.serviceLevelObjectives)) + throw TypeError(".google.monitoring.v3.ListServiceLevelObjectivesResponse.serviceLevelObjectives: array expected"); + message.serviceLevelObjectives = []; + for (var i = 0; i < object.serviceLevelObjectives.length; ++i) { + if (typeof object.serviceLevelObjectives[i] !== "object") + throw TypeError(".google.monitoring.v3.ListServiceLevelObjectivesResponse.serviceLevelObjectives: object expected"); + message.serviceLevelObjectives[i] = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjectives[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CreateUptimeCheckConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListServiceLevelObjectivesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @static - * @param {google.monitoring.v3.CreateUptimeCheckConfigRequest} message CreateUptimeCheckConfigRequest + * @param {google.monitoring.v3.ListServiceLevelObjectivesResponse} message ListServiceLevelObjectivesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateUptimeCheckConfigRequest.toObject = function toObject(message, options) { + ListServiceLevelObjectivesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.uptimeCheckConfig = null; + if (options.arrays || options.defaults) + object.serviceLevelObjectives = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.serviceLevelObjectives && message.serviceLevelObjectives.length) { + object.serviceLevelObjectives = []; + for (var j = 0; j < message.serviceLevelObjectives.length; ++j) + object.serviceLevelObjectives[j] = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjectives[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) - object.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.toObject(message.uptimeCheckConfig, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CreateUptimeCheckConfigRequest to JSON. + * Converts this ListServiceLevelObjectivesResponse to JSON. * @function toJSON - * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.ListServiceLevelObjectivesResponse * @instance * @returns {Object.} JSON object */ - CreateUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + ListServiceLevelObjectivesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateUptimeCheckConfigRequest; + return ListServiceLevelObjectivesResponse; })(); - v3.UpdateUptimeCheckConfigRequest = (function() { + v3.UpdateServiceLevelObjectiveRequest = (function() { /** - * Properties of an UpdateUptimeCheckConfigRequest. + * Properties of an UpdateServiceLevelObjectiveRequest. * @memberof google.monitoring.v3 - * @interface IUpdateUptimeCheckConfigRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUptimeCheckConfigRequest updateMask - * @property {google.monitoring.v3.IUptimeCheckConfig|null} [uptimeCheckConfig] UpdateUptimeCheckConfigRequest uptimeCheckConfig + * @interface IUpdateServiceLevelObjectiveRequest + * @property {google.monitoring.v3.IServiceLevelObjective|null} [serviceLevelObjective] UpdateServiceLevelObjectiveRequest serviceLevelObjective + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServiceLevelObjectiveRequest updateMask */ /** - * Constructs a new UpdateUptimeCheckConfigRequest. + * Constructs a new UpdateServiceLevelObjectiveRequest. * @memberof google.monitoring.v3 - * @classdesc Represents an UpdateUptimeCheckConfigRequest. - * @implements IUpdateUptimeCheckConfigRequest + * @classdesc Represents an UpdateServiceLevelObjectiveRequest. + * @implements IUpdateServiceLevelObjectiveRequest * @constructor - * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest=} [properties] Properties to set */ - function UpdateUptimeCheckConfigRequest(properties) { + function UpdateServiceLevelObjectiveRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24252,89 +22987,89 @@ } /** - * UpdateUptimeCheckConfigRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * UpdateServiceLevelObjectiveRequest serviceLevelObjective. + * @member {google.monitoring.v3.IServiceLevelObjective|null|undefined} serviceLevelObjective + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @instance */ - UpdateUptimeCheckConfigRequest.prototype.updateMask = null; + UpdateServiceLevelObjectiveRequest.prototype.serviceLevelObjective = null; /** - * UpdateUptimeCheckConfigRequest uptimeCheckConfig. - * @member {google.monitoring.v3.IUptimeCheckConfig|null|undefined} uptimeCheckConfig - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * UpdateServiceLevelObjectiveRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @instance */ - UpdateUptimeCheckConfigRequest.prototype.uptimeCheckConfig = null; + UpdateServiceLevelObjectiveRequest.prototype.updateMask = null; /** - * Creates a new UpdateUptimeCheckConfigRequest instance using the specified properties. + * Creates a new UpdateServiceLevelObjectiveRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest instance + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest instance */ - UpdateUptimeCheckConfigRequest.create = function create(properties) { - return new UpdateUptimeCheckConfigRequest(properties); + UpdateServiceLevelObjectiveRequest.create = function create(properties) { + return new UpdateServiceLevelObjectiveRequest(properties); }; /** - * Encodes the specified UpdateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified UpdateServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} message UpdateUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateUptimeCheckConfigRequest.encode = function encode(message, writer) { + UpdateServiceLevelObjectiveRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + $root.google.monitoring.v3.ServiceLevelObjective.encode(message.serviceLevelObjective, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && message.hasOwnProperty("updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) - $root.google.monitoring.v3.UptimeCheckConfig.encode(message.uptimeCheckConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified UpdateServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateServiceLevelObjectiveRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} message UpdateUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IUpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer. + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateUptimeCheckConfigRequest.decode = function decode(reader, length) { + UpdateServiceLevelObjectiveRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.decode(reader, reader.uint32()); + break; case 2: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; - case 3: - message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -24344,126 +23079,126 @@ }; /** - * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateUptimeCheckConfigRequest message. + * Verifies an UpdateServiceLevelObjectiveRequest message. * @function verify - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateUptimeCheckConfigRequest.verify = function verify(message) { + UpdateServiceLevelObjectiveRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) { + var error = $root.google.monitoring.v3.ServiceLevelObjective.verify(message.serviceLevelObjective); + if (error) + return "serviceLevelObjective." + error; + } if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) return "updateMask." + error; } - if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) { - var error = $root.google.monitoring.v3.UptimeCheckConfig.verify(message.uptimeCheckConfig); - if (error) - return "uptimeCheckConfig." + error; - } return null; }; /** - * Creates an UpdateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest + * @returns {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} UpdateServiceLevelObjectiveRequest */ - UpdateUptimeCheckConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest) + UpdateServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest) return object; - var message = new $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest(); + var message = new $root.google.monitoring.v3.UpdateServiceLevelObjectiveRequest(); + if (object.serviceLevelObjective != null) { + if (typeof object.serviceLevelObjective !== "object") + throw TypeError(".google.monitoring.v3.UpdateServiceLevelObjectiveRequest.serviceLevelObjective: object expected"); + message.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.fromObject(object.serviceLevelObjective); + } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.monitoring.v3.UpdateUptimeCheckConfigRequest.updateMask: object expected"); + throw TypeError(".google.monitoring.v3.UpdateServiceLevelObjectiveRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.uptimeCheckConfig != null) { - if (typeof object.uptimeCheckConfig !== "object") - throw TypeError(".google.monitoring.v3.UpdateUptimeCheckConfigRequest.uptimeCheckConfig: object expected"); - message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.fromObject(object.uptimeCheckConfig); - } return message; }; /** - * Creates a plain object from an UpdateUptimeCheckConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateServiceLevelObjectiveRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.UpdateUptimeCheckConfigRequest} message UpdateUptimeCheckConfigRequest + * @param {google.monitoring.v3.UpdateServiceLevelObjectiveRequest} message UpdateServiceLevelObjectiveRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateUptimeCheckConfigRequest.toObject = function toObject(message, options) { + UpdateServiceLevelObjectiveRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.serviceLevelObjective = null; object.updateMask = null; - object.uptimeCheckConfig = null; } + if (message.serviceLevelObjective != null && message.hasOwnProperty("serviceLevelObjective")) + object.serviceLevelObjective = $root.google.monitoring.v3.ServiceLevelObjective.toObject(message.serviceLevelObjective, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) - object.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.toObject(message.uptimeCheckConfig, options); return object; }; /** - * Converts this UpdateUptimeCheckConfigRequest to JSON. + * Converts this UpdateServiceLevelObjectiveRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @memberof google.monitoring.v3.UpdateServiceLevelObjectiveRequest * @instance * @returns {Object.} JSON object */ - UpdateUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + UpdateServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateUptimeCheckConfigRequest; + return UpdateServiceLevelObjectiveRequest; })(); - v3.DeleteUptimeCheckConfigRequest = (function() { + v3.DeleteServiceLevelObjectiveRequest = (function() { /** - * Properties of a DeleteUptimeCheckConfigRequest. + * Properties of a DeleteServiceLevelObjectiveRequest. * @memberof google.monitoring.v3 - * @interface IDeleteUptimeCheckConfigRequest - * @property {string|null} [name] DeleteUptimeCheckConfigRequest name + * @interface IDeleteServiceLevelObjectiveRequest + * @property {string|null} [name] DeleteServiceLevelObjectiveRequest name */ /** - * Constructs a new DeleteUptimeCheckConfigRequest. + * Constructs a new DeleteServiceLevelObjectiveRequest. * @memberof google.monitoring.v3 - * @classdesc Represents a DeleteUptimeCheckConfigRequest. - * @implements IDeleteUptimeCheckConfigRequest + * @classdesc Represents a DeleteServiceLevelObjectiveRequest. + * @implements IDeleteServiceLevelObjectiveRequest * @constructor - * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest=} [properties] Properties to set + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest=} [properties] Properties to set */ - function DeleteUptimeCheckConfigRequest(properties) { + function DeleteServiceLevelObjectiveRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24471,35 +23206,35 @@ } /** - * DeleteUptimeCheckConfigRequest name. + * DeleteServiceLevelObjectiveRequest name. * @member {string} name - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @instance */ - DeleteUptimeCheckConfigRequest.prototype.name = ""; + DeleteServiceLevelObjectiveRequest.prototype.name = ""; /** - * Creates a new DeleteUptimeCheckConfigRequest instance using the specified properties. + * Creates a new DeleteServiceLevelObjectiveRequest instance using the specified properties. * @function create - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest instance + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest instance */ - DeleteUptimeCheckConfigRequest.create = function create(properties) { - return new DeleteUptimeCheckConfigRequest(properties); + DeleteServiceLevelObjectiveRequest.create = function create(properties) { + return new DeleteServiceLevelObjectiveRequest(properties); }; /** - * Encodes the specified DeleteUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified DeleteServiceLevelObjectiveRequest message. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} message DeleteUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteUptimeCheckConfigRequest.encode = function encode(message, writer) { + DeleteServiceLevelObjectiveRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) @@ -24508,33 +23243,33 @@ }; /** - * Encodes the specified DeleteUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. + * Encodes the specified DeleteServiceLevelObjectiveRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteServiceLevelObjectiveRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} message DeleteUptimeCheckConfigRequest message or plain object to encode + * @param {google.monitoring.v3.IDeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteServiceLevelObjectiveRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer. + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteUptimeCheckConfigRequest.decode = function decode(reader, length) { + DeleteServiceLevelObjectiveRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -24550,30 +23285,30 @@ }; /** - * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteServiceLevelObjectiveRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteServiceLevelObjectiveRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteUptimeCheckConfigRequest message. + * Verifies a DeleteServiceLevelObjectiveRequest message. * @function verify - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteUptimeCheckConfigRequest.verify = function verify(message) { + DeleteServiceLevelObjectiveRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -24583,32 +23318,32 @@ }; /** - * Creates a DeleteUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteServiceLevelObjectiveRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest + * @returns {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} DeleteServiceLevelObjectiveRequest */ - DeleteUptimeCheckConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest) + DeleteServiceLevelObjectiveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest) return object; - var message = new $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest(); + var message = new $root.google.monitoring.v3.DeleteServiceLevelObjectiveRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteUptimeCheckConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteServiceLevelObjectiveRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @static - * @param {google.monitoring.v3.DeleteUptimeCheckConfigRequest} message DeleteUptimeCheckConfigRequest + * @param {google.monitoring.v3.DeleteServiceLevelObjectiveRequest} message DeleteServiceLevelObjectiveRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteUptimeCheckConfigRequest.toObject = function toObject(message, options) { + DeleteServiceLevelObjectiveRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -24620,38 +23355,37 @@ }; /** - * Converts this DeleteUptimeCheckConfigRequest to JSON. + * Converts this DeleteServiceLevelObjectiveRequest to JSON. * @function toJSON - * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @memberof google.monitoring.v3.DeleteServiceLevelObjectiveRequest * @instance * @returns {Object.} JSON object */ - DeleteUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + DeleteServiceLevelObjectiveRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteUptimeCheckConfigRequest; + return DeleteServiceLevelObjectiveRequest; })(); - v3.ListUptimeCheckIpsRequest = (function() { + v3.SpanContext = (function() { /** - * Properties of a ListUptimeCheckIpsRequest. + * Properties of a SpanContext. * @memberof google.monitoring.v3 - * @interface IListUptimeCheckIpsRequest - * @property {number|null} [pageSize] ListUptimeCheckIpsRequest pageSize - * @property {string|null} [pageToken] ListUptimeCheckIpsRequest pageToken + * @interface ISpanContext + * @property {string|null} [spanName] SpanContext spanName */ /** - * Constructs a new ListUptimeCheckIpsRequest. + * Constructs a new SpanContext. * @memberof google.monitoring.v3 - * @classdesc Represents a ListUptimeCheckIpsRequest. - * @implements IListUptimeCheckIpsRequest + * @classdesc Represents a SpanContext. + * @implements ISpanContext * @constructor - * @param {google.monitoring.v3.IListUptimeCheckIpsRequest=} [properties] Properties to set + * @param {google.monitoring.v3.ISpanContext=} [properties] Properties to set */ - function ListUptimeCheckIpsRequest(properties) { + function SpanContext(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24659,88 +23393,75 @@ } /** - * ListUptimeCheckIpsRequest pageSize. - * @member {number} pageSize - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest - * @instance - */ - ListUptimeCheckIpsRequest.prototype.pageSize = 0; - - /** - * ListUptimeCheckIpsRequest pageToken. - * @member {string} pageToken - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * SpanContext spanName. + * @member {string} spanName + * @memberof google.monitoring.v3.SpanContext * @instance */ - ListUptimeCheckIpsRequest.prototype.pageToken = ""; + SpanContext.prototype.spanName = ""; /** - * Creates a new ListUptimeCheckIpsRequest instance using the specified properties. + * Creates a new SpanContext instance using the specified properties. * @function create - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static - * @param {google.monitoring.v3.IListUptimeCheckIpsRequest=} [properties] Properties to set - * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest instance + * @param {google.monitoring.v3.ISpanContext=} [properties] Properties to set + * @returns {google.monitoring.v3.SpanContext} SpanContext instance */ - ListUptimeCheckIpsRequest.create = function create(properties) { - return new ListUptimeCheckIpsRequest(properties); + SpanContext.create = function create(properties) { + return new SpanContext(properties); }; /** - * Encodes the specified ListUptimeCheckIpsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. + * Encodes the specified SpanContext message. Does not implicitly {@link google.monitoring.v3.SpanContext.verify|verify} messages. * @function encode - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static - * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} message ListUptimeCheckIpsRequest message or plain object to encode + * @param {google.monitoring.v3.ISpanContext} message SpanContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListUptimeCheckIpsRequest.encode = function encode(message, writer) { + SpanContext.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.spanName != null && message.hasOwnProperty("spanName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.spanName); return writer; }; /** - * Encodes the specified ListUptimeCheckIpsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. + * Encodes the specified SpanContext message, length delimited. Does not implicitly {@link google.monitoring.v3.SpanContext.verify|verify} messages. * @function encodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static - * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} message ListUptimeCheckIpsRequest message or plain object to encode + * @param {google.monitoring.v3.ISpanContext} message SpanContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListUptimeCheckIpsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SpanContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer. + * Decodes a SpanContext message from the specified reader or buffer. * @function decode - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest + * @returns {google.monitoring.v3.SpanContext} SpanContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListUptimeCheckIpsRequest.decode = function decode(reader, length) { + SpanContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckIpsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.SpanContext(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); + case 1: + message.spanName = reader.string(); break; default: reader.skipType(tag & 7); @@ -24751,341 +23472,121 @@ }; /** - * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer, length delimited. + * Decodes a SpanContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest + * @returns {google.monitoring.v3.SpanContext} SpanContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListUptimeCheckIpsRequest.decodeDelimited = function decodeDelimited(reader) { + SpanContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListUptimeCheckIpsRequest message. + * Verifies a SpanContext message. * @function verify - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListUptimeCheckIpsRequest.verify = function verify(message) { + SpanContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.spanName != null && message.hasOwnProperty("spanName")) + if (!$util.isString(message.spanName)) + return "spanName: string expected"; return null; }; /** - * Creates a ListUptimeCheckIpsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SpanContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest + * @returns {google.monitoring.v3.SpanContext} SpanContext */ - ListUptimeCheckIpsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListUptimeCheckIpsRequest) + SpanContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.SpanContext) return object; - var message = new $root.google.monitoring.v3.ListUptimeCheckIpsRequest(); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.monitoring.v3.SpanContext(); + if (object.spanName != null) + message.spanName = String(object.spanName); return message; }; /** - * Creates a plain object from a ListUptimeCheckIpsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SpanContext message. Also converts values to other types if specified. * @function toObject - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @static - * @param {google.monitoring.v3.ListUptimeCheckIpsRequest} message ListUptimeCheckIpsRequest + * @param {google.monitoring.v3.SpanContext} message SpanContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListUptimeCheckIpsRequest.toObject = function toObject(message, options) { + SpanContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (options.defaults) + object.spanName = ""; + if (message.spanName != null && message.hasOwnProperty("spanName")) + object.spanName = message.spanName; return object; }; /** - * Converts this ListUptimeCheckIpsRequest to JSON. + * Converts this SpanContext to JSON. * @function toJSON - * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @memberof google.monitoring.v3.SpanContext * @instance * @returns {Object.} JSON object */ - ListUptimeCheckIpsRequest.prototype.toJSON = function toJSON() { + SpanContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListUptimeCheckIpsRequest; + return SpanContext; })(); - v3.ListUptimeCheckIpsResponse = (function() { + /** + * UptimeCheckRegion enum. + * @name google.monitoring.v3.UptimeCheckRegion + * @enum {string} + * @property {number} REGION_UNSPECIFIED=0 REGION_UNSPECIFIED value + * @property {number} USA=1 USA value + * @property {number} EUROPE=2 EUROPE value + * @property {number} SOUTH_AMERICA=3 SOUTH_AMERICA value + * @property {number} ASIA_PACIFIC=4 ASIA_PACIFIC value + */ + v3.UptimeCheckRegion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REGION_UNSPECIFIED"] = 0; + values[valuesById[1] = "USA"] = 1; + values[valuesById[2] = "EUROPE"] = 2; + values[valuesById[3] = "SOUTH_AMERICA"] = 3; + values[valuesById[4] = "ASIA_PACIFIC"] = 4; + return values; + })(); + + v3.InternalChecker = (function() { /** - * Properties of a ListUptimeCheckIpsResponse. + * Properties of an InternalChecker. * @memberof google.monitoring.v3 - * @interface IListUptimeCheckIpsResponse - * @property {Array.|null} [uptimeCheckIps] ListUptimeCheckIpsResponse uptimeCheckIps - * @property {string|null} [nextPageToken] ListUptimeCheckIpsResponse nextPageToken - */ - - /** - * Constructs a new ListUptimeCheckIpsResponse. - * @memberof google.monitoring.v3 - * @classdesc Represents a ListUptimeCheckIpsResponse. - * @implements IListUptimeCheckIpsResponse - * @constructor - * @param {google.monitoring.v3.IListUptimeCheckIpsResponse=} [properties] Properties to set - */ - function ListUptimeCheckIpsResponse(properties) { - this.uptimeCheckIps = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListUptimeCheckIpsResponse uptimeCheckIps. - * @member {Array.} uptimeCheckIps - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @instance - */ - ListUptimeCheckIpsResponse.prototype.uptimeCheckIps = $util.emptyArray; - - /** - * ListUptimeCheckIpsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @instance - */ - ListUptimeCheckIpsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListUptimeCheckIpsResponse instance using the specified properties. - * @function create - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {google.monitoring.v3.IListUptimeCheckIpsResponse=} [properties] Properties to set - * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse instance - */ - ListUptimeCheckIpsResponse.create = function create(properties) { - return new ListUptimeCheckIpsResponse(properties); - }; - - /** - * Encodes the specified ListUptimeCheckIpsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. - * @function encode - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {google.monitoring.v3.IListUptimeCheckIpsResponse} message ListUptimeCheckIpsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUptimeCheckIpsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uptimeCheckIps != null && message.uptimeCheckIps.length) - for (var i = 0; i < message.uptimeCheckIps.length; ++i) - $root.google.monitoring.v3.UptimeCheckIp.encode(message.uptimeCheckIps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListUptimeCheckIpsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {google.monitoring.v3.IListUptimeCheckIpsResponse} message ListUptimeCheckIpsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUptimeCheckIpsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUptimeCheckIpsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckIpsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.uptimeCheckIps && message.uptimeCheckIps.length)) - message.uptimeCheckIps = []; - message.uptimeCheckIps.push($root.google.monitoring.v3.UptimeCheckIp.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUptimeCheckIpsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUptimeCheckIpsResponse message. - * @function verify - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUptimeCheckIpsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uptimeCheckIps != null && message.hasOwnProperty("uptimeCheckIps")) { - if (!Array.isArray(message.uptimeCheckIps)) - return "uptimeCheckIps: array expected"; - for (var i = 0; i < message.uptimeCheckIps.length; ++i) { - var error = $root.google.monitoring.v3.UptimeCheckIp.verify(message.uptimeCheckIps[i]); - if (error) - return "uptimeCheckIps." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListUptimeCheckIpsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse - */ - ListUptimeCheckIpsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.monitoring.v3.ListUptimeCheckIpsResponse) - return object; - var message = new $root.google.monitoring.v3.ListUptimeCheckIpsResponse(); - if (object.uptimeCheckIps) { - if (!Array.isArray(object.uptimeCheckIps)) - throw TypeError(".google.monitoring.v3.ListUptimeCheckIpsResponse.uptimeCheckIps: array expected"); - message.uptimeCheckIps = []; - for (var i = 0; i < object.uptimeCheckIps.length; ++i) { - if (typeof object.uptimeCheckIps[i] !== "object") - throw TypeError(".google.monitoring.v3.ListUptimeCheckIpsResponse.uptimeCheckIps: object expected"); - message.uptimeCheckIps[i] = $root.google.monitoring.v3.UptimeCheckIp.fromObject(object.uptimeCheckIps[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListUptimeCheckIpsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @static - * @param {google.monitoring.v3.ListUptimeCheckIpsResponse} message ListUptimeCheckIpsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUptimeCheckIpsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uptimeCheckIps = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.uptimeCheckIps && message.uptimeCheckIps.length) { - object.uptimeCheckIps = []; - for (var j = 0; j < message.uptimeCheckIps.length; ++j) - object.uptimeCheckIps[j] = $root.google.monitoring.v3.UptimeCheckIp.toObject(message.uptimeCheckIps[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListUptimeCheckIpsResponse to JSON. - * @function toJSON - * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse - * @instance - * @returns {Object.} JSON object - */ - ListUptimeCheckIpsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListUptimeCheckIpsResponse; - })(); - - v3.InternalChecker = (function() { - - /** - * Properties of an InternalChecker. - * @memberof google.monitoring.v3 - * @interface IInternalChecker - * @property {string|null} [name] InternalChecker name - * @property {string|null} [displayName] InternalChecker displayName - * @property {string|null} [network] InternalChecker network - * @property {string|null} [gcpZone] InternalChecker gcpZone - * @property {string|null} [peerProjectId] InternalChecker peerProjectId - * @property {google.monitoring.v3.InternalChecker.State|null} [state] InternalChecker state + * @interface IInternalChecker + * @property {string|null} [name] InternalChecker name + * @property {string|null} [displayName] InternalChecker displayName + * @property {string|null} [network] InternalChecker network + * @property {string|null} [gcpZone] InternalChecker gcpZone + * @property {string|null} [peerProjectId] InternalChecker peerProjectId + * @property {google.monitoring.v3.InternalChecker.State|null} [state] InternalChecker state */ /** @@ -27245,22 +25746,18 @@ })(); /** - * UptimeCheckRegion enum. - * @name google.monitoring.v3.UptimeCheckRegion + * GroupResourceType enum. + * @name google.monitoring.v3.GroupResourceType * @enum {string} - * @property {number} REGION_UNSPECIFIED=0 REGION_UNSPECIFIED value - * @property {number} USA=1 USA value - * @property {number} EUROPE=2 EUROPE value - * @property {number} SOUTH_AMERICA=3 SOUTH_AMERICA value - * @property {number} ASIA_PACIFIC=4 ASIA_PACIFIC value + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} INSTANCE=1 INSTANCE value + * @property {number} AWS_ELB_LOAD_BALANCER=2 AWS_ELB_LOAD_BALANCER value */ - v3.UptimeCheckRegion = (function() { + v3.GroupResourceType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REGION_UNSPECIFIED"] = 0; - values[valuesById[1] = "USA"] = 1; - values[valuesById[2] = "EUROPE"] = 2; - values[valuesById[3] = "SOUTH_AMERICA"] = 3; - values[valuesById[4] = "ASIA_PACIFIC"] = 4; + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTANCE"] = 1; + values[valuesById[2] = "AWS_ELB_LOAD_BALANCER"] = 2; return values; })(); @@ -27524,2028 +26021,1235 @@ return UptimeCheckIp; })(); - /** - * GroupResourceType enum. - * @name google.monitoring.v3.GroupResourceType - * @enum {string} - * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value - * @property {number} INSTANCE=1 INSTANCE value - * @property {number} AWS_ELB_LOAD_BALANCER=2 AWS_ELB_LOAD_BALANCER value - */ - v3.GroupResourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INSTANCE"] = 1; - values[valuesById[2] = "AWS_ELB_LOAD_BALANCER"] = 2; - return values; - })(); + v3.UptimeCheckService = (function() { - return v3; - })(); + /** + * Constructs a new UptimeCheckService service. + * @memberof google.monitoring.v3 + * @classdesc Represents an UptimeCheckService + * @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 UptimeCheckService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - return monitoring; - })(); + (UptimeCheckService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UptimeCheckService; - google.api = (function() { + /** + * Creates new UptimeCheckService service using the specified rpc implementation. + * @function create + * @memberof google.monitoring.v3.UptimeCheckService + * @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 {UptimeCheckService} RPC service. Useful where requests and/or responses are streamed. + */ + UptimeCheckService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckConfigs}. + * @memberof google.monitoring.v3.UptimeCheckService + * @typedef ListUptimeCheckConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListUptimeCheckConfigsResponse} [response] ListUptimeCheckConfigsResponse + */ - api.Http = (function() { + /** + * Calls ListUptimeCheckConfigs. + * @function listUptimeCheckConfigs + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} request ListUptimeCheckConfigsRequest message or plain object + * @param {google.monitoring.v3.UptimeCheckService.ListUptimeCheckConfigsCallback} callback Node-style callback called with the error, if any, and ListUptimeCheckConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UptimeCheckService.prototype.listUptimeCheckConfigs = function listUptimeCheckConfigs(request, callback) { + return this.rpcCall(listUptimeCheckConfigs, $root.google.monitoring.v3.ListUptimeCheckConfigsRequest, $root.google.monitoring.v3.ListUptimeCheckConfigsResponse, request, callback); + }, "name", { value: "ListUptimeCheckConfigs" }); - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ + /** + * Calls ListUptimeCheckConfigs. + * @function listUptimeCheckConfigs + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} request ListUptimeCheckConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#getUptimeCheckConfig}. + * @memberof google.monitoring.v3.UptimeCheckService + * @typedef GetUptimeCheckConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.UptimeCheckConfig} [response] UptimeCheckConfig + */ - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; + /** + * Calls GetUptimeCheckConfig. + * @function getUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} request GetUptimeCheckConfigRequest message or plain object + * @param {google.monitoring.v3.UptimeCheckService.GetUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and UptimeCheckConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UptimeCheckService.prototype.getUptimeCheckConfig = function getUptimeCheckConfig(request, callback) { + return this.rpcCall(getUptimeCheckConfig, $root.google.monitoring.v3.GetUptimeCheckConfigRequest, $root.google.monitoring.v3.UptimeCheckConfig, request, callback); + }, "name", { value: "GetUptimeCheckConfig" }); - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; + /** + * Calls GetUptimeCheckConfig. + * @function getUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} request GetUptimeCheckConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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); - }; + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#createUptimeCheckConfig}. + * @memberof google.monitoring.v3.UptimeCheckService + * @typedef CreateUptimeCheckConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.UptimeCheckConfig} [response] UptimeCheckConfig + */ - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; + /** + * Calls CreateUptimeCheckConfig. + * @function createUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} request CreateUptimeCheckConfigRequest message or plain object + * @param {google.monitoring.v3.UptimeCheckService.CreateUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and UptimeCheckConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UptimeCheckService.prototype.createUptimeCheckConfig = function createUptimeCheckConfig(request, callback) { + return this.rpcCall(createUptimeCheckConfig, $root.google.monitoring.v3.CreateUptimeCheckConfigRequest, $root.google.monitoring.v3.UptimeCheckConfig, request, callback); + }, "name", { value: "CreateUptimeCheckConfig" }); - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls CreateUptimeCheckConfig. + * @function createUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} request CreateUptimeCheckConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#updateUptimeCheckConfig}. + * @memberof google.monitoring.v3.UptimeCheckService + * @typedef UpdateUptimeCheckConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.UptimeCheckConfig} [response] UptimeCheckConfig + */ - /** - * 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()); - }; + /** + * Calls UpdateUptimeCheckConfig. + * @function updateUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} request UpdateUptimeCheckConfigRequest message or plain object + * @param {google.monitoring.v3.UptimeCheckService.UpdateUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and UptimeCheckConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UptimeCheckService.prototype.updateUptimeCheckConfig = function updateUptimeCheckConfig(request, callback) { + return this.rpcCall(updateUptimeCheckConfig, $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest, $root.google.monitoring.v3.UptimeCheckConfig, request, callback); + }, "name", { value: "UpdateUptimeCheckConfig" }); - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; + /** + * Calls UpdateUptimeCheckConfig. + * @function updateUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} request UpdateUptimeCheckConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#deleteUptimeCheckConfig}. + * @memberof google.monitoring.v3.UptimeCheckService + * @typedef DeleteUptimeCheckConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; + /** + * Calls DeleteUptimeCheckConfig. + * @function deleteUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} request DeleteUptimeCheckConfigRequest message or plain object + * @param {google.monitoring.v3.UptimeCheckService.DeleteUptimeCheckConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UptimeCheckService.prototype.deleteUptimeCheckConfig = function deleteUptimeCheckConfig(request, callback) { + return this.rpcCall(deleteUptimeCheckConfig, $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUptimeCheckConfig" }); - /** - * 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); - }; + /** + * Calls DeleteUptimeCheckConfig. + * @function deleteUptimeCheckConfig + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} request DeleteUptimeCheckConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return Http; - })(); + /** + * Callback as used by {@link google.monitoring.v3.UptimeCheckService#listUptimeCheckIps}. + * @memberof google.monitoring.v3.UptimeCheckService + * @typedef ListUptimeCheckIpsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.monitoring.v3.ListUptimeCheckIpsResponse} [response] ListUptimeCheckIpsResponse + */ - api.HttpRule = (function() { + /** + * Calls ListUptimeCheckIps. + * @function listUptimeCheckIps + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} request ListUptimeCheckIpsRequest message or plain object + * @param {google.monitoring.v3.UptimeCheckService.ListUptimeCheckIpsCallback} callback Node-style callback called with the error, if any, and ListUptimeCheckIpsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UptimeCheckService.prototype.listUptimeCheckIps = function listUptimeCheckIps(request, callback) { + return this.rpcCall(listUptimeCheckIps, $root.google.monitoring.v3.ListUptimeCheckIpsRequest, $root.google.monitoring.v3.ListUptimeCheckIpsResponse, request, callback); + }, "name", { value: "ListUptimeCheckIps" }); - /** - * 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 - */ + /** + * Calls ListUptimeCheckIps. + * @function listUptimeCheckIps + * @memberof google.monitoring.v3.UptimeCheckService + * @instance + * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} request ListUptimeCheckIpsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return UptimeCheckService; + })(); - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; + v3.ListUptimeCheckConfigsRequest = (function() { - /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; + /** + * Properties of a ListUptimeCheckConfigsRequest. + * @memberof google.monitoring.v3 + * @interface IListUptimeCheckConfigsRequest + * @property {string|null} [parent] ListUptimeCheckConfigsRequest parent + * @property {number|null} [pageSize] ListUptimeCheckConfigsRequest pageSize + * @property {string|null} [pageToken] ListUptimeCheckConfigsRequest pageToken + */ - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; + /** + * Constructs a new ListUptimeCheckConfigsRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListUptimeCheckConfigsRequest. + * @implements IListUptimeCheckConfigsRequest + * @constructor + * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest=} [properties] Properties to set + */ + function ListUptimeCheckConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; + /** + * ListUptimeCheckConfigsRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @instance + */ + ListUptimeCheckConfigsRequest.prototype.parent = ""; - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; + /** + * ListUptimeCheckConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @instance + */ + ListUptimeCheckConfigsRequest.prototype.pageSize = 0; - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = ""; + /** + * ListUptimeCheckConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @instance + */ + ListUptimeCheckConfigsRequest.prototype.pageToken = ""; - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + /** + * Creates a new ListUptimeCheckConfigsRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest instance + */ + ListUptimeCheckConfigsRequest.create = function create(properties) { + return new ListUptimeCheckConfigsRequest(properties); + }; - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; + /** + * Encodes the specified ListUptimeCheckConfigsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} message ListUptimeCheckConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUptimeCheckConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; + /** + * Encodes the specified ListUptimeCheckConfigsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {google.monitoring.v3.IListUptimeCheckConfigsRequest} message ListUptimeCheckConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUptimeCheckConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; + /** + * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUptimeCheckConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Decodes a ListUptimeCheckConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUptimeCheckConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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) - }); + /** + * Verifies a ListUptimeCheckConfigsRequest message. + * @function verify + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUptimeCheckConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; + /** + * Creates a ListUptimeCheckConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListUptimeCheckConfigsRequest} ListUptimeCheckConfigsRequest + */ + ListUptimeCheckConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListUptimeCheckConfigsRequest) + return object; + var message = new $root.google.monitoring.v3.ListUptimeCheckConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; + /** + * Creates a plain object from a ListUptimeCheckConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @static + * @param {google.monitoring.v3.ListUptimeCheckConfigsRequest} message ListUptimeCheckConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUptimeCheckConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this ListUptimeCheckConfigsRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListUptimeCheckConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUptimeCheckConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return ListUptimeCheckConfigsRequest; + })(); - /** - * 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()); - }; + v3.ListUptimeCheckConfigsResponse = (function() { - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } + /** + * Properties of a ListUptimeCheckConfigsResponse. + * @memberof google.monitoring.v3 + * @interface IListUptimeCheckConfigsResponse + * @property {Array.|null} [uptimeCheckConfigs] ListUptimeCheckConfigsResponse uptimeCheckConfigs + * @property {string|null} [nextPageToken] ListUptimeCheckConfigsResponse nextPageToken + * @property {number|null} [totalSize] ListUptimeCheckConfigsResponse totalSize + */ + + /** + * Constructs a new ListUptimeCheckConfigsResponse. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListUptimeCheckConfigsResponse. + * @implements IListUptimeCheckConfigsResponse + * @constructor + * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse=} [properties] Properties to set + */ + function ListUptimeCheckConfigsResponse(properties) { + this.uptimeCheckConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return null; - }; - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * 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); - }; + /** + * ListUptimeCheckConfigsResponse uptimeCheckConfigs. + * @member {Array.} uptimeCheckConfigs + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @instance + */ + ListUptimeCheckConfigsResponse.prototype.uptimeCheckConfigs = $util.emptyArray; - return HttpRule; - })(); + /** + * ListUptimeCheckConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @instance + */ + ListUptimeCheckConfigsResponse.prototype.nextPageToken = ""; - api.CustomHttpPattern = (function() { + /** + * ListUptimeCheckConfigsResponse totalSize. + * @member {number} totalSize + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @instance + */ + ListUptimeCheckConfigsResponse.prototype.totalSize = 0; - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ + /** + * Creates a new ListUptimeCheckConfigsResponse instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse instance + */ + ListUptimeCheckConfigsResponse.create = function create(properties) { + return new ListUptimeCheckConfigsResponse(properties); + }; - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified ListUptimeCheckConfigsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse} message ListUptimeCheckConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUptimeCheckConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uptimeCheckConfigs != null && message.uptimeCheckConfigs.length) + for (var i = 0; i < message.uptimeCheckConfigs.length; ++i) + $root.google.monitoring.v3.UptimeCheckConfig.encode(message.uptimeCheckConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalSize); + return writer; + }; - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; + /** + * Encodes the specified ListUptimeCheckConfigsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {google.monitoring.v3.IListUptimeCheckConfigsResponse} message ListUptimeCheckConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUptimeCheckConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; + /** + * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUptimeCheckConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.uptimeCheckConfigs && message.uptimeCheckConfigs.length)) + message.uptimeCheckConfigs = []; + message.uptimeCheckConfigs.push($root.google.monitoring.v3.UptimeCheckConfig.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + message.totalSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a ListUptimeCheckConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUptimeCheckConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; + /** + * Verifies a ListUptimeCheckConfigsResponse message. + * @function verify + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUptimeCheckConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uptimeCheckConfigs != null && message.hasOwnProperty("uptimeCheckConfigs")) { + if (!Array.isArray(message.uptimeCheckConfigs)) + return "uptimeCheckConfigs: array expected"; + for (var i = 0; i < message.uptimeCheckConfigs.length; ++i) { + var error = $root.google.monitoring.v3.UptimeCheckConfig.verify(message.uptimeCheckConfigs[i]); + if (error) + return "uptimeCheckConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + if (!$util.isInteger(message.totalSize)) + return "totalSize: integer expected"; + return null; + }; - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a ListUptimeCheckConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListUptimeCheckConfigsResponse} ListUptimeCheckConfigsResponse + */ + ListUptimeCheckConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListUptimeCheckConfigsResponse) + return object; + var message = new $root.google.monitoring.v3.ListUptimeCheckConfigsResponse(); + if (object.uptimeCheckConfigs) { + if (!Array.isArray(object.uptimeCheckConfigs)) + throw TypeError(".google.monitoring.v3.ListUptimeCheckConfigsResponse.uptimeCheckConfigs: array expected"); + message.uptimeCheckConfigs = []; + for (var i = 0; i < object.uptimeCheckConfigs.length; ++i) { + if (typeof object.uptimeCheckConfigs[i] !== "object") + throw TypeError(".google.monitoring.v3.ListUptimeCheckConfigsResponse.uptimeCheckConfigs: object expected"); + message.uptimeCheckConfigs[i] = $root.google.monitoring.v3.UptimeCheckConfig.fromObject(object.uptimeCheckConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a ListUptimeCheckConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @static + * @param {google.monitoring.v3.ListUptimeCheckConfigsResponse} message ListUptimeCheckConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUptimeCheckConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uptimeCheckConfigs = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; } - } - return message; - }; + if (message.uptimeCheckConfigs && message.uptimeCheckConfigs.length) { + object.uptimeCheckConfigs = []; + for (var j = 0; j < message.uptimeCheckConfigs.length; ++j) + object.uptimeCheckConfigs[j] = $root.google.monitoring.v3.UptimeCheckConfig.toObject(message.uptimeCheckConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; - /** - * 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()); - }; + /** + * Converts this ListUptimeCheckConfigsResponse to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListUptimeCheckConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListUptimeCheckConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; + return ListUptimeCheckConfigsResponse; + })(); - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; + v3.GetUptimeCheckConfigRequest = (function() { - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; + /** + * Properties of a GetUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @interface IGetUptimeCheckConfigRequest + * @property {string|null} [name] GetUptimeCheckConfigRequest name + */ - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CustomHttpPattern; - })(); + /** + * Constructs a new GetUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a GetUptimeCheckConfigRequest. + * @implements IGetUptimeCheckConfigRequest + * @constructor + * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest=} [properties] Properties to set + */ + function GetUptimeCheckConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @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 - */ - 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; - return values; - })(); + /** + * GetUptimeCheckConfigRequest name. + * @member {string} name + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @instance + */ + GetUptimeCheckConfigRequest.prototype.name = ""; - api.ResourceDescriptor = (function() { + /** + * Creates a new GetUptimeCheckConfigRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest instance + */ + GetUptimeCheckConfigRequest.create = function create(properties) { + return new GetUptimeCheckConfigRequest(properties); + }; - /** - * 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 - */ + /** + * Encodes the specified GetUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} message GetUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUptimeCheckConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * 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 = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified GetUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.GetUptimeCheckConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IGetUptimeCheckConfigRequest} message GetUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; + /** + * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUptimeCheckConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.GetUptimeCheckConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Decodes a GetUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; + /** + * Verifies a GetUptimeCheckConfigRequest message. + * @function verify + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUptimeCheckConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; + /** + * Creates a GetUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.GetUptimeCheckConfigRequest} GetUptimeCheckConfigRequest + */ + GetUptimeCheckConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.GetUptimeCheckConfigRequest) + return object; + var message = new $root.google.monitoring.v3.GetUptimeCheckConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; + /** + * Creates a plain object from a GetUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.GetUptimeCheckConfigRequest} message GetUptimeCheckConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUptimeCheckConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; + /** + * Converts this GetUptimeCheckConfigRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.GetUptimeCheckConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return GetUptimeCheckConfigRequest; + })(); - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - return writer; - }; + v3.CreateUptimeCheckConfigRequest = (function() { - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a CreateUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @interface ICreateUptimeCheckConfigRequest + * @property {string|null} [parent] CreateUptimeCheckConfigRequest parent + * @property {google.monitoring.v3.IUptimeCheckConfig|null} [uptimeCheckConfig] CreateUptimeCheckConfigRequest uptimeCheckConfig + */ - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new CreateUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a CreateUptimeCheckConfigRequest. + * @implements ICreateUptimeCheckConfigRequest + * @constructor + * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest=} [properties] Properties to set + */ + function CreateUptimeCheckConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return 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()); - }; + /** + * CreateUptimeCheckConfigRequest parent. + * @member {string} parent + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @instance + */ + CreateUptimeCheckConfigRequest.prototype.parent = ""; - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - return null; - }; + /** + * CreateUptimeCheckConfigRequest uptimeCheckConfig. + * @member {google.monitoring.v3.IUptimeCheckConfig|null|undefined} uptimeCheckConfig + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @instance + */ + CreateUptimeCheckConfigRequest.prototype.uptimeCheckConfig = null; - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - return message; - }; + /** + * Creates a new CreateUptimeCheckConfigRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest instance + */ + CreateUptimeCheckConfigRequest.create = function create(properties) { + return new CreateUptimeCheckConfigRequest(properties); + }; - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pattern = []; - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - 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); - }; + /** + * Encodes the specified CreateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} message CreateUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUptimeCheckConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) + $root.google.monitoring.v3.UptimeCheckConfig.encode(message.uptimeCheckConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @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; - })(); + /** + * Encodes the specified CreateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.CreateUptimeCheckConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.ICreateUptimeCheckConfigRequest} message CreateUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return ResourceDescriptor; - })(); + /** + * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUptimeCheckConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.CreateUptimeCheckConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - api.ResourceReference = (function() { + /** + * Decodes a CreateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ + /** + * Verifies a CreateUptimeCheckConfigRequest message. + * @function verify + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUptimeCheckConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) { + var error = $root.google.monitoring.v3.UptimeCheckConfig.verify(message.uptimeCheckConfig); + if (error) + return "uptimeCheckConfig." + error; + } + return null; + }; - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a CreateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.CreateUptimeCheckConfigRequest} CreateUptimeCheckConfigRequest + */ + CreateUptimeCheckConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.CreateUptimeCheckConfigRequest) + return object; + var message = new $root.google.monitoring.v3.CreateUptimeCheckConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.uptimeCheckConfig != null) { + if (typeof object.uptimeCheckConfig !== "object") + throw TypeError(".google.monitoring.v3.CreateUptimeCheckConfigRequest.uptimeCheckConfig: object expected"); + message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.fromObject(object.uptimeCheckConfig); + } + return message; + }; - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; + /** + * Creates a plain object from a CreateUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.CreateUptimeCheckConfigRequest} message CreateUptimeCheckConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUptimeCheckConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.uptimeCheckConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) + object.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.toObject(message.uptimeCheckConfig, options); + return object; + }; - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; + /** + * Converts this CreateUptimeCheckConfigRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.CreateUptimeCheckConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return CreateUptimeCheckConfigRequest; + })(); - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; + v3.UpdateUptimeCheckConfigRequest = (function() { - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of an UpdateUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @interface IUpdateUptimeCheckConfigRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUptimeCheckConfigRequest updateMask + * @property {google.monitoring.v3.IUptimeCheckConfig|null} [uptimeCheckConfig] UpdateUptimeCheckConfigRequest uptimeCheckConfig + */ - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.childType = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new UpdateUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents an UpdateUptimeCheckConfigRequest. + * @implements IUpdateUptimeCheckConfigRequest + * @constructor + * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest=} [properties] Properties to set + */ + function UpdateUptimeCheckConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; + /** + * UpdateUptimeCheckConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @instance + */ + UpdateUptimeCheckConfigRequest.prototype.updateMask = null; - /** - * 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); - }; + /** + * UpdateUptimeCheckConfigRequest uptimeCheckConfig. + * @member {google.monitoring.v3.IUptimeCheckConfig|null|undefined} uptimeCheckConfig + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @instance + */ + UpdateUptimeCheckConfigRequest.prototype.uptimeCheckConfig = null; - return ResourceReference; - })(); + /** + * Creates a new UpdateUptimeCheckConfigRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest instance + */ + UpdateUptimeCheckConfigRequest.create = function create(properties) { + return new UpdateUptimeCheckConfigRequest(properties); + }; - api.Distribution = (function() { + /** + * Encodes the specified UpdateUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} message UpdateUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUptimeCheckConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) + $root.google.monitoring.v3.UptimeCheckConfig.encode(message.uptimeCheckConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Properties of a Distribution. - * @memberof google.api - * @interface IDistribution - * @property {number|Long|null} [count] Distribution count - * @property {number|null} [mean] Distribution mean - * @property {number|null} [sumOfSquaredDeviation] Distribution sumOfSquaredDeviation - * @property {google.api.Distribution.IRange|null} [range] Distribution range - * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] Distribution bucketOptions - * @property {Array.|null} [bucketCounts] Distribution bucketCounts - * @property {Array.|null} [exemplars] Distribution exemplars - */ - - /** - * Constructs a new Distribution. - * @memberof google.api - * @classdesc Represents a Distribution. - * @implements IDistribution - * @constructor - * @param {google.api.IDistribution=} [properties] Properties to set - */ - function Distribution(properties) { - this.bucketCounts = []; - this.exemplars = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Distribution count. - * @member {number|Long} count - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Distribution mean. - * @member {number} mean - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.mean = 0; - - /** - * Distribution sumOfSquaredDeviation. - * @member {number} sumOfSquaredDeviation - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.sumOfSquaredDeviation = 0; - - /** - * Distribution range. - * @member {google.api.Distribution.IRange|null|undefined} range - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.range = null; - - /** - * Distribution bucketOptions. - * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.bucketOptions = null; - - /** - * Distribution bucketCounts. - * @member {Array.} bucketCounts - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.bucketCounts = $util.emptyArray; - - /** - * Distribution exemplars. - * @member {Array.} exemplars - * @memberof google.api.Distribution - * @instance - */ - Distribution.prototype.exemplars = $util.emptyArray; - - /** - * Creates a new Distribution instance using the specified properties. - * @function create - * @memberof google.api.Distribution - * @static - * @param {google.api.IDistribution=} [properties] Properties to set - * @returns {google.api.Distribution} Distribution instance - */ - Distribution.create = function create(properties) { - return new Distribution(properties); - }; - - /** - * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution - * @static - * @param {google.api.IDistribution} message Distribution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Distribution.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.count != null && message.hasOwnProperty("count")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); - if (message.mean != null && message.hasOwnProperty("mean")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.mean); - if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.sumOfSquaredDeviation); - if (message.range != null && message.hasOwnProperty("range")) - $root.google.api.Distribution.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) - $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.bucketCounts != null && message.bucketCounts.length) { - writer.uint32(/* id 7, wireType 2 =*/58).fork(); - for (var i = 0; i < message.bucketCounts.length; ++i) - writer.int64(message.bucketCounts[i]); - writer.ldelim(); - } - if (message.exemplars != null && message.exemplars.length) - for (var i = 0; i < message.exemplars.length; ++i) - $root.google.api.Distribution.Exemplar.encode(message.exemplars[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution - * @static - * @param {google.api.IDistribution} message Distribution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Distribution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Distribution message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution} Distribution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Distribution.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.count = reader.int64(); - break; - case 2: - message.mean = reader.double(); - break; - case 3: - message.sumOfSquaredDeviation = reader.double(); - break; - case 4: - message.range = $root.google.api.Distribution.Range.decode(reader, reader.uint32()); - break; - case 6: - message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.bucketCounts && message.bucketCounts.length)) - message.bucketCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.bucketCounts.push(reader.int64()); - } else - message.bucketCounts.push(reader.int64()); - break; - case 10: - if (!(message.exemplars && message.exemplars.length)) - message.exemplars = []; - message.exemplars.push($root.google.api.Distribution.Exemplar.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Distribution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution} Distribution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Distribution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Distribution message. - * @function verify - * @memberof google.api.Distribution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Distribution.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - if (message.mean != null && message.hasOwnProperty("mean")) - if (typeof message.mean !== "number") - return "mean: number expected"; - if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) - if (typeof message.sumOfSquaredDeviation !== "number") - return "sumOfSquaredDeviation: number expected"; - if (message.range != null && message.hasOwnProperty("range")) { - var error = $root.google.api.Distribution.Range.verify(message.range); - if (error) - return "range." + error; - } - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { - var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); - if (error) - return "bucketOptions." + error; - } - if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { - if (!Array.isArray(message.bucketCounts)) - return "bucketCounts: array expected"; - for (var i = 0; i < message.bucketCounts.length; ++i) - if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) - return "bucketCounts: integer|Long[] expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) - return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.google.api.Distribution.Exemplar.verify(message.exemplars[i]); - if (error) - return "exemplars." + error; - } - } - return null; - }; - - /** - * Creates a Distribution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution} Distribution - */ - Distribution.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution) - return object; - var message = new $root.google.api.Distribution(); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - if (object.mean != null) - message.mean = Number(object.mean); - if (object.sumOfSquaredDeviation != null) - message.sumOfSquaredDeviation = Number(object.sumOfSquaredDeviation); - if (object.range != null) { - if (typeof object.range !== "object") - throw TypeError(".google.api.Distribution.range: object expected"); - message.range = $root.google.api.Distribution.Range.fromObject(object.range); - } - if (object.bucketOptions != null) { - if (typeof object.bucketOptions !== "object") - throw TypeError(".google.api.Distribution.bucketOptions: object expected"); - message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); - } - if (object.bucketCounts) { - if (!Array.isArray(object.bucketCounts)) - throw TypeError(".google.api.Distribution.bucketCounts: array expected"); - message.bucketCounts = []; - for (var i = 0; i < object.bucketCounts.length; ++i) - if ($util.Long) - (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = false; - else if (typeof object.bucketCounts[i] === "string") - message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); - else if (typeof object.bucketCounts[i] === "number") - message.bucketCounts[i] = object.bucketCounts[i]; - else if (typeof object.bucketCounts[i] === "object") - message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.bucketCounts[i].high >>> 0).toNumber(); - } - if (object.exemplars) { - if (!Array.isArray(object.exemplars)) - throw TypeError(".google.api.Distribution.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object.exemplars.length; ++i) { - if (typeof object.exemplars[i] !== "object") - throw TypeError(".google.api.Distribution.exemplars: object expected"); - message.exemplars[i] = $root.google.api.Distribution.Exemplar.fromObject(object.exemplars[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Distribution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution - * @static - * @param {google.api.Distribution} message Distribution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Distribution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bucketCounts = []; - object.exemplars = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.mean = 0; - object.sumOfSquaredDeviation = 0; - object.range = null; - object.bucketOptions = null; - } - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.mean != null && message.hasOwnProperty("mean")) - object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; - if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) - object.sumOfSquaredDeviation = options.json && !isFinite(message.sumOfSquaredDeviation) ? String(message.sumOfSquaredDeviation) : message.sumOfSquaredDeviation; - if (message.range != null && message.hasOwnProperty("range")) - object.range = $root.google.api.Distribution.Range.toObject(message.range, options); - if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) - object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); - if (message.bucketCounts && message.bucketCounts.length) { - object.bucketCounts = []; - for (var j = 0; j < message.bucketCounts.length; ++j) - if (typeof message.bucketCounts[j] === "number") - object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; - else - object.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; - } - if (message.exemplars && message.exemplars.length) { - object.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) - object.exemplars[j] = $root.google.api.Distribution.Exemplar.toObject(message.exemplars[j], options); - } - return object; - }; - - /** - * Converts this Distribution to JSON. - * @function toJSON - * @memberof google.api.Distribution - * @instance - * @returns {Object.} JSON object - */ - Distribution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Distribution.Range = (function() { - - /** - * Properties of a Range. - * @memberof google.api.Distribution - * @interface IRange - * @property {number|null} [min] Range min - * @property {number|null} [max] Range max - */ - - /** - * Constructs a new Range. - * @memberof google.api.Distribution - * @classdesc Represents a Range. - * @implements IRange - * @constructor - * @param {google.api.Distribution.IRange=} [properties] Properties to set - */ - function Range(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Range min. - * @member {number} min - * @memberof google.api.Distribution.Range - * @instance - */ - Range.prototype.min = 0; - - /** - * Range max. - * @member {number} max - * @memberof google.api.Distribution.Range - * @instance - */ - Range.prototype.max = 0; - - /** - * Creates a new Range instance using the specified properties. - * @function create - * @memberof google.api.Distribution.Range - * @static - * @param {google.api.Distribution.IRange=} [properties] Properties to set - * @returns {google.api.Distribution.Range} Range instance - */ - Range.create = function create(properties) { - return new Range(properties); - }; - - /** - * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.Range - * @static - * @param {google.api.Distribution.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.min != null && message.hasOwnProperty("min")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); - if (message.max != null && message.hasOwnProperty("max")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); - return writer; - }; - - /** - * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.Range - * @static - * @param {google.api.Distribution.IRange} message Range message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified UpdateUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.UpdateUptimeCheckConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IUpdateUptimeCheckConfigRequest} message UpdateUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Decodes a Range message from the specified reader or buffer. + * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer. * @function decode - * @memberof google.api.Distribution.Range + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.Range} Range + * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest * @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) { + UpdateUptimeCheckConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Range(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.min = reader.double(); - break; case 2: - message.max = reader.double(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 3: + message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -29556,118 +27260,126 @@ }; /** - * Decodes a Range message from the specified reader or buffer, length delimited. + * Decodes an UpdateUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Distribution.Range + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.Range} Range + * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest * @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) { + UpdateUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Range message. + * Verifies an UpdateUptimeCheckConfigRequest message. * @function verify - * @memberof google.api.Distribution.Range + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest * @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) { + UpdateUptimeCheckConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.min != null && message.hasOwnProperty("min")) - if (typeof message.min !== "number") - return "min: number expected"; - if (message.max != null && message.hasOwnProperty("max")) - if (typeof message.max !== "number") - return "max: number expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) { + var error = $root.google.monitoring.v3.UptimeCheckConfig.verify(message.uptimeCheckConfig); + if (error) + return "uptimeCheckConfig." + error; + } return null; }; /** - * Creates a Range message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Distribution.Range + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest * @static * @param {Object.} object Plain object - * @returns {google.api.Distribution.Range} Range + * @returns {google.monitoring.v3.UpdateUptimeCheckConfigRequest} UpdateUptimeCheckConfigRequest */ - Range.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.Range) - return object; - var message = new $root.google.api.Distribution.Range(); - if (object.min != null) - message.min = Number(object.min); - if (object.max != null) - message.max = Number(object.max); + UpdateUptimeCheckConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest) + return object; + var message = new $root.google.monitoring.v3.UpdateUptimeCheckConfigRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.monitoring.v3.UpdateUptimeCheckConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.uptimeCheckConfig != null) { + if (typeof object.uptimeCheckConfig !== "object") + throw TypeError(".google.monitoring.v3.UpdateUptimeCheckConfigRequest.uptimeCheckConfig: object expected"); + message.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.fromObject(object.uptimeCheckConfig); + } return message; }; /** - * Creates a plain object from a Range message. Also converts values to other types if specified. + * Creates a plain object from an UpdateUptimeCheckConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Distribution.Range + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest * @static - * @param {google.api.Distribution.Range} message Range + * @param {google.monitoring.v3.UpdateUptimeCheckConfigRequest} message UpdateUptimeCheckConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Range.toObject = function toObject(message, options) { + UpdateUptimeCheckConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.min = 0; - object.max = 0; + object.updateMask = null; + object.uptimeCheckConfig = null; } - if (message.min != null && message.hasOwnProperty("min")) - object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (message.max != null && message.hasOwnProperty("max")) - object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.uptimeCheckConfig != null && message.hasOwnProperty("uptimeCheckConfig")) + object.uptimeCheckConfig = $root.google.monitoring.v3.UptimeCheckConfig.toObject(message.uptimeCheckConfig, options); return object; }; /** - * Converts this Range to JSON. + * Converts this UpdateUptimeCheckConfigRequest to JSON. * @function toJSON - * @memberof google.api.Distribution.Range + * @memberof google.monitoring.v3.UpdateUptimeCheckConfigRequest * @instance * @returns {Object.} JSON object */ - Range.prototype.toJSON = function toJSON() { + UpdateUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Range; + return UpdateUptimeCheckConfigRequest; })(); - Distribution.BucketOptions = (function() { + v3.DeleteUptimeCheckConfigRequest = (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 + * Properties of a DeleteUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @interface IDeleteUptimeCheckConfigRequest + * @property {string|null} [name] DeleteUptimeCheckConfigRequest name */ /** - * Constructs a new BucketOptions. - * @memberof google.api.Distribution - * @classdesc Represents a BucketOptions. - * @implements IBucketOptions + * Constructs a new DeleteUptimeCheckConfigRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a DeleteUptimeCheckConfigRequest. + * @implements IDeleteUptimeCheckConfigRequest * @constructor - * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set + * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest=} [properties] Properties to set */ - function BucketOptions(properties) { + function DeleteUptimeCheckConfigRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29675,115 +27387,276 @@ } /** - * BucketOptions linearBuckets. - * @member {google.api.Distribution.BucketOptions.ILinear|null|undefined} linearBuckets - * @memberof google.api.Distribution.BucketOptions + * DeleteUptimeCheckConfigRequest name. + * @member {string} name + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest * @instance */ - BucketOptions.prototype.linearBuckets = null; + DeleteUptimeCheckConfigRequest.prototype.name = ""; /** - * BucketOptions exponentialBuckets. - * @member {google.api.Distribution.BucketOptions.IExponential|null|undefined} exponentialBuckets - * @memberof google.api.Distribution.BucketOptions - * @instance + * Creates a new DeleteUptimeCheckConfigRequest instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest instance */ - BucketOptions.prototype.exponentialBuckets = null; + DeleteUptimeCheckConfigRequest.create = function create(properties) { + return new DeleteUptimeCheckConfigRequest(properties); + }; /** - * BucketOptions explicitBuckets. - * @member {google.api.Distribution.BucketOptions.IExplicit|null|undefined} explicitBuckets - * @memberof google.api.Distribution.BucketOptions + * Encodes the specified DeleteUptimeCheckConfigRequest message. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} message DeleteUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUptimeCheckConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteUptimeCheckConfigRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.DeleteUptimeCheckConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.IDeleteUptimeCheckConfigRequest} message DeleteUptimeCheckConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUptimeCheckConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUptimeCheckConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUptimeCheckConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUptimeCheckConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUptimeCheckConfigRequest message. + * @function verify + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUptimeCheckConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteUptimeCheckConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.DeleteUptimeCheckConfigRequest} DeleteUptimeCheckConfigRequest + */ + DeleteUptimeCheckConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest) + return object; + var message = new $root.google.monitoring.v3.DeleteUptimeCheckConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteUptimeCheckConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest + * @static + * @param {google.monitoring.v3.DeleteUptimeCheckConfigRequest} message DeleteUptimeCheckConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUptimeCheckConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteUptimeCheckConfigRequest to JSON. + * @function toJSON + * @memberof google.monitoring.v3.DeleteUptimeCheckConfigRequest * @instance + * @returns {Object.} JSON object */ - BucketOptions.prototype.explicitBuckets = null; + DeleteUptimeCheckConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return DeleteUptimeCheckConfigRequest; + })(); + + v3.ListUptimeCheckIpsRequest = (function() { /** - * BucketOptions options. - * @member {"linearBuckets"|"exponentialBuckets"|"explicitBuckets"|undefined} options - * @memberof google.api.Distribution.BucketOptions + * Properties of a ListUptimeCheckIpsRequest. + * @memberof google.monitoring.v3 + * @interface IListUptimeCheckIpsRequest + * @property {number|null} [pageSize] ListUptimeCheckIpsRequest pageSize + * @property {string|null} [pageToken] ListUptimeCheckIpsRequest pageToken + */ + + /** + * Constructs a new ListUptimeCheckIpsRequest. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListUptimeCheckIpsRequest. + * @implements IListUptimeCheckIpsRequest + * @constructor + * @param {google.monitoring.v3.IListUptimeCheckIpsRequest=} [properties] Properties to set + */ + function ListUptimeCheckIpsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUptimeCheckIpsRequest pageSize. + * @member {number} pageSize + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @instance */ - Object.defineProperty(BucketOptions.prototype, "options", { - get: $util.oneOfGetter($oneOfFields = ["linearBuckets", "exponentialBuckets", "explicitBuckets"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListUptimeCheckIpsRequest.prototype.pageSize = 0; /** - * Creates a new BucketOptions instance using the specified properties. + * ListUptimeCheckIpsRequest pageToken. + * @member {string} pageToken + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest + * @instance + */ + ListUptimeCheckIpsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUptimeCheckIpsRequest instance using the specified properties. * @function create - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @static - * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set - * @returns {google.api.Distribution.BucketOptions} BucketOptions instance + * @param {google.monitoring.v3.IListUptimeCheckIpsRequest=} [properties] Properties to set + * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest instance */ - BucketOptions.create = function create(properties) { - return new BucketOptions(properties); + ListUptimeCheckIpsRequest.create = function create(properties) { + return new ListUptimeCheckIpsRequest(properties); }; /** - * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * Encodes the specified ListUptimeCheckIpsRequest message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. * @function encode - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @static - * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode + * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} message ListUptimeCheckIpsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketOptions.encode = function encode(message, writer) { + ListUptimeCheckIpsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) - $root.google.api.Distribution.BucketOptions.Linear.encode(message.linearBuckets, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) - $root.google.api.Distribution.BucketOptions.Exponential.encode(message.exponentialBuckets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) - $root.google.api.Distribution.BucketOptions.Explicit.encode(message.explicitBuckets, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * Encodes the specified ListUptimeCheckIpsRequest message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @static - * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode + * @param {google.monitoring.v3.IListUptimeCheckIpsRequest} message ListUptimeCheckIpsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BucketOptions.encodeDelimited = function encodeDelimited(message, writer) { + ListUptimeCheckIpsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BucketOptions message from the specified reader or buffer. + * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer. * @function decode - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @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 + * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest * @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) { + ListUptimeCheckIpsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckIpsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.decode(reader, reader.uint32()); - break; case 2: - message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; case 3: - message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -29794,1074 +27667,3651 @@ }; /** - * Decodes a BucketOptions message from the specified reader or buffer, length delimited. + * Decodes a ListUptimeCheckIpsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions} BucketOptions + * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest * @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) { + ListUptimeCheckIpsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BucketOptions message. + * Verifies a ListUptimeCheckIpsRequest message. * @function verify - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @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) { + ListUptimeCheckIpsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { - properties.options = 1; - { - var error = $root.google.api.Distribution.BucketOptions.Linear.verify(message.linearBuckets); - if (error) - return "linearBuckets." + error; - } - } - if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { - if (properties.options === 1) - return "options: multiple values"; - properties.options = 1; - { - var error = $root.google.api.Distribution.BucketOptions.Exponential.verify(message.exponentialBuckets); - if (error) - return "exponentialBuckets." + error; - } - } - if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { - if (properties.options === 1) - return "options: multiple values"; - properties.options = 1; - { - var error = $root.google.api.Distribution.BucketOptions.Explicit.verify(message.explicitBuckets); - if (error) - return "explicitBuckets." + error; - } - } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a BucketOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ListUptimeCheckIpsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @static * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions} BucketOptions + * @returns {google.monitoring.v3.ListUptimeCheckIpsRequest} ListUptimeCheckIpsRequest */ - BucketOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions) + ListUptimeCheckIpsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListUptimeCheckIpsRequest) return object; - var message = new $root.google.api.Distribution.BucketOptions(); - if (object.linearBuckets != null) { - if (typeof object.linearBuckets !== "object") - throw TypeError(".google.api.Distribution.BucketOptions.linearBuckets: object expected"); - message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.fromObject(object.linearBuckets); - } - if (object.exponentialBuckets != null) { - if (typeof object.exponentialBuckets !== "object") - throw TypeError(".google.api.Distribution.BucketOptions.exponentialBuckets: object expected"); - message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.fromObject(object.exponentialBuckets); - } - if (object.explicitBuckets != null) { - if (typeof object.explicitBuckets !== "object") - throw TypeError(".google.api.Distribution.BucketOptions.explicitBuckets: object expected"); - message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.fromObject(object.explicitBuckets); - } + var message = new $root.google.monitoring.v3.ListUptimeCheckIpsRequest(); + 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 BucketOptions message. Also converts values to other types if specified. + * Creates a plain object from a ListUptimeCheckIpsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @static - * @param {google.api.Distribution.BucketOptions} message BucketOptions + * @param {google.monitoring.v3.ListUptimeCheckIpsRequest} message ListUptimeCheckIpsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BucketOptions.toObject = function toObject(message, options) { + ListUptimeCheckIpsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { - object.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.toObject(message.linearBuckets, options); - if (options.oneofs) - object.options = "linearBuckets"; - } - if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { - object.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.toObject(message.exponentialBuckets, options); - if (options.oneofs) - object.options = "exponentialBuckets"; - } - if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { - object.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.toObject(message.explicitBuckets, options); - if (options.oneofs) - object.options = "explicitBuckets"; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this BucketOptions to JSON. + * Converts this ListUptimeCheckIpsRequest to JSON. * @function toJSON - * @memberof google.api.Distribution.BucketOptions + * @memberof google.monitoring.v3.ListUptimeCheckIpsRequest * @instance * @returns {Object.} JSON object */ - BucketOptions.prototype.toJSON = function toJSON() { + ListUptimeCheckIpsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - BucketOptions.Linear = (function() { + return ListUptimeCheckIpsRequest; + })(); - /** - * 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 - */ + v3.ListUptimeCheckIpsResponse = (function() { - /** - * Constructs a new Linear. - * @memberof google.api.Distribution.BucketOptions - * @classdesc Represents a Linear. - * @implements ILinear - * @constructor - * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set - */ - function Linear(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListUptimeCheckIpsResponse. + * @memberof google.monitoring.v3 + * @interface IListUptimeCheckIpsResponse + * @property {Array.|null} [uptimeCheckIps] ListUptimeCheckIpsResponse uptimeCheckIps + * @property {string|null} [nextPageToken] ListUptimeCheckIpsResponse nextPageToken + */ - /** - * Linear numFiniteBuckets. - * @member {number} numFiniteBuckets - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - */ - Linear.prototype.numFiniteBuckets = 0; + /** + * Constructs a new ListUptimeCheckIpsResponse. + * @memberof google.monitoring.v3 + * @classdesc Represents a ListUptimeCheckIpsResponse. + * @implements IListUptimeCheckIpsResponse + * @constructor + * @param {google.monitoring.v3.IListUptimeCheckIpsResponse=} [properties] Properties to set + */ + function ListUptimeCheckIpsResponse(properties) { + this.uptimeCheckIps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Linear width. - * @member {number} width - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - */ - Linear.prototype.width = 0; + /** + * ListUptimeCheckIpsResponse uptimeCheckIps. + * @member {Array.} uptimeCheckIps + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @instance + */ + ListUptimeCheckIpsResponse.prototype.uptimeCheckIps = $util.emptyArray; - /** - * Linear offset. - * @member {number} offset - * @memberof google.api.Distribution.BucketOptions.Linear - * @instance - */ - Linear.prototype.offset = 0; + /** + * ListUptimeCheckIpsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @instance + */ + ListUptimeCheckIpsResponse.prototype.nextPageToken = ""; - /** - * 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); - }; + /** + * Creates a new ListUptimeCheckIpsResponse instance using the specified properties. + * @function create + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {google.monitoring.v3.IListUptimeCheckIpsResponse=} [properties] Properties to set + * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse instance + */ + ListUptimeCheckIpsResponse.create = function create(properties) { + return new ListUptimeCheckIpsResponse(properties); + }; - /** - * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Linear.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); - if (message.width != null && message.hasOwnProperty("width")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.width); - if (message.offset != null && message.hasOwnProperty("offset")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.offset); - return writer; - }; + /** + * Encodes the specified ListUptimeCheckIpsResponse message. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. + * @function encode + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {google.monitoring.v3.IListUptimeCheckIpsResponse} message ListUptimeCheckIpsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUptimeCheckIpsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uptimeCheckIps != null && message.uptimeCheckIps.length) + for (var i = 0; i < message.uptimeCheckIps.length; ++i) + $root.google.monitoring.v3.UptimeCheckIp.encode(message.uptimeCheckIps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Linear.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListUptimeCheckIpsResponse message, length delimited. Does not implicitly {@link google.monitoring.v3.ListUptimeCheckIpsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {google.monitoring.v3.IListUptimeCheckIpsResponse} message ListUptimeCheckIpsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUptimeCheckIpsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Linear message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions.Linear} Linear - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Linear.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Linear(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.numFiniteBuckets = reader.int32(); - break; - case 2: - message.width = reader.double(); - break; - case 3: - message.offset = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUptimeCheckIpsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.monitoring.v3.ListUptimeCheckIpsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.uptimeCheckIps && message.uptimeCheckIps.length)) + message.uptimeCheckIps = []; + message.uptimeCheckIps.push($root.google.monitoring.v3.UptimeCheckIp.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a Linear message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions.Linear} Linear - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Linear.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Linear message. - * @function verify - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Linear.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - if (!$util.isInteger(message.numFiniteBuckets)) - return "numFiniteBuckets: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (typeof message.width !== "number") - return "width: number expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (typeof message.offset !== "number") - return "offset: number expected"; - return null; - }; + } + return message; + }; - /** - * Creates a Linear message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions.Linear} Linear - */ - Linear.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions.Linear) - return object; - var message = new $root.google.api.Distribution.BucketOptions.Linear(); - if (object.numFiniteBuckets != null) - message.numFiniteBuckets = object.numFiniteBuckets | 0; - if (object.width != null) - message.width = Number(object.width); - if (object.offset != null) - message.offset = Number(object.offset); - return message; - }; + /** + * Decodes a ListUptimeCheckIpsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUptimeCheckIpsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a Linear message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions.Linear - * @static - * @param {google.api.Distribution.BucketOptions.Linear} message Linear - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Linear.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.numFiniteBuckets = 0; - object.width = 0; - object.offset = 0; + /** + * Verifies a ListUptimeCheckIpsResponse message. + * @function verify + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUptimeCheckIpsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uptimeCheckIps != null && message.hasOwnProperty("uptimeCheckIps")) { + if (!Array.isArray(message.uptimeCheckIps)) + return "uptimeCheckIps: array expected"; + for (var i = 0; i < message.uptimeCheckIps.length; ++i) { + var error = $root.google.monitoring.v3.UptimeCheckIp.verify(message.uptimeCheckIps[i]); + if (error) + return "uptimeCheckIps." + error; } - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - object.numFiniteBuckets = message.numFiniteBuckets; - if (message.width != null && message.hasOwnProperty("width")) - object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = options.json && !isFinite(message.offset) ? String(message.offset) : message.offset; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListUptimeCheckIpsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.monitoring.v3.ListUptimeCheckIpsResponse} ListUptimeCheckIpsResponse + */ + ListUptimeCheckIpsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.monitoring.v3.ListUptimeCheckIpsResponse) return object; - }; + var message = new $root.google.monitoring.v3.ListUptimeCheckIpsResponse(); + if (object.uptimeCheckIps) { + if (!Array.isArray(object.uptimeCheckIps)) + throw TypeError(".google.monitoring.v3.ListUptimeCheckIpsResponse.uptimeCheckIps: array expected"); + message.uptimeCheckIps = []; + for (var i = 0; i < object.uptimeCheckIps.length; ++i) { + if (typeof object.uptimeCheckIps[i] !== "object") + throw TypeError(".google.monitoring.v3.ListUptimeCheckIpsResponse.uptimeCheckIps: object expected"); + message.uptimeCheckIps[i] = $root.google.monitoring.v3.UptimeCheckIp.fromObject(object.uptimeCheckIps[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from a ListUptimeCheckIpsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @static + * @param {google.monitoring.v3.ListUptimeCheckIpsResponse} message ListUptimeCheckIpsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUptimeCheckIpsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uptimeCheckIps = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.uptimeCheckIps && message.uptimeCheckIps.length) { + object.uptimeCheckIps = []; + for (var j = 0; j < message.uptimeCheckIps.length; ++j) + object.uptimeCheckIps[j] = $root.google.monitoring.v3.UptimeCheckIp.toObject(message.uptimeCheckIps[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - return Linear; - })(); + /** + * Converts this ListUptimeCheckIpsResponse to JSON. + * @function toJSON + * @memberof google.monitoring.v3.ListUptimeCheckIpsResponse + * @instance + * @returns {Object.} JSON object + */ + ListUptimeCheckIpsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - BucketOptions.Exponential = (function() { + return ListUptimeCheckIpsResponse; + })(); - /** - * 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 - */ + return v3; + })(); - /** - * Constructs a new Exponential. - * @memberof google.api.Distribution.BucketOptions - * @classdesc Represents an Exponential. - * @implements IExponential - * @constructor - * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set - */ - function Exponential(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return monitoring; + })(); - /** - * Exponential numFiniteBuckets. - * @member {number} numFiniteBuckets - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - */ - Exponential.prototype.numFiniteBuckets = 0; + google.api = (function() { - /** - * Exponential growthFactor. - * @member {number} growthFactor - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - */ - Exponential.prototype.growthFactor = 0; + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; - /** - * Exponential scale. - * @member {number} scale - * @memberof google.api.Distribution.BucketOptions.Exponential - * @instance - */ - Exponential.prototype.scale = 0; + api.ResourceDescriptor = (function() { - /** - * 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); - }; + /** + * 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 + */ - /** - * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exponential.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); - if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.growthFactor); - if (message.scale != null && message.hasOwnProperty("scale")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.scale); - return writer; - }; + /** + * 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 = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exponential.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; - /** - * Decodes an Exponential message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exponential.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Exponential(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.numFiniteBuckets = reader.int32(); - break; - case 2: - message.growthFactor = reader.double(); - break; - case 3: - message.scale = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Exponential message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exponential.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; - /** - * Verifies an Exponential message. - * @function verify - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Exponential.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - if (!$util.isInteger(message.numFiniteBuckets)) - return "numFiniteBuckets: integer expected"; - if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) - if (typeof message.growthFactor !== "number") - return "growthFactor: number expected"; - if (message.scale != null && message.hasOwnProperty("scale")) - if (typeof message.scale !== "number") - return "scale: number expected"; - return null; - }; + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; - /** - * Creates an Exponential message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential - */ - Exponential.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions.Exponential) - return object; - var message = new $root.google.api.Distribution.BucketOptions.Exponential(); - if (object.numFiniteBuckets != null) - message.numFiniteBuckets = object.numFiniteBuckets | 0; - if (object.growthFactor != null) - message.growthFactor = Number(object.growthFactor); - if (object.scale != null) - message.scale = Number(object.scale); - return message; - }; + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; - /** - * Creates a plain object from an Exponential message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions.Exponential - * @static - * @param {google.api.Distribution.BucketOptions.Exponential} message Exponential - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exponential.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.numFiniteBuckets = 0; - object.growthFactor = 0; - object.scale = 0; - } - if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) - object.numFiniteBuckets = message.numFiniteBuckets; - if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) - object.growthFactor = options.json && !isFinite(message.growthFactor) ? String(message.growthFactor) : message.growthFactor; - if (message.scale != null && message.hasOwnProperty("scale")) - object.scale = options.json && !isFinite(message.scale) ? String(message.scale) : message.scale; - return object; - }; + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; - /** - * 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); - }; + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; - return Exponential; - })(); + /** + * 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); + }; - BucketOptions.Explicit = (function() { + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; - /** - * Properties of an Explicit. - * @memberof google.api.Distribution.BucketOptions - * @interface IExplicit - * @property {Array.|null} [bounds] Explicit bounds - */ + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new Explicit. - * @memberof google.api.Distribution.BucketOptions - * @classdesc Represents an Explicit. - * @implements IExplicit - * @constructor - * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set - */ - function Explicit(properties) { - this.bounds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * Explicit bounds. - * @member {Array.} bounds - * @memberof google.api.Distribution.BucketOptions.Explicit - * @instance - */ - Explicit.prototype.bounds = $util.emptyArray; + /** + * 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()); + }; - /** - * 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); - }; + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; - /** - * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Explicit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bounds != null && message.bounds.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.bounds.length; ++i) - writer.double(message.bounds[i]); - writer.ldelim(); - } - return writer; - }; + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; - /** - * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Explicit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; - /** - * Decodes an Explicit message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Explicit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Explicit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.bounds && message.bounds.length)) - message.bounds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.bounds.push(reader.double()); - } else - message.bounds.push(reader.double()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * 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 + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + api.Distribution = (function() { + + /** + * Properties of a Distribution. + * @memberof google.api + * @interface IDistribution + * @property {number|Long|null} [count] Distribution count + * @property {number|null} [mean] Distribution mean + * @property {number|null} [sumOfSquaredDeviation] Distribution sumOfSquaredDeviation + * @property {google.api.Distribution.IRange|null} [range] Distribution range + * @property {google.api.Distribution.IBucketOptions|null} [bucketOptions] Distribution bucketOptions + * @property {Array.|null} [bucketCounts] Distribution bucketCounts + * @property {Array.|null} [exemplars] Distribution exemplars + */ + + /** + * Constructs a new Distribution. + * @memberof google.api + * @classdesc Represents a Distribution. + * @implements IDistribution + * @constructor + * @param {google.api.IDistribution=} [properties] Properties to set + */ + function Distribution(properties) { + this.bucketCounts = []; + this.exemplars = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Distribution count. + * @member {number|Long} count + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Distribution mean. + * @member {number} mean + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.mean = 0; + + /** + * Distribution sumOfSquaredDeviation. + * @member {number} sumOfSquaredDeviation + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.sumOfSquaredDeviation = 0; + + /** + * Distribution range. + * @member {google.api.Distribution.IRange|null|undefined} range + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.range = null; + + /** + * Distribution bucketOptions. + * @member {google.api.Distribution.IBucketOptions|null|undefined} bucketOptions + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.bucketOptions = null; + + /** + * Distribution bucketCounts. + * @member {Array.} bucketCounts + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.bucketCounts = $util.emptyArray; + + /** + * Distribution exemplars. + * @member {Array.} exemplars + * @memberof google.api.Distribution + * @instance + */ + Distribution.prototype.exemplars = $util.emptyArray; + + /** + * Creates a new Distribution instance using the specified properties. + * @function create + * @memberof google.api.Distribution + * @static + * @param {google.api.IDistribution=} [properties] Properties to set + * @returns {google.api.Distribution} Distribution instance + */ + Distribution.create = function create(properties) { + return new Distribution(properties); + }; + + /** + * Encodes the specified Distribution message. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution + * @static + * @param {google.api.IDistribution} message Distribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distribution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && message.hasOwnProperty("count")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.count); + if (message.mean != null && message.hasOwnProperty("mean")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.mean); + if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.sumOfSquaredDeviation); + if (message.range != null && message.hasOwnProperty("range")) + $root.google.api.Distribution.Range.encode(message.range, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) + $root.google.api.Distribution.BucketOptions.encode(message.bucketOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.bucketCounts != null && message.bucketCounts.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.bucketCounts.length; ++i) + writer.int64(message.bucketCounts[i]); + writer.ldelim(); + } + if (message.exemplars != null && message.exemplars.length) + for (var i = 0; i < message.exemplars.length; ++i) + $root.google.api.Distribution.Exemplar.encode(message.exemplars[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Distribution message, length delimited. Does not implicitly {@link google.api.Distribution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution + * @static + * @param {google.api.IDistribution} message Distribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distribution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Distribution message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution} Distribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distribution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = reader.int64(); + break; + case 2: + message.mean = reader.double(); + break; + case 3: + message.sumOfSquaredDeviation = reader.double(); + break; + case 4: + message.range = $root.google.api.Distribution.Range.decode(reader, reader.uint32()); + break; + case 6: + message.bucketOptions = $root.google.api.Distribution.BucketOptions.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.bucketCounts && message.bucketCounts.length)) + message.bucketCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.bucketCounts.push(reader.int64()); + } else + message.bucketCounts.push(reader.int64()); + break; + case 10: + if (!(message.exemplars && message.exemplars.length)) + message.exemplars = []; + message.exemplars.push($root.google.api.Distribution.Exemplar.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Distribution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution} Distribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distribution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Distribution message. + * @function verify + * @memberof google.api.Distribution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Distribution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.mean != null && message.hasOwnProperty("mean")) + if (typeof message.mean !== "number") + return "mean: number expected"; + if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) + if (typeof message.sumOfSquaredDeviation !== "number") + return "sumOfSquaredDeviation: number expected"; + if (message.range != null && message.hasOwnProperty("range")) { + var error = $root.google.api.Distribution.Range.verify(message.range); + if (error) + return "range." + error; + } + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) { + var error = $root.google.api.Distribution.BucketOptions.verify(message.bucketOptions); + if (error) + return "bucketOptions." + error; + } + if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { + if (!Array.isArray(message.bucketCounts)) + return "bucketCounts: array expected"; + for (var i = 0; i < message.bucketCounts.length; ++i) + if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) + return "bucketCounts: integer|Long[] expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) + return "exemplars: array expected"; + for (var i = 0; i < message.exemplars.length; ++i) { + var error = $root.google.api.Distribution.Exemplar.verify(message.exemplars[i]); + if (error) + return "exemplars." + error; + } + } + return null; + }; + + /** + * Creates a Distribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution} Distribution + */ + Distribution.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution) + return object; + var message = new $root.google.api.Distribution(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.mean != null) + message.mean = Number(object.mean); + if (object.sumOfSquaredDeviation != null) + message.sumOfSquaredDeviation = Number(object.sumOfSquaredDeviation); + if (object.range != null) { + if (typeof object.range !== "object") + throw TypeError(".google.api.Distribution.range: object expected"); + message.range = $root.google.api.Distribution.Range.fromObject(object.range); + } + if (object.bucketOptions != null) { + if (typeof object.bucketOptions !== "object") + throw TypeError(".google.api.Distribution.bucketOptions: object expected"); + message.bucketOptions = $root.google.api.Distribution.BucketOptions.fromObject(object.bucketOptions); + } + if (object.bucketCounts) { + if (!Array.isArray(object.bucketCounts)) + throw TypeError(".google.api.Distribution.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0; i < object.bucketCounts.length; ++i) + if ($util.Long) + (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = false; + else if (typeof object.bucketCounts[i] === "string") + message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); + else if (typeof object.bucketCounts[i] === "number") + message.bucketCounts[i] = object.bucketCounts[i]; + else if (typeof object.bucketCounts[i] === "object") + message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.bucketCounts[i].high >>> 0).toNumber(); + } + if (object.exemplars) { + if (!Array.isArray(object.exemplars)) + throw TypeError(".google.api.Distribution.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object.exemplars.length; ++i) { + if (typeof object.exemplars[i] !== "object") + throw TypeError(".google.api.Distribution.exemplars: object expected"); + message.exemplars[i] = $root.google.api.Distribution.Exemplar.fromObject(object.exemplars[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Distribution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution + * @static + * @param {google.api.Distribution} message Distribution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Distribution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bucketCounts = []; + object.exemplars = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.mean = 0; + object.sumOfSquaredDeviation = 0; + object.range = null; + object.bucketOptions = null; + } + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.mean != null && message.hasOwnProperty("mean")) + object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; + if (message.sumOfSquaredDeviation != null && message.hasOwnProperty("sumOfSquaredDeviation")) + object.sumOfSquaredDeviation = options.json && !isFinite(message.sumOfSquaredDeviation) ? String(message.sumOfSquaredDeviation) : message.sumOfSquaredDeviation; + if (message.range != null && message.hasOwnProperty("range")) + object.range = $root.google.api.Distribution.Range.toObject(message.range, options); + if (message.bucketOptions != null && message.hasOwnProperty("bucketOptions")) + object.bucketOptions = $root.google.api.Distribution.BucketOptions.toObject(message.bucketOptions, options); + if (message.bucketCounts && message.bucketCounts.length) { + object.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) + if (typeof message.bucketCounts[j] === "number") + object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else + object.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; + } + if (message.exemplars && message.exemplars.length) { + object.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) + object.exemplars[j] = $root.google.api.Distribution.Exemplar.toObject(message.exemplars[j], options); + } + return object; + }; + + /** + * Converts this Distribution to JSON. + * @function toJSON + * @memberof google.api.Distribution + * @instance + * @returns {Object.} JSON object + */ + Distribution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Distribution.Range = (function() { + + /** + * Properties of a Range. + * @memberof google.api.Distribution + * @interface IRange + * @property {number|null} [min] Range min + * @property {number|null} [max] Range max + */ + + /** + * Constructs a new Range. + * @memberof google.api.Distribution + * @classdesc Represents a Range. + * @implements IRange + * @constructor + * @param {google.api.Distribution.IRange=} [properties] Properties to set + */ + function Range(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Range min. + * @member {number} min + * @memberof google.api.Distribution.Range + * @instance + */ + Range.prototype.min = 0; + + /** + * Range max. + * @member {number} max + * @memberof google.api.Distribution.Range + * @instance + */ + Range.prototype.max = 0; + + /** + * Creates a new Range instance using the specified properties. + * @function create + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.IRange=} [properties] Properties to set + * @returns {google.api.Distribution.Range} Range instance + */ + Range.create = function create(properties) { + return new Range(properties); + }; + + /** + * Encodes the specified Range message. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && message.hasOwnProperty("min")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); + if (message.max != null && message.hasOwnProperty("max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + return writer; + }; + + /** + * Encodes the specified Range message, length delimited. Does not implicitly {@link google.api.Distribution.Range.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.IRange} message Range message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Range.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Range message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Range(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.min = reader.double(); + break; + case 2: + message.max = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Range message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.Range + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.Range} Range + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Range.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Range message. + * @function verify + * @memberof google.api.Distribution.Range + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Range.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + return null; + }; + + /** + * Creates a Range message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.Range + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.Range} Range + */ + Range.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.Range) + return object; + var message = new $root.google.api.Distribution.Range(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + return message; + }; + + /** + * Creates a plain object from a Range message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.Range + * @static + * @param {google.api.Distribution.Range} message Range + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Range.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; + } + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + return object; + }; + + /** + * Converts this Range to JSON. + * @function toJSON + * @memberof google.api.Distribution.Range + * @instance + * @returns {Object.} JSON object + */ + Range.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Range; + })(); + + Distribution.BucketOptions = (function() { + + /** + * Properties of a BucketOptions. + * @memberof google.api.Distribution + * @interface IBucketOptions + * @property {google.api.Distribution.BucketOptions.ILinear|null} [linearBuckets] BucketOptions linearBuckets + * @property {google.api.Distribution.BucketOptions.IExponential|null} [exponentialBuckets] BucketOptions exponentialBuckets + * @property {google.api.Distribution.BucketOptions.IExplicit|null} [explicitBuckets] BucketOptions explicitBuckets + */ + + /** + * Constructs a new BucketOptions. + * @memberof google.api.Distribution + * @classdesc Represents a BucketOptions. + * @implements IBucketOptions + * @constructor + * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set + */ + function BucketOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BucketOptions linearBuckets. + * @member {google.api.Distribution.BucketOptions.ILinear|null|undefined} linearBuckets + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + BucketOptions.prototype.linearBuckets = null; + + /** + * BucketOptions exponentialBuckets. + * @member {google.api.Distribution.BucketOptions.IExponential|null|undefined} exponentialBuckets + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + BucketOptions.prototype.exponentialBuckets = null; + + /** + * BucketOptions explicitBuckets. + * @member {google.api.Distribution.BucketOptions.IExplicit|null|undefined} explicitBuckets + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + BucketOptions.prototype.explicitBuckets = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BucketOptions options. + * @member {"linearBuckets"|"exponentialBuckets"|"explicitBuckets"|undefined} options + * @memberof google.api.Distribution.BucketOptions + * @instance + */ + Object.defineProperty(BucketOptions.prototype, "options", { + get: $util.oneOfGetter($oneOfFields = ["linearBuckets", "exponentialBuckets", "explicitBuckets"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BucketOptions instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.IBucketOptions=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions} BucketOptions instance + */ + BucketOptions.create = function create(properties) { + return new BucketOptions(properties); + }; + + /** + * Encodes the specified BucketOptions message. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) + $root.google.api.Distribution.BucketOptions.Linear.encode(message.linearBuckets, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) + $root.google.api.Distribution.BucketOptions.Exponential.encode(message.exponentialBuckets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) + $root.google.api.Distribution.BucketOptions.Explicit.encode(message.explicitBuckets, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BucketOptions message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.IBucketOptions} message BucketOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BucketOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BucketOptions message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions} BucketOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.decode(reader, reader.uint32()); + break; + case 2: + message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.decode(reader, reader.uint32()); + break; + case 3: + message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BucketOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions} BucketOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BucketOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BucketOptions message. + * @function verify + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BucketOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Linear.verify(message.linearBuckets); + if (error) + return "linearBuckets." + error; + } + } + if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Exponential.verify(message.exponentialBuckets); + if (error) + return "exponentialBuckets." + error; + } + } + if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { + if (properties.options === 1) + return "options: multiple values"; + properties.options = 1; + { + var error = $root.google.api.Distribution.BucketOptions.Explicit.verify(message.explicitBuckets); + if (error) + return "explicitBuckets." + error; + } + } + return null; + }; + + /** + * Creates a BucketOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions} BucketOptions + */ + BucketOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions) + return object; + var message = new $root.google.api.Distribution.BucketOptions(); + if (object.linearBuckets != null) { + if (typeof object.linearBuckets !== "object") + throw TypeError(".google.api.Distribution.BucketOptions.linearBuckets: object expected"); + message.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.fromObject(object.linearBuckets); + } + if (object.exponentialBuckets != null) { + if (typeof object.exponentialBuckets !== "object") + throw TypeError(".google.api.Distribution.BucketOptions.exponentialBuckets: object expected"); + message.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.fromObject(object.exponentialBuckets); + } + if (object.explicitBuckets != null) { + if (typeof object.explicitBuckets !== "object") + throw TypeError(".google.api.Distribution.BucketOptions.explicitBuckets: object expected"); + message.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.fromObject(object.explicitBuckets); + } + return message; + }; + + /** + * Creates a plain object from a BucketOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions + * @static + * @param {google.api.Distribution.BucketOptions} message BucketOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BucketOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.linearBuckets != null && message.hasOwnProperty("linearBuckets")) { + object.linearBuckets = $root.google.api.Distribution.BucketOptions.Linear.toObject(message.linearBuckets, options); + if (options.oneofs) + object.options = "linearBuckets"; + } + if (message.exponentialBuckets != null && message.hasOwnProperty("exponentialBuckets")) { + object.exponentialBuckets = $root.google.api.Distribution.BucketOptions.Exponential.toObject(message.exponentialBuckets, options); + if (options.oneofs) + object.options = "exponentialBuckets"; + } + if (message.explicitBuckets != null && message.hasOwnProperty("explicitBuckets")) { + object.explicitBuckets = $root.google.api.Distribution.BucketOptions.Explicit.toObject(message.explicitBuckets, options); + if (options.oneofs) + object.options = "explicitBuckets"; + } + return object; + }; + + /** + * Converts this BucketOptions to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions + * @instance + * @returns {Object.} JSON object + */ + BucketOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BucketOptions.Linear = (function() { + + /** + * Properties of a Linear. + * @memberof google.api.Distribution.BucketOptions + * @interface ILinear + * @property {number|null} [numFiniteBuckets] Linear numFiniteBuckets + * @property {number|null} [width] Linear width + * @property {number|null} [offset] Linear offset + */ + + /** + * Constructs a new Linear. + * @memberof google.api.Distribution.BucketOptions + * @classdesc Represents a Linear. + * @implements ILinear + * @constructor + * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set + */ + function Linear(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Linear numFiniteBuckets. + * @member {number} numFiniteBuckets + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + */ + Linear.prototype.numFiniteBuckets = 0; + + /** + * Linear width. + * @member {number} width + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + */ + Linear.prototype.width = 0; + + /** + * Linear offset. + * @member {number} offset + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + */ + Linear.prototype.offset = 0; + + /** + * Creates a new Linear instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.ILinear=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions.Linear} Linear instance + */ + Linear.create = function create(properties) { + return new Linear(properties); + }; + + /** + * Encodes the specified Linear message. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Linear.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.width); + if (message.offset != null && message.hasOwnProperty("offset")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.offset); + return writer; + }; + + /** + * Encodes the specified Linear message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Linear.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.ILinear} message Linear message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Linear.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Linear message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions.Linear} Linear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Linear.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Linear(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numFiniteBuckets = reader.int32(); + break; + case 2: + message.width = reader.double(); + break; + case 3: + message.offset = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Linear message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions.Linear} Linear + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Linear.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Linear message. + * @function verify + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Linear.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + if (!$util.isInteger(message.numFiniteBuckets)) + return "numFiniteBuckets: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset !== "number") + return "offset: number expected"; + return null; + }; + + /** + * Creates a Linear message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions.Linear} Linear + */ + Linear.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Linear) + return object; + var message = new $root.google.api.Distribution.BucketOptions.Linear(); + if (object.numFiniteBuckets != null) + message.numFiniteBuckets = object.numFiniteBuckets | 0; + if (object.width != null) + message.width = Number(object.width); + if (object.offset != null) + message.offset = Number(object.offset); + return message; + }; + + /** + * Creates a plain object from a Linear message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions.Linear + * @static + * @param {google.api.Distribution.BucketOptions.Linear} message Linear + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Linear.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.numFiniteBuckets = 0; + object.width = 0; + object.offset = 0; + } + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + object.numFiniteBuckets = message.numFiniteBuckets; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = options.json && !isFinite(message.offset) ? String(message.offset) : message.offset; + return object; + }; + + /** + * Converts this Linear to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions.Linear + * @instance + * @returns {Object.} JSON object + */ + Linear.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Linear; + })(); + + BucketOptions.Exponential = (function() { + + /** + * Properties of an Exponential. + * @memberof google.api.Distribution.BucketOptions + * @interface IExponential + * @property {number|null} [numFiniteBuckets] Exponential numFiniteBuckets + * @property {number|null} [growthFactor] Exponential growthFactor + * @property {number|null} [scale] Exponential scale + */ + + /** + * Constructs a new Exponential. + * @memberof google.api.Distribution.BucketOptions + * @classdesc Represents an Exponential. + * @implements IExponential + * @constructor + * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set + */ + function Exponential(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Exponential numFiniteBuckets. + * @member {number} numFiniteBuckets + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + */ + Exponential.prototype.numFiniteBuckets = 0; + + /** + * Exponential growthFactor. + * @member {number} growthFactor + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + */ + Exponential.prototype.growthFactor = 0; + + /** + * Exponential scale. + * @member {number} scale + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + */ + Exponential.prototype.scale = 0; + + /** + * Creates a new Exponential instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.IExponential=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential instance + */ + Exponential.create = function create(properties) { + return new Exponential(properties); + }; + + /** + * Encodes the specified Exponential message. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exponential.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numFiniteBuckets); + if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.growthFactor); + if (message.scale != null && message.hasOwnProperty("scale")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.scale); + return writer; + }; + + /** + * Encodes the specified Exponential message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Exponential.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.IExponential} message Exponential message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exponential.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exponential message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exponential.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Exponential(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numFiniteBuckets = reader.int32(); + break; + case 2: + message.growthFactor = reader.double(); + break; + case 3: + message.scale = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Exponential message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exponential.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Exponential message. + * @function verify + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exponential.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + if (!$util.isInteger(message.numFiniteBuckets)) + return "numFiniteBuckets: integer expected"; + if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) + if (typeof message.growthFactor !== "number") + return "growthFactor: number expected"; + if (message.scale != null && message.hasOwnProperty("scale")) + if (typeof message.scale !== "number") + return "scale: number expected"; + return null; + }; + + /** + * Creates an Exponential message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions.Exponential} Exponential + */ + Exponential.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Exponential) + return object; + var message = new $root.google.api.Distribution.BucketOptions.Exponential(); + if (object.numFiniteBuckets != null) + message.numFiniteBuckets = object.numFiniteBuckets | 0; + if (object.growthFactor != null) + message.growthFactor = Number(object.growthFactor); + if (object.scale != null) + message.scale = Number(object.scale); + return message; + }; + + /** + * Creates a plain object from an Exponential message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions.Exponential + * @static + * @param {google.api.Distribution.BucketOptions.Exponential} message Exponential + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exponential.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.numFiniteBuckets = 0; + object.growthFactor = 0; + object.scale = 0; + } + if (message.numFiniteBuckets != null && message.hasOwnProperty("numFiniteBuckets")) + object.numFiniteBuckets = message.numFiniteBuckets; + if (message.growthFactor != null && message.hasOwnProperty("growthFactor")) + object.growthFactor = options.json && !isFinite(message.growthFactor) ? String(message.growthFactor) : message.growthFactor; + if (message.scale != null && message.hasOwnProperty("scale")) + object.scale = options.json && !isFinite(message.scale) ? String(message.scale) : message.scale; + return object; + }; + + /** + * Converts this Exponential to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions.Exponential + * @instance + * @returns {Object.} JSON object + */ + Exponential.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Exponential; + })(); + + BucketOptions.Explicit = (function() { + + /** + * Properties of an Explicit. + * @memberof google.api.Distribution.BucketOptions + * @interface IExplicit + * @property {Array.|null} [bounds] Explicit bounds + */ + + /** + * Constructs a new Explicit. + * @memberof google.api.Distribution.BucketOptions + * @classdesc Represents an Explicit. + * @implements IExplicit + * @constructor + * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set + */ + function Explicit(properties) { + this.bounds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Explicit bounds. + * @member {Array.} bounds + * @memberof google.api.Distribution.BucketOptions.Explicit + * @instance + */ + Explicit.prototype.bounds = $util.emptyArray; + + /** + * Creates a new Explicit instance using the specified properties. + * @function create + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.IExplicit=} [properties] Properties to set + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit instance + */ + Explicit.create = function create(properties) { + return new Explicit(properties); + }; + + /** + * Encodes the specified Explicit message. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. + * @function encode + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explicit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bounds != null && message.bounds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.bounds.length; ++i) + writer.double(message.bounds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explicit message, length delimited. Does not implicitly {@link google.api.Distribution.BucketOptions.Explicit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.IExplicit} message Explicit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explicit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explicit message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explicit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.BucketOptions.Explicit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bounds && message.bounds.length)) + message.bounds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.bounds.push(reader.double()); + } else + message.bounds.push(reader.double()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explicit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explicit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explicit message. + * @function verify + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explicit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bounds != null && message.hasOwnProperty("bounds")) { + if (!Array.isArray(message.bounds)) + return "bounds: array expected"; + for (var i = 0; i < message.bounds.length; ++i) + if (typeof message.bounds[i] !== "number") + return "bounds: number[] expected"; + } + return null; + }; + + /** + * Creates an Explicit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit + */ + Explicit.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.BucketOptions.Explicit) + return object; + var message = new $root.google.api.Distribution.BucketOptions.Explicit(); + if (object.bounds) { + if (!Array.isArray(object.bounds)) + throw TypeError(".google.api.Distribution.BucketOptions.Explicit.bounds: array expected"); + message.bounds = []; + for (var i = 0; i < object.bounds.length; ++i) + message.bounds[i] = Number(object.bounds[i]); + } + return message; + }; + + /** + * Creates a plain object from an Explicit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.BucketOptions.Explicit + * @static + * @param {google.api.Distribution.BucketOptions.Explicit} message Explicit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explicit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bounds = []; + if (message.bounds && message.bounds.length) { + object.bounds = []; + for (var j = 0; j < message.bounds.length; ++j) + object.bounds[j] = options.json && !isFinite(message.bounds[j]) ? String(message.bounds[j]) : message.bounds[j]; + } + return object; + }; + + /** + * Converts this Explicit to JSON. + * @function toJSON + * @memberof google.api.Distribution.BucketOptions.Explicit + * @instance + * @returns {Object.} JSON object */ - Explicit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + Explicit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Verifies an Explicit message. - * @function verify - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Explicit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bounds != null && message.hasOwnProperty("bounds")) { - if (!Array.isArray(message.bounds)) - return "bounds: array expected"; - for (var i = 0; i < message.bounds.length; ++i) - if (typeof message.bounds[i] !== "number") - return "bounds: number[] expected"; - } - return null; - }; + return 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) + 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) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.hasOwnProperty("value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attachments != null && message.attachments.length) + for (var i = 0; i < message.attachments.length; ++i) + $root.google.protobuf.Any.encode(message.attachments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Distribution.Exemplar + * @static + * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exemplar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Exemplar message from the specified reader or buffer. + * @function decode + * @memberof google.api.Distribution.Exemplar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Distribution.Exemplar} Exemplar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exemplar.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Exemplar(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + case 2: + message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.attachments && message.attachments.length)) + message.attachments = []; + message.attachments.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.timestamp); + if (error) + return "timestamp." + error; + } + if (message.attachments != null && message.hasOwnProperty("attachments")) { + if (!Array.isArray(message.attachments)) + return "attachments: array expected"; + for (var i = 0; i < message.attachments.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.attachments[i]); + if (error) + return "attachments." + error; + } + } + return null; + }; + + /** + * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Distribution.Exemplar + * @static + * @param {Object.} object Plain object + * @returns {google.api.Distribution.Exemplar} Exemplar + */ + Exemplar.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Distribution.Exemplar) + return object; + var message = new $root.google.api.Distribution.Exemplar(); + if (object.value != null) + message.value = Number(object.value); + if (object.timestamp != null) { + if (typeof object.timestamp !== "object") + throw TypeError(".google.api.Distribution.Exemplar.timestamp: object expected"); + message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); + } + if (object.attachments) { + if (!Array.isArray(object.attachments)) + throw TypeError(".google.api.Distribution.Exemplar.attachments: array expected"); + message.attachments = []; + for (var i = 0; i < object.attachments.length; ++i) { + if (typeof object.attachments[i] !== "object") + throw TypeError(".google.api.Distribution.Exemplar.attachments: object expected"); + message.attachments[i] = $root.google.protobuf.Any.fromObject(object.attachments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Exemplar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Distribution.Exemplar + * @static + * @param {google.api.Distribution.Exemplar} message Exemplar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exemplar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attachments = []; + if (options.defaults) { + object.value = 0; + object.timestamp = null; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.attachments && message.attachments.length) { + object.attachments = []; + for (var j = 0; j < message.attachments.length; ++j) + object.attachments[j] = $root.google.protobuf.Any.toObject(message.attachments[j], options); + } + return object; + }; + + /** + * 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); + }; + + return Exemplar; + })(); + + return Distribution; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("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).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates an Explicit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.BucketOptions.Explicit} Explicit - */ - Explicit.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.BucketOptions.Explicit) - return object; - var message = new $root.google.api.Distribution.BucketOptions.Explicit(); - if (object.bounds) { - if (!Array.isArray(object.bounds)) - throw TypeError(".google.api.Distribution.BucketOptions.Explicit.bounds: array expected"); - message.bounds = []; - for (var i = 0; i < object.bounds.length; ++i) - message.bounds[i] = Number(object.bounds[i]); - } - return message; - }; + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; - /** - * Creates a plain object from an Explicit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.BucketOptions.Explicit - * @static - * @param {google.api.Distribution.BucketOptions.Explicit} message Explicit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Explicit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.bounds = []; - if (message.bounds && message.bounds.length) { - object.bounds = []; - for (var j = 0; j < message.bounds.length; ++j) - object.bounds[j] = options.json && !isFinite(message.bounds[j]) ? String(message.bounds[j]) : message.bounds[j]; - } - return object; - }; + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; - /** - * 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); - }; + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; - return Explicit; - })(); + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * 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) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("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).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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; - return BucketOptions; - })(); + /** + * 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); + }; - Distribution.Exemplar = (function() { + return HttpRule; + })(); - /** - * 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 - */ + api.CustomHttpPattern = (function() { - /** - * Constructs a new Exemplar. - * @memberof google.api.Distribution - * @classdesc Represents an Exemplar. - * @implements IExemplar - * @constructor - * @param {google.api.Distribution.IExemplar=} [properties] Properties to set - */ - function Exemplar(properties) { - this.attachments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ - /** - * Exemplar value. - * @member {number} value - * @memberof google.api.Distribution.Exemplar - * @instance - */ - Exemplar.prototype.value = 0; + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Exemplar timestamp. - * @member {google.protobuf.ITimestamp|null|undefined} timestamp - * @memberof google.api.Distribution.Exemplar - * @instance - */ - Exemplar.prototype.timestamp = null; + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; - /** - * Exemplar attachments. - * @member {Array.} attachments - * @memberof google.api.Distribution.Exemplar - * @instance - */ - Exemplar.prototype.attachments = $util.emptyArray; + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; - /** - * 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); - }; + /** + * 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 Exemplar message. Does not implicitly {@link google.api.Distribution.Exemplar.verify|verify} messages. - * @function encode - * @memberof google.api.Distribution.Exemplar - * @static - * @param {google.api.Distribution.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && message.hasOwnProperty("value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.attachments != null && message.attachments.length) - for (var i = 0; i < message.attachments.length; ++i) - $root.google.protobuf.Any.encode(message.attachments[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + 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).ldelim(); - }; + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an Exemplar message from the specified reader or buffer. - * @function decode - * @memberof google.api.Distribution.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Distribution.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Distribution.Exemplar(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - case 2: - message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.attachments && message.attachments.length)) - message.attachments = []; - message.attachments.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes 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()); - }; + } + return message; + }; - /** - * Verifies an Exemplar message. - * @function verify - * @memberof google.api.Distribution.Exemplar - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Exemplar.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { - var error = $root.google.protobuf.Timestamp.verify(message.timestamp); - if (error) - return "timestamp." + error; - } - if (message.attachments != null && message.hasOwnProperty("attachments")) { - if (!Array.isArray(message.attachments)) - return "attachments: array expected"; - for (var i = 0; i < message.attachments.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.attachments[i]); - if (error) - return "attachments." + error; - } - } - return null; - }; + /** + * 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()); + }; - /** - * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Distribution.Exemplar - * @static - * @param {Object.} object Plain object - * @returns {google.api.Distribution.Exemplar} Exemplar - */ - Exemplar.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Distribution.Exemplar) - return object; - var message = new $root.google.api.Distribution.Exemplar(); - if (object.value != null) - message.value = Number(object.value); - if (object.timestamp != null) { - if (typeof object.timestamp !== "object") - throw TypeError(".google.api.Distribution.Exemplar.timestamp: object expected"); - message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp); - } - if (object.attachments) { - if (!Array.isArray(object.attachments)) - throw TypeError(".google.api.Distribution.Exemplar.attachments: array expected"); - message.attachments = []; - for (var i = 0; i < object.attachments.length; ++i) { - if (typeof object.attachments[i] !== "object") - throw TypeError(".google.api.Distribution.Exemplar.attachments: object expected"); - message.attachments[i] = $root.google.protobuf.Any.fromObject(object.attachments[i]); - } - } - return message; - }; + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; - /** - * Creates a plain object from an Exemplar message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Distribution.Exemplar - * @static - * @param {google.api.Distribution.Exemplar} message Exemplar - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exemplar.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attachments = []; - if (options.defaults) { - object.value = 0; - object.timestamp = null; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); - if (message.attachments && message.attachments.length) { - object.attachments = []; - for (var j = 0; j < message.attachments.length; ++j) - object.attachments[j] = $root.google.protobuf.Any.toObject(message.attachments[j], options); - } + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - }; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; - /** - * Converts this Exemplar to JSON. - * @function toJSON - * @memberof google.api.Distribution.Exemplar - * @instance - * @returns {Object.} JSON object - */ - Exemplar.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; - return Exemplar; - })(); + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Distribution; + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @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 + */ + 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; + return values; })(); api.MonitoredResourceDescriptor = (function() { @@ -38237,8 +38687,8 @@ * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @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 + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** @@ -38315,20 +38765,20 @@ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** * Creates a new FieldOptions instance using the specified properties. @@ -38434,6 +38884,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -38444,9 +38897,6 @@ } else message[".google.api.fieldBehavior"].push(reader.int32()); break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -38521,6 +38971,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -38537,11 +38992,6 @@ break; } } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } return null; }; @@ -38603,6 +39053,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -38636,11 +39091,6 @@ break; } } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } return message; }; @@ -44079,369 +44529,6 @@ return BytesValue; })(); - 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) - 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) { - if (!writer) - writer = $Writer.create(); - 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).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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - 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) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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) { - 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); - }; - - 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) - 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) { - if (!writer) - writer = $Writer.create(); - 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).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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - 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) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("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) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - 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) { - if (!options) - options = {}; - 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); - }; - - return FieldMask; - })(); - protobuf.Struct = (function() { /** @@ -45242,6 +45329,369 @@ return ListValue; })(); + 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) + 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) { + if (!writer) + writer = $Writer.create(); + 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).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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + 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); + }; + + 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) + 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) { + if (!writer) + writer = $Writer.create(); + 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).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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("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) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + 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) { + if (!options) + options = {}; + 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); + }; + + return FieldMask; + })(); + return protobuf; })(); diff --git a/protos/protos.json b/protos/protos.json index 22bbef14..7afe9b5d 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -17,156 +17,11 @@ "(google.api.resource_definition).history": "ORIGINALLY_SINGLE_PATTERN" }, "nested": { - "AlertPolicyService": { + "AlertPolicy": { "options": { - "(google.api.default_host)": "monitoring.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + "(google.api.resource).type": "monitoring.googleapis.com/AlertPolicy", + "(google.api.resource).pattern": "*" }, - "methods": { - "ListAlertPolicies": { - "requestType": "ListAlertPoliciesRequest", - "responseType": "ListAlertPoliciesResponse", - "options": { - "(google.api.http).get": "/v3/{name=projects/*}/alertPolicies", - "(google.api.method_signature)": "name" - } - }, - "GetAlertPolicy": { - "requestType": "GetAlertPolicyRequest", - "responseType": "AlertPolicy", - "options": { - "(google.api.http).get": "/v3/{name=projects/*/alertPolicies/*}", - "(google.api.method_signature)": "name" - } - }, - "CreateAlertPolicy": { - "requestType": "CreateAlertPolicyRequest", - "responseType": "AlertPolicy", - "options": { - "(google.api.http).post": "/v3/{name=projects/*}/alertPolicies", - "(google.api.http).body": "alert_policy", - "(google.api.method_signature)": "name,alert_policy" - } - }, - "DeleteAlertPolicy": { - "requestType": "DeleteAlertPolicyRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v3/{name=projects/*/alertPolicies/*}", - "(google.api.method_signature)": "name" - } - }, - "UpdateAlertPolicy": { - "requestType": "UpdateAlertPolicyRequest", - "responseType": "AlertPolicy", - "options": { - "(google.api.http).patch": "/v3/{alert_policy.name=projects/*/alertPolicies/*}", - "(google.api.http).body": "alert_policy", - "(google.api.method_signature)": "update_mask,alert_policy" - } - } - } - }, - "CreateAlertPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "monitoring.googleapis.com/AlertPolicy" - } - }, - "alertPolicy": { - "type": "AlertPolicy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetAlertPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "monitoring.googleapis.com/AlertPolicy" - } - } - } - }, - "ListAlertPoliciesRequest": { - "fields": { - "name": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "monitoring.googleapis.com/AlertPolicy" - } - }, - "filter": { - "type": "string", - "id": 5 - }, - "orderBy": { - "type": "string", - "id": 6 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListAlertPoliciesResponse": { - "fields": { - "alertPolicies": { - "rule": "repeated", - "type": "AlertPolicy", - "id": 3 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateAlertPolicyRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "alertPolicy": { - "type": "AlertPolicy", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteAlertPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "monitoring.googleapis.com/AlertPolicy" - } - } - } - }, - "AlertPolicy": { "fields": { "name": { "type": "string", @@ -230,6 +85,10 @@ } }, "Condition": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/AlertPolicyCondition", + "(google.api.resource).pattern": "*" + }, "oneofs": { "condition": { "oneof": [ @@ -492,109 +351,295 @@ } } }, - "GroupService": { + "AlertPolicyService": { "options": { "(google.api.default_host)": "monitoring.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" }, "methods": { - "ListGroups": { - "requestType": "ListGroupsRequest", - "responseType": "ListGroupsResponse", + "ListAlertPolicies": { + "requestType": "ListAlertPoliciesRequest", + "responseType": "ListAlertPoliciesResponse", "options": { - "(google.api.http).get": "/v3/{name=projects/*}/groups", + "(google.api.http).get": "/v3/{name=projects/*}/alertPolicies", "(google.api.method_signature)": "name" } }, - "GetGroup": { - "requestType": "GetGroupRequest", - "responseType": "Group", + "GetAlertPolicy": { + "requestType": "GetAlertPolicyRequest", + "responseType": "AlertPolicy", "options": { - "(google.api.http).get": "/v3/{name=projects/*/groups/*}", + "(google.api.http).get": "/v3/{name=projects/*/alertPolicies/*}", "(google.api.method_signature)": "name" } }, - "CreateGroup": { - "requestType": "CreateGroupRequest", - "responseType": "Group", - "options": { - "(google.api.http).post": "/v3/{name=projects/*}/groups", - "(google.api.http).body": "group", - "(google.api.method_signature)": "name,group" - } - }, - "UpdateGroup": { - "requestType": "UpdateGroupRequest", - "responseType": "Group", + "CreateAlertPolicy": { + "requestType": "CreateAlertPolicyRequest", + "responseType": "AlertPolicy", "options": { - "(google.api.http).put": "/v3/{group.name=projects/*/groups/*}", - "(google.api.http).body": "group", - "(google.api.method_signature)": "group" + "(google.api.http).post": "/v3/{name=projects/*}/alertPolicies", + "(google.api.http).body": "alert_policy", + "(google.api.method_signature)": "name,alert_policy" } }, - "DeleteGroup": { - "requestType": "DeleteGroupRequest", + "DeleteAlertPolicy": { + "requestType": "DeleteAlertPolicyRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v3/{name=projects/*/groups/*}", + "(google.api.http).delete": "/v3/{name=projects/*/alertPolicies/*}", "(google.api.method_signature)": "name" } }, - "ListGroupMembers": { - "requestType": "ListGroupMembersRequest", - "responseType": "ListGroupMembersResponse", + "UpdateAlertPolicy": { + "requestType": "UpdateAlertPolicyRequest", + "responseType": "AlertPolicy", "options": { - "(google.api.http).get": "/v3/{name=projects/*/groups/*}/members", - "(google.api.method_signature)": "name" + "(google.api.http).patch": "/v3/{alert_policy.name=projects/*/alertPolicies/*}", + "(google.api.http).body": "alert_policy", + "(google.api.method_signature)": "update_mask,alert_policy" } } } }, - "ListGroupsRequest": { - "oneofs": { - "filter": { - "oneof": [ - "childrenOfGroup", - "ancestorsOfGroup", - "descendantsOfGroup" - ] - } - }, + "CreateAlertPolicyRequest": { "fields": { "name": { "type": "string", - "id": 7, + "id": 3, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "monitoring.googleapis.com/Group" + "(google.api.resource_reference).child_type": "monitoring.googleapis.com/AlertPolicy" } }, - "childrenOfGroup": { - "type": "string", + "alertPolicy": { + "type": "AlertPolicy", "id": 2, "options": { - "(google.api.resource_reference).type": "monitoring.googleapis.com/Group" + "(google.api.field_behavior)": "REQUIRED" } - }, - "ancestorsOfGroup": { + } + } + }, + "GetAlertPolicyRequest": { + "fields": { + "name": { "type": "string", "id": 3, "options": { - "(google.api.resource_reference).type": "monitoring.googleapis.com/Group" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "monitoring.googleapis.com/AlertPolicy" } - }, - "descendantsOfGroup": { + } + } + }, + "ListAlertPoliciesRequest": { + "fields": { + "name": { "type": "string", "id": 4, "options": { - "(google.api.resource_reference).type": "monitoring.googleapis.com/Group" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "monitoring.googleapis.com/AlertPolicy" } }, - "pageSize": { - "type": "int32", + "filter": { + "type": "string", "id": 5 }, - "pageToken": { + "orderBy": { + "type": "string", + "id": 6 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAlertPoliciesResponse": { + "fields": { + "alertPolicies": { + "rule": "repeated", + "type": "AlertPolicy", + "id": 3 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateAlertPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "alertPolicy": { + "type": "AlertPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAlertPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "monitoring.googleapis.com/AlertPolicy" + } + } + } + }, + "DroppedLabels": { + "fields": { + "label": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "Group": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/Group", + "(google.api.resource).pattern": "*" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "parentName": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 5 + }, + "isCluster": { + "type": "bool", + "id": 6 + } + } + }, + "GroupService": { + "options": { + "(google.api.default_host)": "monitoring.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + }, + "methods": { + "ListGroups": { + "requestType": "ListGroupsRequest", + "responseType": "ListGroupsResponse", + "options": { + "(google.api.http).get": "/v3/{name=projects/*}/groups", + "(google.api.method_signature)": "name" + } + }, + "GetGroup": { + "requestType": "GetGroupRequest", + "responseType": "Group", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/groups/*}", + "(google.api.method_signature)": "name" + } + }, + "CreateGroup": { + "requestType": "CreateGroupRequest", + "responseType": "Group", + "options": { + "(google.api.http).post": "/v3/{name=projects/*}/groups", + "(google.api.http).body": "group", + "(google.api.method_signature)": "name,group" + } + }, + "UpdateGroup": { + "requestType": "UpdateGroupRequest", + "responseType": "Group", + "options": { + "(google.api.http).put": "/v3/{group.name=projects/*/groups/*}", + "(google.api.http).body": "group", + "(google.api.method_signature)": "group" + } + }, + "DeleteGroup": { + "requestType": "DeleteGroupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/groups/*}", + "(google.api.method_signature)": "name" + } + }, + "ListGroupMembers": { + "requestType": "ListGroupMembersRequest", + "responseType": "ListGroupMembersResponse", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/groups/*}/members", + "(google.api.method_signature)": "name" + } + } + } + }, + "ListGroupsRequest": { + "oneofs": { + "filter": { + "oneof": [ + "childrenOfGroup", + "ancestorsOfGroup", + "descendantsOfGroup" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "monitoring.googleapis.com/Group" + } + }, + "childrenOfGroup": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "monitoring.googleapis.com/Group" + } + }, + "ancestorsOfGroup": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "monitoring.googleapis.com/Group" + } + }, + "descendantsOfGroup": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "monitoring.googleapis.com/Group" + } + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { "type": "string", "id": 6 } @@ -724,27 +769,44 @@ } } }, - "Group": { + "Point": { "fields": { - "name": { - "type": "string", + "interval": { + "type": "TimeInterval", "id": 1 }, - "displayName": { - "type": "string", + "value": { + "type": "TypedValue", "id": 2 + } + } + }, + "TimeSeries": { + "fields": { + "metric": { + "type": "google.api.Metric", + "id": 1 }, - "parentName": { - "type": "string", + "resource": { + "type": "google.api.MonitoredResource", + "id": 2 + }, + "metadata": { + "type": "google.api.MonitoredResourceMetadata", + "id": 7 + }, + "metricKind": { + "type": "google.api.MetricDescriptor.MetricKind", "id": 3 }, - "filter": { - "type": "string", - "id": 5 + "valueType": { + "type": "google.api.MetricDescriptor.ValueType", + "id": 4 }, - "isCluster": { - "type": "bool", - "id": 6 + "points": { + "rule": "repeated", + "type": "Point", + "id": 5 } } }, @@ -1095,44 +1157,95 @@ } } }, - "Point": { + "NotificationChannelDescriptor": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/NotificationChannelDescriptor", + "(google.api.resource).pattern": "*" + }, "fields": { - "interval": { - "type": "TimeInterval", + "name": { + "type": "string", + "id": 6 + }, + "type": { + "type": "string", "id": 1 }, - "value": { - "type": "TypedValue", + "displayName": { + "type": "string", "id": 2 - } - } - }, - "TimeSeries": { - "fields": { - "metric": { - "type": "google.api.Metric", - "id": 1 }, - "resource": { - "type": "google.api.MonitoredResource", - "id": 2 + "description": { + "type": "string", + "id": 3 }, - "metadata": { - "type": "google.api.MonitoredResourceMetadata", + "labels": { + "rule": "repeated", + "type": "google.api.LabelDescriptor", + "id": 4 + }, + "supportedTiers": { + "rule": "repeated", + "type": "ServiceTier", + "id": 5, + "options": { + "deprecated": true + } + }, + "launchStage": { + "type": "google.api.LaunchStage", "id": 7 + } + } + }, + "NotificationChannel": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/NotificationChannel", + "(google.api.resource).pattern": "*" + }, + "fields": { + "type": { + "type": "string", + "id": 1 }, - "metricKind": { - "type": "google.api.MetricDescriptor.MetricKind", + "name": { + "type": "string", + "id": 6 + }, + "displayName": { + "type": "string", "id": 3 }, - "valueType": { - "type": "google.api.MetricDescriptor.ValueType", + "description": { + "type": "string", "id": 4 }, - "points": { - "rule": "repeated", - "type": "Point", + "labels": { + "keyType": "string", + "type": "string", "id": 5 + }, + "userLabels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "verificationStatus": { + "type": "VerificationStatus", + "id": 9 + }, + "enabled": { + "type": "google.protobuf.BoolValue", + "id": 11 + } + }, + "nested": { + "VerificationStatus": { + "values": { + "VERIFICATION_STATUS_UNSPECIFIED": 0, + "UNVERIFIED": 1, + "VERIFIED": 2 + } } } }, @@ -1436,13 +1549,23 @@ } } }, - "NotificationChannelDescriptor": { + "Service": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/Service", + "(google.api.resource).pattern": "*" + }, + "oneofs": { + "identifier": { + "oneof": [ + "custom", + "appEngine", + "cloudEndpoints", + "clusterIstio" + ] + } + }, "fields": { "name": { - "type": "string", - "id": 6 - }, - "type": { "type": "string", "id": 1 }, @@ -1450,94 +1573,354 @@ "type": "string", "id": 2 }, - "description": { - "type": "string", - "id": 3 + "custom": { + "type": "Custom", + "id": 6 }, - "labels": { - "rule": "repeated", - "type": "google.api.LabelDescriptor", - "id": 4 + "appEngine": { + "type": "AppEngine", + "id": 7 }, - "supportedTiers": { - "rule": "repeated", - "type": "ServiceTier", - "id": 5, - "options": { - "deprecated": true + "cloudEndpoints": { + "type": "CloudEndpoints", + "id": 8 + }, + "clusterIstio": { + "type": "ClusterIstio", + "id": 9 + }, + "telemetry": { + "type": "Telemetry", + "id": 13 + } + }, + "nested": { + "Custom": { + "fields": {} + }, + "AppEngine": { + "fields": { + "moduleId": { + "type": "string", + "id": 1 + } + } + }, + "CloudEndpoints": { + "fields": { + "service": { + "type": "string", + "id": 1 + } + } + }, + "ClusterIstio": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "clusterName": { + "type": "string", + "id": 2 + }, + "serviceNamespace": { + "type": "string", + "id": 3 + }, + "serviceName": { + "type": "string", + "id": 4 + } + } + }, + "Telemetry": { + "fields": { + "resourceName": { + "type": "string", + "id": 1 + } } } } }, - "NotificationChannel": { + "ServiceLevelObjective": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/ServiceLevelObjective", + "(google.api.resource).pattern": "*", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, + "oneofs": { + "period": { + "oneof": [ + "rollingPeriod", + "calendarPeriod" + ] + } + }, "fields": { - "type": { - "type": "string", - "id": 1 - }, "name": { "type": "string", - "id": 6 + "id": 1 }, "displayName": { "type": "string", + "id": 11 + }, + "serviceLevelIndicator": { + "type": "ServiceLevelIndicator", "id": 3 }, - "description": { - "type": "string", + "goal": { + "type": "double", "id": 4 }, - "labels": { - "keyType": "string", - "type": "string", + "rollingPeriod": { + "type": "google.protobuf.Duration", "id": 5 }, - "userLabels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "verificationStatus": { - "type": "VerificationStatus", - "id": 9 - }, - "enabled": { - "type": "google.protobuf.BoolValue", - "id": 11 + "calendarPeriod": { + "type": "google.type.CalendarPeriod", + "id": 6 } }, "nested": { - "VerificationStatus": { + "View": { "values": { - "VERIFICATION_STATUS_UNSPECIFIED": 0, - "UNVERIFIED": 1, - "VERIFIED": 2 + "VIEW_UNSPECIFIED": 0, + "FULL": 2, + "EXPLICIT": 1 } } } }, - "ServiceMonitoringService": { - "options": { - "(google.api.default_host)": "monitoring.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + "ServiceLevelIndicator": { + "oneofs": { + "type": { + "oneof": [ + "basicSli", + "requestBased", + "windowsBased" + ] + } }, - "methods": { - "CreateService": { - "requestType": "CreateServiceRequest", - "responseType": "Service", - "options": { - "(google.api.http).post": "/v3/{parent=*/*}/services", - "(google.api.http).body": "service", - "(google.api.method_signature)": "parent,service" - } - }, - "GetService": { - "requestType": "GetServiceRequest", - "responseType": "Service", - "options": { - "(google.api.http).get": "/v3/{name=*/*/services/*}", - "(google.api.method_signature)": "name" - } + "fields": { + "basicSli": { + "type": "BasicSli", + "id": 4 + }, + "requestBased": { + "type": "RequestBasedSli", + "id": 1 + }, + "windowsBased": { + "type": "WindowsBasedSli", + "id": 2 + } + } + }, + "BasicSli": { + "oneofs": { + "sliCriteria": { + "oneof": [ + "availability", + "latency" + ] + } + }, + "fields": { + "method": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "location": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "version": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "availability": { + "type": "AvailabilityCriteria", + "id": 2 + }, + "latency": { + "type": "LatencyCriteria", + "id": 3 + } + }, + "nested": { + "AvailabilityCriteria": { + "fields": {} + }, + "LatencyCriteria": { + "fields": { + "threshold": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + } + } + }, + "Range": { + "fields": { + "min": { + "type": "double", + "id": 1 + }, + "max": { + "type": "double", + "id": 2 + } + } + }, + "RequestBasedSli": { + "oneofs": { + "method": { + "oneof": [ + "goodTotalRatio", + "distributionCut" + ] + } + }, + "fields": { + "goodTotalRatio": { + "type": "TimeSeriesRatio", + "id": 1 + }, + "distributionCut": { + "type": "DistributionCut", + "id": 3 + } + } + }, + "TimeSeriesRatio": { + "fields": { + "goodServiceFilter": { + "type": "string", + "id": 4 + }, + "badServiceFilter": { + "type": "string", + "id": 5 + }, + "totalServiceFilter": { + "type": "string", + "id": 6 + } + } + }, + "DistributionCut": { + "fields": { + "distributionFilter": { + "type": "string", + "id": 4 + }, + "range": { + "type": "Range", + "id": 5 + } + } + }, + "WindowsBasedSli": { + "oneofs": { + "windowCriterion": { + "oneof": [ + "goodBadMetricFilter", + "goodTotalRatioThreshold", + "metricMeanInRange", + "metricSumInRange" + ] + } + }, + "fields": { + "goodBadMetricFilter": { + "type": "string", + "id": 5 + }, + "goodTotalRatioThreshold": { + "type": "PerformanceThreshold", + "id": 2 + }, + "metricMeanInRange": { + "type": "MetricRange", + "id": 6 + }, + "metricSumInRange": { + "type": "MetricRange", + "id": 7 + }, + "windowPeriod": { + "type": "google.protobuf.Duration", + "id": 4 + } + }, + "nested": { + "PerformanceThreshold": { + "oneofs": { + "type": { + "oneof": [ + "performance", + "basicSliPerformance" + ] + } + }, + "fields": { + "performance": { + "type": "RequestBasedSli", + "id": 1 + }, + "basicSliPerformance": { + "type": "BasicSli", + "id": 3 + }, + "threshold": { + "type": "double", + "id": 2 + } + } + }, + "MetricRange": { + "fields": { + "timeSeries": { + "type": "string", + "id": 1 + }, + "range": { + "type": "Range", + "id": 4 + } + } + } + } + }, + "ServiceMonitoringService": { + "options": { + "(google.api.default_host)": "monitoring.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + }, + "methods": { + "CreateService": { + "requestType": "CreateServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).post": "/v3/{parent=*/*}/services", + "(google.api.http).body": "service", + "(google.api.method_signature)": "parent,service" + } + }, + "GetService": { + "requestType": "GetServiceRequest", + "responseType": "Service", + "options": { + "(google.api.http).get": "/v3/{name=*/*/services/*}", + "(google.api.method_signature)": "name" + } }, "ListServices": { "requestType": "ListServicesRequest", @@ -1814,16 +2197,26 @@ } } }, - "Service": { - "oneofs": { - "identifier": { - "oneof": [ - "custom", - "appEngine", - "cloudEndpoints", - "clusterIstio" - ] + "SpanContext": { + "fields": { + "spanName": { + "type": "string", + "id": 1 } + } + }, + "UptimeCheckRegion": { + "values": { + "REGION_UNSPECIFIED": 0, + "USA": 1, + "EUROPE": 2, + "SOUTH_AMERICA": 3, + "ASIA_PACIFIC": 4 + } + }, + "InternalChecker": { + "options": { + "deprecated": true }, "fields": { "name": { @@ -1834,531 +2227,20 @@ "type": "string", "id": 2 }, - "custom": { - "type": "Custom", + "network": { + "type": "string", + "id": 3 + }, + "gcpZone": { + "type": "string", + "id": 4 + }, + "peerProjectId": { + "type": "string", "id": 6 }, - "appEngine": { - "type": "AppEngine", - "id": 7 - }, - "cloudEndpoints": { - "type": "CloudEndpoints", - "id": 8 - }, - "clusterIstio": { - "type": "ClusterIstio", - "id": 9 - }, - "telemetry": { - "type": "Telemetry", - "id": 13 - } - }, - "nested": { - "Custom": { - "fields": {} - }, - "AppEngine": { - "fields": { - "moduleId": { - "type": "string", - "id": 1 - } - } - }, - "CloudEndpoints": { - "fields": { - "service": { - "type": "string", - "id": 1 - } - } - }, - "ClusterIstio": { - "fields": { - "location": { - "type": "string", - "id": 1 - }, - "clusterName": { - "type": "string", - "id": 2 - }, - "serviceNamespace": { - "type": "string", - "id": 3 - }, - "serviceName": { - "type": "string", - "id": 4 - } - } - }, - "Telemetry": { - "fields": { - "resourceName": { - "type": "string", - "id": 1 - } - } - } - } - }, - "ServiceLevelObjective": { - "oneofs": { - "period": { - "oneof": [ - "rollingPeriod", - "calendarPeriod" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 11 - }, - "serviceLevelIndicator": { - "type": "ServiceLevelIndicator", - "id": 3 - }, - "goal": { - "type": "double", - "id": 4 - }, - "rollingPeriod": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "calendarPeriod": { - "type": "google.type.CalendarPeriod", - "id": 6 - } - }, - "nested": { - "View": { - "values": { - "VIEW_UNSPECIFIED": 0, - "FULL": 2, - "EXPLICIT": 1 - } - } - } - }, - "ServiceLevelIndicator": { - "oneofs": { - "type": { - "oneof": [ - "basicSli", - "requestBased", - "windowsBased" - ] - } - }, - "fields": { - "basicSli": { - "type": "BasicSli", - "id": 4 - }, - "requestBased": { - "type": "RequestBasedSli", - "id": 1 - }, - "windowsBased": { - "type": "WindowsBasedSli", - "id": 2 - } - } - }, - "BasicSli": { - "oneofs": { - "sliCriteria": { - "oneof": [ - "availability", - "latency" - ] - } - }, - "fields": { - "method": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "location": { - "rule": "repeated", - "type": "string", - "id": 8 - }, - "version": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "availability": { - "type": "AvailabilityCriteria", - "id": 2 - }, - "latency": { - "type": "LatencyCriteria", - "id": 3 - } - }, - "nested": { - "AvailabilityCriteria": { - "fields": {} - }, - "LatencyCriteria": { - "fields": { - "threshold": { - "type": "google.protobuf.Duration", - "id": 3 - } - } - } - } - }, - "Range": { - "fields": { - "min": { - "type": "double", - "id": 1 - }, - "max": { - "type": "double", - "id": 2 - } - } - }, - "RequestBasedSli": { - "oneofs": { - "method": { - "oneof": [ - "goodTotalRatio", - "distributionCut" - ] - } - }, - "fields": { - "goodTotalRatio": { - "type": "TimeSeriesRatio", - "id": 1 - }, - "distributionCut": { - "type": "DistributionCut", - "id": 3 - } - } - }, - "TimeSeriesRatio": { - "fields": { - "goodServiceFilter": { - "type": "string", - "id": 4 - }, - "badServiceFilter": { - "type": "string", - "id": 5 - }, - "totalServiceFilter": { - "type": "string", - "id": 6 - } - } - }, - "DistributionCut": { - "fields": { - "distributionFilter": { - "type": "string", - "id": 4 - }, - "range": { - "type": "Range", - "id": 5 - } - } - }, - "WindowsBasedSli": { - "oneofs": { - "windowCriterion": { - "oneof": [ - "goodBadMetricFilter", - "goodTotalRatioThreshold", - "metricMeanInRange", - "metricSumInRange" - ] - } - }, - "fields": { - "goodBadMetricFilter": { - "type": "string", - "id": 5 - }, - "goodTotalRatioThreshold": { - "type": "PerformanceThreshold", - "id": 2 - }, - "metricMeanInRange": { - "type": "MetricRange", - "id": 6 - }, - "metricSumInRange": { - "type": "MetricRange", - "id": 7 - }, - "windowPeriod": { - "type": "google.protobuf.Duration", - "id": 4 - } - }, - "nested": { - "PerformanceThreshold": { - "oneofs": { - "type": { - "oneof": [ - "performance", - "basicSliPerformance" - ] - } - }, - "fields": { - "performance": { - "type": "RequestBasedSli", - "id": 1 - }, - "basicSliPerformance": { - "type": "BasicSli", - "id": 3 - }, - "threshold": { - "type": "double", - "id": 2 - } - } - }, - "MetricRange": { - "fields": { - "timeSeries": { - "type": "string", - "id": 1 - }, - "range": { - "type": "Range", - "id": 4 - } - } - } - } - }, - "UptimeCheckService": { - "options": { - "(google.api.default_host)": "monitoring.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" - }, - "methods": { - "ListUptimeCheckConfigs": { - "requestType": "ListUptimeCheckConfigsRequest", - "responseType": "ListUptimeCheckConfigsResponse", - "options": { - "(google.api.http).get": "/v3/{parent=projects/*}/uptimeCheckConfigs", - "(google.api.method_signature)": "parent" - } - }, - "GetUptimeCheckConfig": { - "requestType": "GetUptimeCheckConfigRequest", - "responseType": "UptimeCheckConfig", - "options": { - "(google.api.http).get": "/v3/{name=projects/*/uptimeCheckConfigs/*}", - "(google.api.method_signature)": "name" - } - }, - "CreateUptimeCheckConfig": { - "requestType": "CreateUptimeCheckConfigRequest", - "responseType": "UptimeCheckConfig", - "options": { - "(google.api.http).post": "/v3/{parent=projects/*}/uptimeCheckConfigs", - "(google.api.http).body": "uptime_check_config", - "(google.api.method_signature)": "parent,uptime_check_config" - } - }, - "UpdateUptimeCheckConfig": { - "requestType": "UpdateUptimeCheckConfigRequest", - "responseType": "UptimeCheckConfig", - "options": { - "(google.api.http).patch": "/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}", - "(google.api.http).body": "uptime_check_config", - "(google.api.method_signature)": "uptime_check_config" - } - }, - "DeleteUptimeCheckConfig": { - "requestType": "DeleteUptimeCheckConfigRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v3/{name=projects/*/uptimeCheckConfigs/*}", - "(google.api.method_signature)": "name" - } - }, - "ListUptimeCheckIps": { - "requestType": "ListUptimeCheckIpsRequest", - "responseType": "ListUptimeCheckIpsResponse", - "options": { - "(google.api.http).get": "/v3/uptimeCheckIps" - } - } - } - }, - "ListUptimeCheckConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "monitoring.googleapis.com/UptimeCheckConfig" - } - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListUptimeCheckConfigsResponse": { - "fields": { - "uptimeCheckConfigs": { - "rule": "repeated", - "type": "UptimeCheckConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "GetUptimeCheckConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "monitoring.googleapis.com/UptimeCheckConfig" - } - } - } - }, - "CreateUptimeCheckConfigRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "monitoring.googleapis.com/UptimeCheckConfig" - } - }, - "uptimeCheckConfig": { - "type": "UptimeCheckConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateUptimeCheckConfigRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "uptimeCheckConfig": { - "type": "UptimeCheckConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteUptimeCheckConfigRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "monitoring.googleapis.com/UptimeCheckConfig" - } - } - } - }, - "ListUptimeCheckIpsRequest": { - "fields": { - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListUptimeCheckIpsResponse": { - "fields": { - "uptimeCheckIps": { - "rule": "repeated", - "type": "UptimeCheckIp", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "InternalChecker": { - "options": { - "deprecated": true - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "network": { - "type": "string", - "id": 3 - }, - "gcpZone": { - "type": "string", - "id": 4 - }, - "peerProjectId": { - "type": "string", - "id": 6 - }, - "state": { - "type": "State", + "state": { + "type": "State", "id": 7 } }, @@ -2373,6 +2255,10 @@ } }, "UptimeCheckConfig": { + "options": { + "(google.api.resource).type": "monitoring.googleapis.com/UptimeCheckConfig", + "(google.api.resource).pattern": "*" + }, "oneofs": { "resource": { "oneof": [ @@ -2539,13 +2425,11 @@ } } }, - "UptimeCheckRegion": { + "GroupResourceType": { "values": { - "REGION_UNSPECIFIED": 0, - "USA": 1, - "EUROPE": 2, - "SOUTH_AMERICA": 3, - "ASIA_PACIFIC": 4 + "RESOURCE_TYPE_UNSPECIFIED": 0, + "INSTANCE": 1, + "AWS_ELB_LOAD_BALANCER": 2 } }, "UptimeCheckIp": { @@ -2564,146 +2448,197 @@ } } }, - "GroupResourceType": { - "values": { - "RESOURCE_TYPE_UNSPECIFIED": 0, - "INSTANCE": 1, - "AWS_ELB_LOAD_BALANCER": 2 + "UptimeCheckService": { + "options": { + "(google.api.default_host)": "monitoring.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.read" + }, + "methods": { + "ListUptimeCheckConfigs": { + "requestType": "ListUptimeCheckConfigsRequest", + "responseType": "ListUptimeCheckConfigsResponse", + "options": { + "(google.api.http).get": "/v3/{parent=projects/*}/uptimeCheckConfigs", + "(google.api.method_signature)": "parent" + } + }, + "GetUptimeCheckConfig": { + "requestType": "GetUptimeCheckConfigRequest", + "responseType": "UptimeCheckConfig", + "options": { + "(google.api.http).get": "/v3/{name=projects/*/uptimeCheckConfigs/*}", + "(google.api.method_signature)": "name" + } + }, + "CreateUptimeCheckConfig": { + "requestType": "CreateUptimeCheckConfigRequest", + "responseType": "UptimeCheckConfig", + "options": { + "(google.api.http).post": "/v3/{parent=projects/*}/uptimeCheckConfigs", + "(google.api.http).body": "uptime_check_config", + "(google.api.method_signature)": "parent,uptime_check_config" + } + }, + "UpdateUptimeCheckConfig": { + "requestType": "UpdateUptimeCheckConfigRequest", + "responseType": "UptimeCheckConfig", + "options": { + "(google.api.http).patch": "/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}", + "(google.api.http).body": "uptime_check_config", + "(google.api.method_signature)": "uptime_check_config" + } + }, + "DeleteUptimeCheckConfig": { + "requestType": "DeleteUptimeCheckConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v3/{name=projects/*/uptimeCheckConfigs/*}", + "(google.api.method_signature)": "name" + } + }, + "ListUptimeCheckIps": { + "requestType": "ListUptimeCheckIpsRequest", + "responseType": "ListUptimeCheckIpsResponse", + "options": { + "(google.api.http).get": "/v3/uptimeCheckIps" + } + } } - } - } - } - } - }, - "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", - "cc_enable_arenas": true - }, - "nested": { - "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 + "ListUptimeCheckConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "monitoring.googleapis.com/UptimeCheckConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } }, - "patch": { - "type": "string", - "id": 6 + "ListUptimeCheckConfigsResponse": { + "fields": { + "uptimeCheckConfigs": { + "rule": "repeated", + "type": "UptimeCheckConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 + "GetUptimeCheckConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "monitoring.googleapis.com/UptimeCheckConfig" + } + } + } }, - "body": { - "type": "string", - "id": 7 + "CreateUptimeCheckConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "monitoring.googleapis.com/UptimeCheckConfig" + } + }, + "uptimeCheckConfig": { + "type": "UptimeCheckConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } }, - "responseBody": { - "type": "string", - "id": 12 + "UpdateUptimeCheckConfigRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "uptimeCheckConfig": { + "type": "UptimeCheckConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 + "DeleteUptimeCheckConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "monitoring.googleapis.com/UptimeCheckConfig" + } + } + } }, - "path": { - "type": "string", - "id": 2 + "ListUptimeCheckIpsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListUptimeCheckIpsResponse": { + "fields": { + "uptimeCheckIps": { + "rule": "repeated", + "type": "UptimeCheckIp", + "id": 1 + }, + "nextPageToken": { + "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" - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions" - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5 - } - }, + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "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": { "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -2903,6 +2838,125 @@ } } }, + "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" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, "MonitoredResourceDescriptor": { "fields": { "name": { @@ -4092,18 +4146,6 @@ } } }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, "Struct": { "fields": { "fields": { @@ -4166,6 +4208,18 @@ "id": 1 } } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } } } }, diff --git a/smoke-test/metric_service_smoke_test.js b/smoke-test/metric_service_smoke_test.ts similarity index 94% rename from smoke-test/metric_service_smoke_test.js rename to smoke-test/metric_service_smoke_test.ts index 085f3133..29a02a18 100644 --- a/smoke-test/metric_service_smoke_test.js +++ b/smoke-test/metric_service_smoke_test.ts @@ -12,9 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -'use strict'; - -const {describe, it} = require('mocha'); +import {describe, it} from 'mocha'; describe('MetricServiceSmokeTest', () => { if (!process.env.GCLOUD_PROJECT) { @@ -34,7 +32,7 @@ describe('MetricServiceSmokeTest', () => { client .listMonitoredResourceDescriptors({name: formattedName}) - .then(responses => { + .then((responses: any[]) => { const resources = responses[0]; for (const resource of resources) { console.log(resource); @@ -55,7 +53,7 @@ describe('MetricServiceSmokeTest', () => { const formattedName = client.projectPath(projectId); const options = {autoPaginate: false}; - const callback = responses => { + const callback = (responses: any[]) => { // The actual resources in a response. const resources = responses[0]; // The next request if the response shows that there are more responses. @@ -89,7 +87,7 @@ describe('MetricServiceSmokeTest', () => { const formattedName = client.projectPath(projectId); client .listMonitoredResourceDescriptorsStream({name: formattedName}) - .on('data', element => { + .on('data', (element: any) => { console.log(element); }) .on('error', done) diff --git a/src/browser.js b/src/browser.js deleted file mode 100644 index 68dc62d2..00000000 --- a/src/browser.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -// Set a flag that we are running in a browser bundle. -global.isBrowser = true; - -// Re-export all exports from ./index.js. -module.exports = require('./index'); diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 828a9aad..00000000 --- a/src/index.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2018 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. - -/** - * @namespace google - */ -/** - * @namespace google.monitoring - */ -/** - * @namespace google.monitoring.v3 - */ -/** - * @namespace google.protobuf - */ -/** - * @namespace google.rpc - */ -/** - * @namespace google.api - */ - -'use strict'; - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v3: require('./v3'), -}); - -/** - * The `@google-cloud/monitoring` package has the following named exports: - * - * - `AlertPolicyServiceClient` - Reference to - * {@link v3.AlertPolicyServiceClient} - * - `GroupServiceClient` - Reference to - * {@link v3.GroupServiceClient} - * - `MetricServiceClient` - Reference to - * {@link v3.MetricServiceClient} - * - `NotificationChannelServiceClient` - Reference to - * {@link v3.NotificationChannelServiceClient} - * - `UptimeCheckServiceClient` - Reference to - * {@link v3.UptimeCheckServiceClient} - * - `v3` - This is used for selecting or pinning a - * particular backend service version. It exports: - * - `AlertPolicyServiceClient` - Reference to - * {@link v3.AlertPolicyServiceClient} - * - `GroupServiceClient` - Reference to - * {@link v3.GroupServiceClient} - * - `MetricServiceClient` - Reference to - * {@link v3.MetricServiceClient} - * - `NotificationChannelServiceClient` - Reference to - * {@link v3.NotificationChannelServiceClient} - * - `UptimeCheckServiceClient` - Reference to - * {@link v3.UptimeCheckServiceClient} - * - * @module {object} @google-cloud/monitoring - * @alias nodejs-monitoring - * - * @example Install the client library with npm: - * npm install --save @google-cloud/monitoring - * - * @example Import the client library: - * const monitoring = require('@google-cloud/monitoring'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const client = new monitoring.AlertPolicyServiceClient(); - * - * @example Create a client with explicit credentials: - * const client = new monitoring.AlertPolicyServiceClient({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json', - * }); - */ - -/** - * @type {object} - * @property {constructor} AlertPolicyServiceClient - * Reference to {@link v3.AlertPolicyServiceClient} - * @property {constructor} GroupServiceClient - * Reference to {@link v3.GroupServiceClient} - * @property {constructor} MetricServiceClient - * Reference to {@link v3.MetricServiceClient} - * @property {constructor} NotificationChannelServiceClient - * Reference to {@link v3.NotificationChannelServiceClient} - * @property {constructor} UptimeCheckServiceClient - * Reference to {@link v3.UptimeCheckServiceClient} - */ -module.exports = gapic.v3; - -/** - * @type {object} - * @property {constructor} AlertPolicyServiceClient - * Reference to {@link v3.AlertPolicyServiceClient} - * @property {constructor} GroupServiceClient - * Reference to {@link v3.GroupServiceClient} - * @property {constructor} MetricServiceClient - * Reference to {@link v3.MetricServiceClient} - * @property {constructor} NotificationChannelServiceClient - * Reference to {@link v3.NotificationChannelServiceClient} - * @property {constructor} UptimeCheckServiceClient - * Reference to {@link v3.UptimeCheckServiceClient} - */ -module.exports.v3 = gapic.v3; - -// Alias `module.exports` as `module.exports.default`, for future-proofing. -module.exports.default = Object.assign({}, module.exports); diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..dec24887 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,45 @@ +// Copyright 2019 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 v3 from './v3'; +const AlertPolicyServiceClient = v3.AlertPolicyServiceClient; +const GroupServiceClient = v3.GroupServiceClient; +const MetricServiceClient = v3.MetricServiceClient; +const NotificationChannelServiceClient = v3.NotificationChannelServiceClient; +const ServiceMonitoringServiceClient = v3.ServiceMonitoringServiceClient; +const UptimeCheckServiceClient = v3.UptimeCheckServiceClient; +export { + v3, + AlertPolicyServiceClient, + GroupServiceClient, + MetricServiceClient, + NotificationChannelServiceClient, + ServiceMonitoringServiceClient, + UptimeCheckServiceClient, +}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default { + v3, + AlertPolicyServiceClient, + GroupServiceClient, + MetricServiceClient, + NotificationChannelServiceClient, + ServiceMonitoringServiceClient, + UptimeCheckServiceClient, +}; diff --git a/src/v3/alert_policy_service_client.js b/src/v3/alert_policy_service_client.js deleted file mode 100644 index d3464b2b..00000000 --- a/src/v3/alert_policy_service_client.js +++ /dev/null @@ -1,836 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./alert_policy_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * The AlertPolicyService API is used to manage (list, create, delete, - * edit) alert policies in Stackdriver Monitoring. An alerting policy is - * a description of the conditions under which some aspect of your - * system is considered to be "unhealthy" and the ways to notify - * people or services about this state. In addition to using this API, alert - * policies can also be managed through - * [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/), - * which can be reached by clicking the "Monitoring" tab in - * [Cloud Console](https://console.cloud.google.com/). - * - * @class - * @memberof v3 - */ -class AlertPolicyServiceClient { - /** - * Construct an instance of AlertPolicyServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - alertPolicyPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/alertPolicies/{alert_policy}' - ), - alertPolicyConditionPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - // 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 = { - listAlertPolicies: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'alertPolicies' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.monitoring.v3.AlertPolicyService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.monitoring.v3.AlertPolicyService. - const alertPolicyServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.monitoring.v3.AlertPolicyService') - : protos.google.monitoring.v3.AlertPolicyService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const alertPolicyServiceStubMethods = [ - 'listAlertPolicies', - 'getAlertPolicy', - 'createAlertPolicy', - 'deleteAlertPolicy', - 'updateAlertPolicy', - ]; - for (const methodName of alertPolicyServiceStubMethods) { - const innerCallPromise = alertPolicyServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'monitoring.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'monitoring.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Lists the existing alerting policies for the project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project whose alert policies are to be listed. The format is - * - * projects/[PROJECT_ID] - * - * Note that this field names the parent container in which the alerting - * policies to be listed are stored. To retrieve a single alerting policy - * by name, use the - * GetAlertPolicy - * operation, instead. - * @param {string} [request.filter] - * If provided, this field specifies the criteria that must be met by - * alert policies to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @param {string} [request.orderBy] - * A comma-separated list of fields by which to sort the result. Supports - * the same set of field references as the `filter` field. Entries can be - * prefixed with a minus sign to sort by the field in descending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListAlertPoliciesResponse]{@link google.monitoring.v3.ListAlertPoliciesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListAlertPoliciesResponse]{@link google.monitoring.v3.ListAlertPoliciesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.AlertPolicyServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * - * client.listAlertPolicies({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listAlertPolicies(nextRequest, options).then(callback); - * } - * } - * client.listAlertPolicies({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listAlertPolicies(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listAlertPolicies(request, options, callback); - } - - /** - * Equivalent to {@link listAlertPolicies}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAlertPolicies} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project whose alert policies are to be listed. The format is - * - * projects/[PROJECT_ID] - * - * Note that this field names the parent container in which the alerting - * policies to be listed are stored. To retrieve a single alerting policy - * by name, use the - * GetAlertPolicy - * operation, instead. - * @param {string} [request.filter] - * If provided, this field specifies the criteria that must be met by - * alert policies to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @param {string} [request.orderBy] - * A comma-separated list of fields by which to sort the result. Supports - * the same set of field references as the `filter` field. Entries can be - * prefixed with a minus sign to sort by the field in descending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.AlertPolicyServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * client.listAlertPoliciesStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listAlertPoliciesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listAlertPolicies.createStream( - this._innerApiCalls.listAlertPolicies, - request, - options - ); - } - - /** - * Gets a single alerting policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The alerting policy to retrieve. The format is - * - * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.AlertPolicyServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.alertPolicyPath('[PROJECT]', '[ALERT_POLICY]'); - * client.getAlertPolicy({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getAlertPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getAlertPolicy(request, options, callback); - } - - /** - * Creates a new alerting policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project in which to create the alerting policy. The format is - * `projects/[PROJECT_ID]`. - * - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[POLICY_ID]`, identifying the policy in the container. - * @param {Object} request.alertPolicy - * Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new [ALERT_POLICY_ID] value. - * - * This object should have the same structure as [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.AlertPolicyServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * const alertPolicy = {}; - * const request = { - * name: formattedName, - * alertPolicy: alertPolicy, - * }; - * client.createAlertPolicy(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createAlertPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createAlertPolicy(request, options, callback); - } - - /** - * Deletes an alerting policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The alerting policy to delete. The format is: - * - * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * - * For more information, see AlertPolicy. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.AlertPolicyServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.alertPolicyPath('[PROJECT]', '[ALERT_POLICY]'); - * client.deleteAlertPolicy({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteAlertPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteAlertPolicy(request, options, callback); - } - - /** - * Updates an alerting policy. You can either replace the entire policy with - * a new one or replace only certain fields in the current alerting policy by - * specifying the fields to be updated via `updateMask`. Returns the - * updated alerting policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.alertPolicy - * Required. The updated alerting policy or the updated values for the - * fields listed in `update_mask`. - * If `update_mask` is not empty, any fields in this policy that are - * not in `update_mask` are ignored. - * - * This object should have the same structure as [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} - * @param {Object} [request.updateMask] - * Optional. A list of alerting policy field names. If this field is not - * empty, each listed field in the existing alerting policy is set to the - * value of the corresponding field in the supplied policy (`alert_policy`), - * or to the field's default value if the field is not in the supplied - * alerting policy. Fields not listed retain their previous value. - * - * Examples of valid field masks include `display_name`, `documentation`, - * `documentation.content`, `documentation.mime_type`, `user_labels`, - * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. - * - * If this field is empty, then the supplied alerting policy replaces the - * existing policy. It is the same as deleting the existing policy and - * adding the supplied policy, except for the following: - * - * + The new policy will have the same `[ALERT_POLICY_ID]` as the former - * policy. This gives you continuity with the former policy in your - * notifications and incidents. - * + Conditions in the new policy will keep their former `[CONDITION_ID]` if - * the supplied condition includes the `name` field with that - * `[CONDITION_ID]`. If the supplied condition omits the `name` field, - * then a new `[CONDITION_ID]` is created. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.AlertPolicyServiceClient({ - * // optional auth parameters. - * }); - * - * const alertPolicy = {}; - * client.updateAlertPolicy({alertPolicy: alertPolicy}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateAlertPolicy(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'alert_policy.name': request.alertPolicy.name, - }); - - return this._innerApiCalls.updateAlertPolicy(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified alert_policy resource name string. - * - * @param {String} project - * @param {String} alertPolicy - * @returns {String} - */ - alertPolicyPath(project, alertPolicy) { - return this._pathTemplates.alertPolicyPathTemplate.render({ - project: project, - alert_policy: alertPolicy, - }); - } - - /** - * Return a fully-qualified alert_policy_condition resource name string. - * - * @param {String} project - * @param {String} alertPolicy - * @param {String} condition - * @returns {String} - */ - alertPolicyConditionPath(project, alertPolicy, condition) { - return this._pathTemplates.alertPolicyConditionPathTemplate.render({ - project: project, - alert_policy: alertPolicy, - condition: condition, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the alertPolicyName from a alert_policy resource. - * - * @param {String} alertPolicyName - * A fully-qualified path representing a alert_policy resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromAlertPolicyName(alertPolicyName) { - return this._pathTemplates.alertPolicyPathTemplate.match(alertPolicyName) - .project; - } - - /** - * Parse the alertPolicyName from a alert_policy resource. - * - * @param {String} alertPolicyName - * A fully-qualified path representing a alert_policy resources. - * @returns {String} - A string representing the alert_policy. - */ - matchAlertPolicyFromAlertPolicyName(alertPolicyName) { - return this._pathTemplates.alertPolicyPathTemplate.match(alertPolicyName) - .alert_policy; - } - - /** - * Parse the alertPolicyConditionName from a alert_policy_condition resource. - * - * @param {String} alertPolicyConditionName - * A fully-qualified path representing a alert_policy_condition resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromAlertPolicyConditionName(alertPolicyConditionName) { - return this._pathTemplates.alertPolicyConditionPathTemplate.match( - alertPolicyConditionName - ).project; - } - - /** - * Parse the alertPolicyConditionName from a alert_policy_condition resource. - * - * @param {String} alertPolicyConditionName - * A fully-qualified path representing a alert_policy_condition resources. - * @returns {String} - A string representing the alert_policy. - */ - matchAlertPolicyFromAlertPolicyConditionName(alertPolicyConditionName) { - return this._pathTemplates.alertPolicyConditionPathTemplate.match( - alertPolicyConditionName - ).alert_policy; - } - - /** - * Parse the alertPolicyConditionName from a alert_policy_condition resource. - * - * @param {String} alertPolicyConditionName - * A fully-qualified path representing a alert_policy_condition resources. - * @returns {String} - A string representing the condition. - */ - matchConditionFromAlertPolicyConditionName(alertPolicyConditionName) { - return this._pathTemplates.alertPolicyConditionPathTemplate.match( - alertPolicyConditionName - ).condition; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = AlertPolicyServiceClient; diff --git a/src/v3/alert_policy_service_client.ts b/src/v3/alert_policy_service_client.ts new file mode 100644 index 00000000..d1cb5963 --- /dev/null +++ b/src/v3/alert_policy_service_client.ts @@ -0,0 +1,1878 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './alert_policy_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The AlertPolicyService API is used to manage (list, create, delete, + * edit) alert policies in Stackdriver Monitoring. An alerting policy is + * a description of the conditions under which some aspect of your + * system is considered to be "unhealthy" and the ways to notify + * people or services about this state. In addition to using this API, alert + * policies can also be managed through + * [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/), + * which can be reached by clicking the "Monitoring" tab in + * [Cloud Console](https://console.cloud.google.com/). + * @class + * @memberof v3 + */ +export class AlertPolicyServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + alertPolicyServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AlertPolicyServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof AlertPolicyServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof AlertPolicyServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + folderAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/alertPolicies/{alert_policy}' + ), + folderChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannelDescriptors/{channel_descriptor}' + ), + folderGroupPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/groups/{group}' + ), + folderNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannels/{notification_channel}' + ), + folderServicePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}' + ), + organizationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), + organizationGroupPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/groups/{group}' + ), + organizationNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + projectChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' + ), + projectGroupPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/groups/{group}' + ), + projectNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannels/{notification_channel}' + ), + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' + ), + }; + + // 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 = { + listAlertPolicies: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'alertPolicies' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.AlertPolicyService', + 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 = {}; + + // Put together the "service stub" for + // google.monitoring.v3.AlertPolicyService. + this.alertPolicyServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.monitoring.v3.AlertPolicyService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.monitoring.v3.AlertPolicyService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const alertPolicyServiceStubMethods = [ + 'listAlertPolicies', + 'getAlertPolicy', + 'createAlertPolicy', + 'deleteAlertPolicy', + 'updateAlertPolicy', + ]; + + for (const methodName of alertPolicyServiceStubMethods) { + const innerCallPromise = this.alertPolicyServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getAlertPolicy( + request: protosTypes.google.monitoring.v3.IGetAlertPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IGetAlertPolicyRequest | undefined, + {} | undefined + ] + >; + getAlertPolicy( + request: protosTypes.google.monitoring.v3.IGetAlertPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IGetAlertPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a single alerting policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The alerting policy to retrieve. The format is + * + * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getAlertPolicy( + request: protosTypes.google.monitoring.v3.IGetAlertPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IGetAlertPolicyRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IGetAlertPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IGetAlertPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getAlertPolicy(request, options, callback); + } + createAlertPolicy( + request: protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest | undefined, + {} | undefined + ] + >; + createAlertPolicy( + request: protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a new alerting policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project in which to create the alerting policy. The format is + * `projects/[PROJECT_ID]`. + * + * Note that this field names the parent container in which the alerting + * policy will be written, not the name of the created policy. The alerting + * policy that is returned will have a name that contains a normalized + * representation of this name as a prefix but adds a suffix of the form + * `/alertPolicies/[POLICY_ID]`, identifying the policy in the container. + * @param {google.monitoring.v3.AlertPolicy} request.alertPolicy + * Required. The requested alerting policy. You should omit the `name` field in this + * policy. The name will be returned in the new policy, including + * a new [ALERT_POLICY_ID] value. + * @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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createAlertPolicy( + request: protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + | protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.createAlertPolicy(request, options, callback); + } + deleteAlertPolicy( + request: protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest | undefined, + {} | undefined + ] + >; + deleteAlertPolicy( + request: protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes an alerting policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The alerting policy to delete. The format is: + * + * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + * + * For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteAlertPolicy( + request: protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteAlertPolicy(request, options, callback); + } + updateAlertPolicy( + request: protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest | undefined, + {} | undefined + ] + >; + updateAlertPolicy( + request: protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates an alerting policy. You can either replace the entire policy with + * a new one or replace only certain fields in the current alerting policy by + * specifying the fields to be updated via `updateMask`. Returns the + * updated alerting policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Optional. A list of alerting policy field names. If this field is not + * empty, each listed field in the existing alerting policy is set to the + * value of the corresponding field in the supplied policy (`alert_policy`), + * or to the field's default value if the field is not in the supplied + * alerting policy. Fields not listed retain their previous value. + * + * Examples of valid field masks include `display_name`, `documentation`, + * `documentation.content`, `documentation.mime_type`, `user_labels`, + * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. + * + * If this field is empty, then the supplied alerting policy replaces the + * existing policy. It is the same as deleting the existing policy and + * adding the supplied policy, except for the following: + * + * + The new policy will have the same `[ALERT_POLICY_ID]` as the former + * policy. This gives you continuity with the former policy in your + * notifications and incidents. + * + Conditions in the new policy will keep their former `[CONDITION_ID]` if + * the supplied condition includes the `name` field with that + * `[CONDITION_ID]`. If the supplied condition omits the `name` field, + * then a new `[CONDITION_ID]` is created. + * @param {google.monitoring.v3.AlertPolicy} request.alertPolicy + * Required. The updated alerting policy or the updated values for the + * fields listed in `update_mask`. + * If `update_mask` is not empty, any fields in this policy that are + * not in `update_mask` are 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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateAlertPolicy( + request: protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + | protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy, + protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + 'alert_policy.name': request.alertPolicy!.name || '', + }); + return this._innerApiCalls.updateAlertPolicy(request, options, callback); + } + + listAlertPolicies( + request: protosTypes.google.monitoring.v3.IListAlertPoliciesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy[], + protosTypes.google.monitoring.v3.IListAlertPoliciesRequest | null, + protosTypes.google.monitoring.v3.IListAlertPoliciesResponse + ] + >; + listAlertPolicies( + request: protosTypes.google.monitoring.v3.IListAlertPoliciesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy[], + protosTypes.google.monitoring.v3.IListAlertPoliciesRequest | null, + protosTypes.google.monitoring.v3.IListAlertPoliciesResponse + > + ): void; + /** + * Lists the existing alerting policies for the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project whose alert policies are to be listed. The format is + * + * projects/[PROJECT_ID] + * + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {string} request.orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {number} request.pageSize + * The maximum number of results to return in a single response. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method 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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListAlertPoliciesRequest]{@link google.monitoring.v3.ListAlertPoliciesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListAlertPoliciesResponse]{@link google.monitoring.v3.ListAlertPoliciesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listAlertPolicies( + request: protosTypes.google.monitoring.v3.IListAlertPoliciesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IAlertPolicy[], + protosTypes.google.monitoring.v3.IListAlertPoliciesRequest | null, + protosTypes.google.monitoring.v3.IListAlertPoliciesResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IAlertPolicy[], + protosTypes.google.monitoring.v3.IListAlertPoliciesRequest | null, + protosTypes.google.monitoring.v3.IListAlertPoliciesResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IAlertPolicy[], + protosTypes.google.monitoring.v3.IListAlertPoliciesRequest | null, + protosTypes.google.monitoring.v3.IListAlertPoliciesResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listAlertPolicies(request, options, callback); + } + + /** + * Equivalent to {@link listAlertPolicies}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAlertPolicies} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project whose alert policies are to be listed. The format is + * + * projects/[PROJECT_ID] + * + * Note that this field names the parent container in which the alerting + * policies to be listed are stored. To retrieve a single alerting policy + * by name, use the + * [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy] + * operation, instead. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by + * alert policies to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {string} request.orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of field references as the `filter` field. Entries can be + * prefixed with a minus sign to sort by the field in descending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {number} request.pageSize + * The maximum number of results to return in a single response. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method 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 [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} on 'data' event. + */ + listAlertPoliciesStream( + request?: protosTypes.google.monitoring.v3.IListAlertPoliciesRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listAlertPolicies.createStream( + this._innerApiCalls.listAlertPolicies as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAlertPolicy resource name string. + * + * @param {string} folder + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + folderAlertPolicyPath(folder: string, alertPolicy: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.render({ + folder, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the folder from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).folder; + } + + /** + * Parse the alert_policy from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified folderChannelDescriptor resource name string. + * + * @param {string} folder + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + folderChannelDescriptorPath(folder: string, channelDescriptor: string) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.render({ + folder, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the folder from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).folder; + } + + /** + * Parse the channel_descriptor from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified folderGroup resource name string. + * + * @param {string} folder + * @param {string} group + * @returns {string} Resource name string. + */ + folderGroupPath(folder: string, group: string) { + return this._pathTemplates.folderGroupPathTemplate.render({ + folder, + group, + }); + } + + /** + * Parse the folder from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .folder; + } + + /** + * Parse the group from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .group; + } + + /** + * Return a fully-qualified folderNotificationChannel resource name string. + * + * @param {string} folder + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + folderNotificationChannelPath(folder: string, notificationChannel: string) { + return this._pathTemplates.folderNotificationChannelPathTemplate.render({ + folder, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the folder from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).folder; + } + + /** + * Parse the notification_channel from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder, + service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).service; + } + + /** + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * + * @param {string} folder + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + folderServiceServiceLevelObjectivePath( + folder: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render( + { + folder, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the folder from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).folder; + } + + /** + * Parse the service from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified folderUptimeCheckConfig resource name string. + * + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the folder from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).folder; + } + + /** + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Return a fully-qualified organizationAlertPolicy resource name string. + * + * @param {string} organization + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + organizationAlertPolicyPath(organization: string, alertPolicy: string) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.render({ + organization, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the organization from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).organization; + } + + /** + * Parse the alert_policy from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified organizationChannelDescriptor resource name string. + * + * @param {string} organization + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + organizationChannelDescriptorPath( + organization: string, + channelDescriptor: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.render( + { + organization, + channel_descriptor: channelDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).organization; + } + + /** + * Parse the channel_descriptor from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified organizationGroup resource name string. + * + * @param {string} organization + * @param {string} group + * @returns {string} Resource name string. + */ + organizationGroupPath(organization: string, group: string) { + return this._pathTemplates.organizationGroupPathTemplate.render({ + organization, + group, + }); + } + + /** + * Parse the organization from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).organization; + } + + /** + * Parse the group from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).group; + } + + /** + * Return a fully-qualified organizationNotificationChannel resource name string. + * + * @param {string} organization + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + organizationNotificationChannelPath( + organization: string, + notificationChannel: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.render( + { + organization, + notification_channel: notificationChannel, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).organization; + } + + /** + * Parse the notification_channel from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization, + service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified organizationServiceServiceLevelObjective resource name string. + * + * @param {string} organization + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + organizationServiceServiceLevelObjectivePath( + organization: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render( + { + organization, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the organization from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).organization; + } + + /** + * Parse the service from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * + * @param {string} organization + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + organizationUptimeCheckConfigPath( + organization: string, + uptimeCheckConfig: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render( + { + organization, + uptime_check_config: uptimeCheckConfig, + } + ); + } + + /** + * Parse the organization from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).organization; + } + + /** + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * 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, + }); + } + + /** + * 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 projectAlertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + projectAlertPolicyPath(project: string, alertPolicy: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.render({ + project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).project; + } + + /** + * Parse the alert_policy from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified projectChannelDescriptor resource name string. + * + * @param {string} project + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + projectChannelDescriptorPath(project: string, channelDescriptor: string) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.render({ + project, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the project from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).project; + } + + /** + * Parse the channel_descriptor from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified projectGroup resource name string. + * + * @param {string} project + * @param {string} group + * @returns {string} Resource name string. + */ + projectGroupPath(project: string, group: string) { + return this._pathTemplates.projectGroupPathTemplate.render({ + project, + group, + }); + } + + /** + * Parse the project from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .project; + } + + /** + * Parse the group from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .group; + } + + /** + * Return a fully-qualified projectNotificationChannel resource name string. + * + * @param {string} project + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + projectNotificationChannelPath(project: string, notificationChannel: string) { + return this._pathTemplates.projectNotificationChannelPathTemplate.render({ + project, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the project from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).project; + } + + /** + * Parse the notification_channel from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this._pathTemplates.projectServicePathTemplate.render({ + project, + service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } + + /** + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * + * @param {string} project + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + projectServiceServiceLevelObjectivePath( + project: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render( + { + project, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the project from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).project; + } + + /** + * Parse the service from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the project from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).project; + } + + /** + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.alertPolicyServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3/alert_policy_service_client_config.json b/src/v3/alert_policy_service_client_config.json index d6101cca..437f8cf2 100644 --- a/src/v3/alert_policy_service_client_config.json +++ b/src/v3/alert_policy_service_client_config.json @@ -2,46 +2,55 @@ "interfaces": { "google.monitoring.v3.AlertPolicyService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ListAlertPolicies": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "UpdateAlertPolicy": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/src/v3/alert_policy_service_proto_list.json b/src/v3/alert_policy_service_proto_list.json index 7e6fbb33..0534dc6a 100644 --- a/src/v3/alert_policy_service_proto_list.json +++ b/src/v3/alert_policy_service_proto_list.json @@ -1,3 +1,18 @@ [ - "../../protos/google/monitoring/v3/alert_service.proto" + "../../protos/google/monitoring/v3/alert.proto", + "../../protos/google/monitoring/v3/alert_service.proto", + "../../protos/google/monitoring/v3/common.proto", + "../../protos/google/monitoring/v3/dropped_labels.proto", + "../../protos/google/monitoring/v3/group.proto", + "../../protos/google/monitoring/v3/group_service.proto", + "../../protos/google/monitoring/v3/metric.proto", + "../../protos/google/monitoring/v3/metric_service.proto", + "../../protos/google/monitoring/v3/mutation_record.proto", + "../../protos/google/monitoring/v3/notification.proto", + "../../protos/google/monitoring/v3/notification_service.proto", + "../../protos/google/monitoring/v3/service.proto", + "../../protos/google/monitoring/v3/service_service.proto", + "../../protos/google/monitoring/v3/span_context.proto", + "../../protos/google/monitoring/v3/uptime.proto", + "../../protos/google/monitoring/v3/uptime_service.proto" ] diff --git a/src/v3/doc/google/api/doc_distribution.js b/src/v3/doc/google/api/doc_distribution.js deleted file mode 100644 index b7e06749..00000000 --- a/src/v3/doc/google/api/doc_distribution.js +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Distribution` contains summary statistics for a population of values. It - * optionally contains a histogram representing the distribution of those values - * across a set of buckets. - * - * The summary statistics are the count, mean, sum of the squared deviation from - * the mean, the minimum, and the maximum of the set of population of values. - * The histogram is based on a sequence of buckets and gives a count of values - * that fall into each bucket. The boundaries of the buckets are given either - * explicitly or by formulas for buckets of fixed or exponentially increasing - * widths. - * - * Although it is not forbidden, it is generally a bad idea to include - * non-finite values (infinities or NaNs) in the population of values, as this - * will render the `mean` and `sum_of_squared_deviation` fields meaningless. - * - * @property {number} count - * The number of values in the population. Must be non-negative. This value - * must equal the sum of the values in `bucket_counts` if a histogram is - * provided. - * - * @property {number} mean - * The arithmetic mean of the values in the population. If `count` is zero - * then this field must be zero. - * - * @property {number} sumOfSquaredDeviation - * The sum of squared deviations from the mean of the values in the - * population. For values x_i this is: - * - * Sum\[i=1..n](x_1 - mean)^2 - * - * Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition - * describes Welford's method for accumulating this sum in one pass. - * - * If `count` is zero then this field must be zero. - * - * @property {Object} range - * If specified, contains the range of the population values. The field - * must not be present if the `count` is zero. - * - * This object should have the same structure as [Range]{@link google.api.Range} - * - * @property {Object} bucketOptions - * Defines the histogram bucket boundaries. If the distribution does not - * contain a histogram, then omit this field. - * - * This object should have the same structure as [BucketOptions]{@link google.api.BucketOptions} - * - * @property {number[]} bucketCounts - * The number of values in each bucket of the histogram, as described in - * `bucket_options`. If the distribution does not have a histogram, then omit - * this field. If there is a histogram, then the sum of the values in - * `bucket_counts` must equal the value in the `count` field of the - * distribution. - * - * If present, `bucket_counts` should contain N values, where N is the number - * of buckets specified in `bucket_options`. If you supply fewer than N - * values, the remaining values are assumed to be 0. - * - * The order of the values in `bucket_counts` follows the bucket numbering - * schemes described for the three bucket types. The first value must be the - * count for the underflow bucket (number 0). The next N-2 values are the - * counts for the finite buckets (number 1 through N-2). The N'th value in - * `bucket_counts` is the count for the overflow bucket (number N-1). - * - * @property {Object[]} exemplars - * Must be in increasing order of `value` field. - * - * This object should have the same structure as [Exemplar]{@link google.api.Exemplar} - * - * @typedef Distribution - * @memberof google.api - * @see [google.api.Distribution definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ -const Distribution = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The range of the population values. - * - * @property {number} min - * The minimum of the population values. - * - * @property {number} max - * The maximum of the population values. - * - * @typedef Range - * @memberof google.api - * @see [google.api.Distribution.Range definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ - Range: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * `BucketOptions` describes the bucket boundaries used to create a histogram - * for the distribution. The buckets can be in a linear sequence, an - * exponential sequence, or each bucket can be specified explicitly. - * `BucketOptions` does not include the number of values in each bucket. - * - * A bucket has an inclusive lower bound and exclusive upper bound for the - * values that are counted for that bucket. The upper bound of a bucket must - * be strictly greater than the lower bound. The sequence of N buckets for a - * distribution consists of an underflow bucket (number 0), zero or more - * finite buckets (number 1 through N - 2) and an overflow bucket (number N - - * 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the - * same as the upper bound of bucket i - 1. The buckets span the whole range - * of finite values: lower bound of the underflow bucket is -infinity and the - * upper bound of the overflow bucket is +infinity. The finite buckets are - * so-called because both bounds are finite. - * - * @property {Object} linearBuckets - * The linear bucket. - * - * This object should have the same structure as [Linear]{@link google.api.Linear} - * - * @property {Object} exponentialBuckets - * The exponential buckets. - * - * This object should have the same structure as [Exponential]{@link google.api.Exponential} - * - * @property {Object} explicitBuckets - * The explicit buckets. - * - * This object should have the same structure as [Explicit]{@link google.api.Explicit} - * - * @typedef BucketOptions - * @memberof google.api - * @see [google.api.Distribution.BucketOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ - BucketOptions: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Specifies a linear sequence of buckets that all have the same width - * (except overflow and underflow). Each bucket represents a constant - * absolute uncertainty on the specific value in the bucket. - * - * There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the - * following boundaries: - * - * Upper bound (0 <= i < N-1): offset + (width * i). - * Lower bound (1 <= i < N): offset + (width * (i - 1)). - * - * @property {number} numFiniteBuckets - * Must be greater than 0. - * - * @property {number} width - * Must be greater than 0. - * - * @property {number} offset - * Lower bound of the first bucket. - * - * @typedef Linear - * @memberof google.api - * @see [google.api.Distribution.BucketOptions.Linear definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ - Linear: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Specifies an exponential sequence of buckets that have a width that is - * proportional to the value of the lower bound. Each bucket represents a - * constant relative uncertainty on a specific value in the bucket. - * - * There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the - * following boundaries: - * - * Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). - * - * @property {number} numFiniteBuckets - * Must be greater than 0. - * - * @property {number} growthFactor - * Must be greater than 1. - * - * @property {number} scale - * Must be greater than 0. - * - * @typedef Exponential - * @memberof google.api - * @see [google.api.Distribution.BucketOptions.Exponential definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ - Exponential: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Specifies a set of buckets with arbitrary widths. - * - * There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following - * boundaries: - * - * Upper bound (0 <= i < N-1): bounds[i] - * Lower bound (1 <= i < N); bounds[i - 1] - * - * The `bounds` field must contain at least one element. If `bounds` has - * only one element, then there are no finite buckets, and that single - * element is the common boundary of the overflow and underflow buckets. - * - * @property {number[]} bounds - * The values must be monotonically increasing. - * - * @typedef Explicit - * @memberof google.api - * @see [google.api.Distribution.BucketOptions.Explicit definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ - Explicit: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Exemplars are example points that may be used to annotate aggregated - * distribution values. They are metadata that gives information about a - * particular value added to a Distribution bucket, such as a trace ID that - * was active when a value was added. They may contain further information, - * such as a example values and timestamps, origin, etc. - * - * @property {number} value - * Value of the exemplar point. This value determines to which bucket the - * exemplar belongs. - * - * @property {Object} timestamp - * The observation (sampling) time of the above value. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object[]} attachments - * Contextual information about the example value. Examples are: - * - * Trace: type.googleapis.com/google.monitoring.v3.SpanContext - * - * Literal string: type.googleapis.com/google.protobuf.StringValue - * - * Labels dropped during aggregation: - * type.googleapis.com/google.monitoring.v3.DroppedLabels - * - * There may be only a single attachment of any given message type in a - * single exemplar, and this is enforced by the system. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Exemplar - * @memberof google.api - * @see [google.api.Distribution.Exemplar definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/distribution.proto} - */ - Exemplar: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; \ No newline at end of file diff --git a/src/v3/doc/google/api/doc_label.js b/src/v3/doc/google/api/doc_label.js deleted file mode 100644 index 24d32531..00000000 --- a/src/v3/doc/google/api/doc_label.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A description of a label. - * - * @property {string} key - * The label key. - * - * @property {number} valueType - * The type of data that can be assigned to the label. - * - * The number should be among the values of [ValueType]{@link google.api.ValueType} - * - * @property {string} description - * A human-readable description for the label. - * - * @typedef LabelDescriptor - * @memberof google.api - * @see [google.api.LabelDescriptor definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/label.proto} - */ -const LabelDescriptor = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Value types that can be used as label values. - * - * @enum {number} - * @memberof google.api - */ - ValueType: { - - /** - * A variable-length string. This is the default. - */ - STRING: 0, - - /** - * Boolean; true or false. - */ - BOOL: 1, - - /** - * A 64-bit signed integer. - */ - INT64: 2 - } -}; \ No newline at end of file diff --git a/src/v3/doc/google/api/doc_metric.js b/src/v3/doc/google/api/doc_metric.js deleted file mode 100644 index 7b324ed2..00000000 --- a/src/v3/doc/google/api/doc_metric.js +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - * - * @property {string} name - * The resource name of the metric descriptor. - * - * @property {string} type - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined metric types have the DNS name - * `custom.googleapis.com` or `external.googleapis.com`. Metric types should - * use a natural hierarchical grouping. For example: - * - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" - * - * @property {Object[]} labels - * The set of labels that can be used to describe a specific - * instance of this metric type. For example, the - * `appengine.googleapis.com/http/server/response_latencies` metric - * type has a label for the HTTP response code, `response_code`, so - * you can look at latencies for successful responses or just - * for responses that failed. - * - * This object should have the same structure as [LabelDescriptor]{@link google.api.LabelDescriptor} - * - * @property {number} metricKind - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - * - * The number should be among the values of [MetricKind]{@link google.api.MetricKind} - * - * @property {number} valueType - * Whether the measurement is an integer, a floating-point number, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - * - * The number should be among the values of [ValueType]{@link google.api.ValueType} - * - * @property {string} unit - * The units in which the metric value is reported. It is only applicable - * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` - * defines the representation of the stored metric values. - * - * Different systems may scale the values to be more easily displayed (so a - * value of `0.02KBy` _might_ be displayed as `20By`, and a value of - * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is - * `KBy`, then the value of the metric is always in thousands of bytes, no - * matter how it may be displayed.. - * - * If you want a custom metric to record the exact number of CPU-seconds used - * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is - * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 - * CPU-seconds, then the value is written as `12005`. - * - * Alternatively, if you want a custome metric to record data in a more - * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is - * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), - * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). - * - * The supported units are a subset of [The Unified Code for Units of - * Measure](http://unitsofmeasure.org/ucum.html) standard: - * - * **Basic units (UNIT)** - * - * * `bit` bit - * * `By` byte - * * `s` second - * * `min` minute - * * `h` hour - * * `d` day - * - * **Prefixes (PREFIX)** - * - * * `k` kilo (10^3) - * * `M` mega (10^6) - * * `G` giga (10^9) - * * `T` tera (10^12) - * * `P` peta (10^15) - * * `E` exa (10^18) - * * `Z` zetta (10^21) - * * `Y` yotta (10^24) - * - * * `m` milli (10^-3) - * * `u` micro (10^-6) - * * `n` nano (10^-9) - * * `p` pico (10^-12) - * * `f` femto (10^-15) - * * `a` atto (10^-18) - * * `z` zepto (10^-21) - * * `y` yocto (10^-24) - * - * * `Ki` kibi (2^10) - * * `Mi` mebi (2^20) - * * `Gi` gibi (2^30) - * * `Ti` tebi (2^40) - * * `Pi` pebi (2^50) - * - * **Grammar** - * - * The grammar also includes these connectors: - * - * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). - * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. - * - * The grammar for a unit is as follows: - * - * Expression = Component { "." Component } { "/" Component } ; - * - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * - * Annotation = "{" NAME "}" ; - * - * Notes: - * - * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. - * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. - * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). - * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). - * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). - * - * @property {string} description - * A detailed description of the metric, which can be used in documentation. - * - * @property {string} displayName - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request count". - * This field is optional but it is recommended to be set for any metrics - * associated with user-visible concepts, such as Quota. - * - * @property {Object} metadata - * Optional. Metadata which can be used to guide usage of the metric. - * - * This object should have the same structure as [MetricDescriptorMetadata]{@link google.api.MetricDescriptorMetadata} - * - * @property {number} launchStage - * Optional. The launch stage of the metric definition. - * - * The number should be among the values of [LaunchStage]{@link google.api.LaunchStage} - * - * @typedef MetricDescriptor - * @memberof google.api - * @see [google.api.MetricDescriptor definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/metric.proto} - */ -const MetricDescriptor = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Additional annotations that can be used to guide the usage of a metric. - * - * @property {number} launchStage - * Deprecated. Please use the MetricDescriptor.launch_stage instead. - * The launch stage of the metric definition. - * - * The number should be among the values of [LaunchStage]{@link google.api.LaunchStage} - * - * @property {Object} samplePeriod - * The sampling period of metric data points. For metrics which are written - * periodically, consecutive data points are stored at this time interval, - * excluding data loss due to errors. Metrics with a higher granularity have - * a smaller sampling period. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} ingestDelay - * The delay of data points caused by ingestion. Data points older than this - * age are guaranteed to be ingested and available to be read, excluding - * data loss due to errors. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @typedef MetricDescriptorMetadata - * @memberof google.api - * @see [google.api.MetricDescriptor.MetricDescriptorMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/metric.proto} - */ - MetricDescriptorMetadata: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * The kind of measurement. It describes how the data is reported. - * - * @enum {number} - * @memberof google.api - */ - MetricKind: { - - /** - * Do not use this default value. - */ - METRIC_KIND_UNSPECIFIED: 0, - - /** - * An instantaneous measurement of a value. - */ - GAUGE: 1, - - /** - * The change in a value during a time interval. - */ - DELTA: 2, - - /** - * A value accumulated over a time interval. Cumulative - * measurements in a time series should have the same start time - * and increasing end times, until an event resets the cumulative - * value to zero and sets a new start time for the following - * points. - */ - CUMULATIVE: 3 - }, - - /** - * The value type of a metric. - * - * @enum {number} - * @memberof google.api - */ - ValueType: { - - /** - * Do not use this default value. - */ - VALUE_TYPE_UNSPECIFIED: 0, - - /** - * The value is a boolean. - * This value type can be used only if the metric kind is `GAUGE`. - */ - BOOL: 1, - - /** - * The value is a signed 64-bit integer. - */ - INT64: 2, - - /** - * The value is a double precision floating point number. - */ - DOUBLE: 3, - - /** - * The value is a text string. - * This value type can be used only if the metric kind is `GAUGE`. - */ - STRING: 4, - - /** - * The value is a `Distribution`. - */ - DISTRIBUTION: 5, - - /** - * The value is money. - */ - MONEY: 6 - } -}; - -/** - * A specific metric, identified by specifying values for all of the - * labels of a `MetricDescriptor`. - * - * @property {string} type - * An existing metric type, see google.api.MetricDescriptor. - * For example, `custom.googleapis.com/invoice/paid/amount`. - * - * @property {Object.} labels - * The set of label values that uniquely identify this metric. All - * labels listed in the `MetricDescriptor` must be assigned values. - * - * @typedef Metric - * @memberof google.api - * @see [google.api.Metric definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/metric.proto} - */ -const Metric = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/api/doc_monitored_resource.js b/src/v3/doc/google/api/doc_monitored_resource.js deleted file mode 100644 index be4e189f..00000000 --- a/src/v3/doc/google/api/doc_monitored_resource.js +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource - * descriptor for Google Compute Engine VM instances has a type of - * `"gce_instance"` and specifies the use of the labels `"instance_id"` and - * `"zone"` to identify particular VM instances. - * - * Different APIs can support different monitored resource types. APIs generally - * provide a `list` method that returns the monitored resource descriptors used - * by the API. - * - * @property {string} name - * Optional. The resource name of the monitored resource descriptor: - * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where - * {type} is the value of the `type` field in this object and - * {project_id} is a project ID that provides API-specific context for - * accessing the type. APIs that do not use project information can use the - * resource name format `"monitoredResourceDescriptors/{type}"`. - * - * @property {string} type - * Required. The monitored resource type. For example, the type - * `"cloudsql_database"` represents databases in Google Cloud SQL. - * The maximum length of this value is 256 characters. - * - * @property {string} displayName - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, - * `"Google Cloud SQL Database"`. - * - * @property {string} description - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - * - * @property {Object[]} labels - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels `"database_id"` and `"zone"`. - * - * This object should have the same structure as [LabelDescriptor]{@link google.api.LabelDescriptor} - * - * @property {number} launchStage - * Optional. The launch stage of the monitored resource definition. - * - * The number should be among the values of [LaunchStage]{@link google.api.LaunchStage} - * - * @typedef MonitoredResourceDescriptor - * @memberof google.api - * @see [google.api.MonitoredResourceDescriptor definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/monitored_resource.proto} - */ -const MonitoredResourceDescriptor = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An object representing a resource that can be used for monitoring, logging, - * billing, or other purposes. Examples include virtual machine instances, - * databases, and storage devices such as disks. The `type` field identifies a - * MonitoredResourceDescriptor object that describes the resource's - * schema. Information in the `labels` field identifies the actual resource and - * its attributes according to the schema. For example, a particular Compute - * Engine VM instance could be represented by the following object, because the - * MonitoredResourceDescriptor for `"gce_instance"` has labels - * `"instance_id"` and `"zone"`: - * - * { "type": "gce_instance", - * "labels": { "instance_id": "12345678901234", - * "zone": "us-central1-a" }} - * - * @property {string} type - * Required. The monitored resource type. This field must match - * the `type` field of a MonitoredResourceDescriptor object. For - * example, the type of a Compute Engine VM instance is `gce_instance`. - * - * @property {Object.} labels - * Required. Values for all of the labels listed in the associated monitored - * resource descriptor. For example, Compute Engine VM instances use the - * labels `"project_id"`, `"instance_id"`, and `"zone"`. - * - * @typedef MonitoredResource - * @memberof google.api - * @see [google.api.MonitoredResource definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/monitored_resource.proto} - */ -const MonitoredResource = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Auxiliary metadata for a MonitoredResource object. - * MonitoredResource objects contain the minimum set of information to - * uniquely identify a monitored resource instance. There is some other useful - * auxiliary metadata. Monitoring and Logging use an ingestion - * pipeline to extract metadata for cloud resources of all types, and store - * the metadata in this message. - * - * @property {Object} systemLabels - * Output only. Values for predefined system metadata labels. - * System labels are a kind of metadata extracted by Google, including - * "machine_image", "vpc", "subnet_id", - * "security_group", "name", etc. - * System label values can be only strings, Boolean values, or a list of - * strings. For example: - * - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object.} userLabels - * Output only. A map of user-defined metadata labels. - * - * @typedef MonitoredResourceMetadata - * @memberof google.api - * @see [google.api.MonitoredResourceMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/api/monitored_resource.proto} - */ -const MonitoredResourceMetadata = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_alert.js b/src/v3/doc/google/monitoring/v3/doc_alert.js deleted file mode 100644 index b24f7f5d..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_alert.js +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A description of the conditions under which some aspect of your system is - * considered to be "unhealthy" and the ways to notify people or services about - * this state. For an overview of alert policies, see - * [Introduction to Alerting](https://cloud.google.com/monitoring/alerts/). - * - * @property {string} name - * Required if the policy exists. The resource name for this policy. The - * syntax is: - * - * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * - * `[ALERT_POLICY_ID]` is assigned by Stackdriver Monitoring when the policy - * is created. When calling the - * alertPolicies.create - * method, do not include the `name` field in the alerting policy passed as - * part of the request. - * - * @property {string} displayName - * A short name or phrase used to identify the policy in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple policies in the same project. The name is - * limited to 512 Unicode characters. - * - * @property {Object} documentation - * Documentation that is included with notifications and incidents related to - * this policy. Best practice is for the documentation to include information - * to help responders understand, mitigate, escalate, and correct the - * underlying problems detected by the alerting policy. Notification channels - * that have limited capacity might not show this documentation. - * - * This object should have the same structure as [Documentation]{@link google.monitoring.v3.Documentation} - * - * @property {Object.} userLabels - * User-supplied key/value data to be used for organizing and - * identifying the `AlertPolicy` objects. - * - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * @property {Object[]} conditions - * A list of conditions for the policy. The conditions are combined by AND or - * OR according to the `combiner` field. If the combined conditions evaluate - * to true, then an incident is created. A policy can have from one to six - * conditions. - * If |condition_time_series_uery_language| is present, it must be the only - * |condition|. - * - * This object should have the same structure as [Condition]{@link google.monitoring.v3.Condition} - * - * @property {number} combiner - * How to combine the results of multiple conditions to determine if an - * incident should be opened. - * If condition_time_series_query_language is present, this must be - * COMBINE_UNSPECIFIED. - * - * The number should be among the values of [ConditionCombinerType]{@link google.monitoring.v3.ConditionCombinerType} - * - * @property {Object} enabled - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The - * field should always be populated on List and Get operations, unless - * a field projection has been specified that strips it out. - * - * This object should have the same structure as [BoolValue]{@link google.protobuf.BoolValue} - * - * @property {Object} validity - * Read-only description of how the alert policy is invalid. OK if the alert - * policy is valid. If not OK, the alert policy will not generate incidents. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @property {string[]} notificationChannels - * Identifies the notification channels to which notifications should be sent - * when incidents are opened or closed or when new violations occur on - * an already opened incident. Each element of this array corresponds to - * the `name` field in each of the - * `NotificationChannel` - * objects that are returned from the [`ListNotificationChannels`] - * [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] - * method. The syntax of the entries in this field is: - * - * projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] - * - * @property {Object} creationRecord - * A read-only record of the creation of the alerting policy. If provided - * in a call to create or update, this field will be ignored. - * - * This object should have the same structure as [MutationRecord]{@link google.monitoring.v3.MutationRecord} - * - * @property {Object} mutationRecord - * A read-only record of the most recent change to the alerting policy. If - * provided in a call to create or update, this field will be ignored. - * - * This object should have the same structure as [MutationRecord]{@link google.monitoring.v3.MutationRecord} - * - * @typedef AlertPolicy - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.AlertPolicy definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert.proto} - */ -const AlertPolicy = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A content string and a MIME type that describes the content string's - * format. - * - * @property {string} content - * The text of the documentation, interpreted according to `mime_type`. - * The content may not exceed 8,192 Unicode characters and may not exceed - * more than 10,240 bytes when encoded in UTF-8 format, whichever is - * smaller. - * - * @property {string} mimeType - * The format of the `content` field. Presently, only the value - * `"text/markdown"` is supported. See - * [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. - * - * @typedef Documentation - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.AlertPolicy.Documentation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert.proto} - */ - Documentation: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A condition is a true/false test that determines when an alerting policy - * should open an incident. If a condition evaluates to true, it signifies - * that something is wrong. - * - * @property {string} name - * Required if the condition exists. The unique resource name for this - * condition. Its syntax is: - * - * projects/[PROJECT_ID]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] - * - * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the - * condition is created as part of a new or updated alerting policy. - * - * When calling the - * alertPolicies.create - * method, do not include the `name` field in the conditions of the - * requested alerting policy. Stackdriver Monitoring creates the - * condition identifiers and includes them in the new policy. - * - * When calling the - * alertPolicies.update - * method to update a policy, including a condition `name` causes the - * existing condition to be updated. Conditions without names are added to - * the updated policy. Existing conditions are deleted if they are not - * updated. - * - * Best practice is to preserve `[CONDITION_ID]` if you make only small - * changes, such as those to condition thresholds, durations, or trigger - * values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - * - * @property {string} displayName - * A short name or phrase used to identify the condition in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple conditions in the same policy. - * - * @property {Object} conditionThreshold - * A condition that compares a time series against a threshold. - * - * This object should have the same structure as [MetricThreshold]{@link google.monitoring.v3.MetricThreshold} - * - * @property {Object} conditionAbsent - * A condition that checks that a time series continues to - * receive new data points. - * - * This object should have the same structure as [MetricAbsence]{@link google.monitoring.v3.MetricAbsence} - * - * @typedef Condition - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.AlertPolicy.Condition definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert.proto} - */ - Condition: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Specifies how many time series must fail a predicate to trigger a - * condition. If not specified, then a `{count: 1}` trigger is used. - * - * @property {number} count - * The absolute number of time series that must fail - * the predicate for the condition to be triggered. - * - * @property {number} percent - * The percentage of time series that must fail the - * predicate for the condition to be triggered. - * - * @typedef Trigger - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.AlertPolicy.Condition.Trigger definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert.proto} - */ - Trigger: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A condition type that compares a collection of time series - * against a threshold. - * - * @property {string} filter - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that - * call is useful to verify the time series that will be retrieved / - * processed) and must specify the metric type and optionally may contain - * restrictions on resource type, resource labels, and metric labels. - * This field may not exceed 2048 Unicode characters in length. - * - * @property {Object[]} aggregations - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resrouces). Multiple aggregations - * are applied in the order specified. - * - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It - * is advisable to use the `ListTimeSeries` method when debugging this - * field. - * - * This object should have the same structure as [Aggregation]{@link google.monitoring.v3.Aggregation} - * - * @property {string} denominatorFilter - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that identifies a time - * series that should be used as the denominator of a ratio that will be - * compared with the threshold. If a `denominator_filter` is specified, - * the time series specified by the `filter` field will be used as the - * numerator. - * - * The filter must specify the metric type and optionally may contain - * restrictions on resource type, resource labels, and metric labels. - * This field may not exceed 2048 Unicode characters in length. - * - * @property {Object[]} denominatorAggregations - * Specifies the alignment of data points in individual time series - * selected by `denominatorFilter` as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resources). - * - * When computing ratios, the `aggregations` and - * `denominator_aggregations` fields must use the same alignment period - * and produce time series that have the same periodicity and labels. - * - * This object should have the same structure as [Aggregation]{@link google.monitoring.v3.Aggregation} - * - * @property {number} comparison - * The comparison to apply between the time series (indicated by `filter` - * and `aggregation`) and the threshold (indicated by `threshold_value`). - * The comparison is applied on each time series, with the time series - * on the left-hand side and the threshold on the right-hand side. - * - * Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. - * - * The number should be among the values of [ComparisonType]{@link google.monitoring.v3.ComparisonType} - * - * @property {number} thresholdValue - * A value against which to compare the time series. - * - * @property {Object} duration - * The amount of time that a time series must violate the - * threshold to be considered failing. Currently, only values - * that are a multiple of a minute--e.g., 0, 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an - * error will be returned. When choosing a duration, it is useful to - * keep in mind the frequency of the underlying time series data - * (which may also be affected by any alignments specified in the - * `aggregations` field); a good duration is long enough so that a single - * outlier does not generate spurious alerts, but short enough that - * unhealthy states are detected and alerted on quickly. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} trigger - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`, - * or by the ratio, if `denominator_filter` and `denominator_aggregations` - * are specified. - * - * This object should have the same structure as [Trigger]{@link google.monitoring.v3.Trigger} - * - * @typedef MetricThreshold - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.AlertPolicy.Condition.MetricThreshold definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert.proto} - */ - MetricThreshold: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A condition type that checks that monitored resources - * are reporting data. The configuration defines a metric and - * a set of monitored resources. The predicate is considered in violation - * when a time series for the specified metric of a monitored - * resource does not include any data in the specified `duration`. - * - * @property {string} filter - * A [filter](https://cloud.google.com/monitoring/api/v3/filters) that - * identifies which time series should be compared with the threshold. - * - * The filter is similar to the one that is specified in the - * [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that - * call is useful to verify the time series that will be retrieved / - * processed) and must specify the metric type and optionally may contain - * restrictions on resource type, resource labels, and metric labels. - * This field may not exceed 2048 Unicode characters in length. - * - * @property {Object[]} aggregations - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series together (such as - * when aggregating multiple streams on each resource to a single - * stream for each resource or when aggregating streams across all - * members of a group of resrouces). Multiple aggregations - * are applied in the order specified. - * - * This field is similar to the one in the [`ListTimeSeries` - * request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It - * is advisable to use the `ListTimeSeries` method when debugging this - * field. - * - * This object should have the same structure as [Aggregation]{@link google.monitoring.v3.Aggregation} - * - * @property {Object} duration - * The amount of time that a time series must fail to report new - * data to be considered failing. Currently, only values that - * are a multiple of a minute--e.g. 60, 120, or 300 - * seconds--are supported. If an invalid value is given, an - * error will be returned. The `Duration.nanos` field is - * ignored. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} trigger - * The number/percent of time series for which the comparison must hold - * in order for the condition to trigger. If unspecified, then the - * condition will trigger if the comparison is true for any of the - * time series that have been identified by `filter` and `aggregations`. - * - * This object should have the same structure as [Trigger]{@link google.monitoring.v3.Trigger} - * - * @typedef MetricAbsence - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.AlertPolicy.Condition.MetricAbsence definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert.proto} - */ - MetricAbsence: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Operators for combining conditions. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - ConditionCombinerType: { - - /** - * An unspecified combiner. - */ - COMBINE_UNSPECIFIED: 0, - - /** - * Combine conditions using the logical `AND` operator. An - * incident is created only if all conditions are met - * simultaneously. This combiner is satisfied if all conditions are - * met, even if they are met on completely different resources. - */ - AND: 1, - - /** - * Combine conditions using the logical `OR` operator. An incident - * is created if any of the listed conditions is met. - */ - OR: 2, - - /** - * Combine conditions using logical `AND` operator, but unlike the regular - * `AND` option, an incident is created only if all conditions are met - * simultaneously on at least one resource. - */ - AND_WITH_MATCHING_RESOURCE: 3 - } -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_alert_service.js b/src/v3/doc/google/monitoring/v3/doc_alert_service.js deleted file mode 100644 index 470321ec..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_alert_service.js +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The protocol for the `CreateAlertPolicy` request. - * - * @property {string} name - * Required. The project in which to create the alerting policy. The format is - * `projects/[PROJECT_ID]`. - * - * Note that this field names the parent container in which the alerting - * policy will be written, not the name of the created policy. The alerting - * policy that is returned will have a name that contains a normalized - * representation of this name as a prefix but adds a suffix of the form - * `/alertPolicies/[POLICY_ID]`, identifying the policy in the container. - * - * @property {Object} alertPolicy - * Required. The requested alerting policy. You should omit the `name` field in this - * policy. The name will be returned in the new policy, including - * a new [ALERT_POLICY_ID] value. - * - * This object should have the same structure as [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} - * - * @typedef CreateAlertPolicyRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateAlertPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto} - */ -const CreateAlertPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `GetAlertPolicy` request. - * - * @property {string} name - * Required. The alerting policy to retrieve. The format is - * - * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * - * @typedef GetAlertPolicyRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetAlertPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto} - */ -const GetAlertPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `ListAlertPolicies` request. - * - * @property {string} name - * Required. The project whose alert policies are to be listed. The format is - * - * projects/[PROJECT_ID] - * - * Note that this field names the parent container in which the alerting - * policies to be listed are stored. To retrieve a single alerting policy - * by name, use the - * GetAlertPolicy - * operation, instead. - * - * @property {string} filter - * If provided, this field specifies the criteria that must be met by - * alert policies to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * - * @property {string} orderBy - * A comma-separated list of fields by which to sort the result. Supports - * the same set of field references as the `filter` field. Entries can be - * prefixed with a minus sign to sort by the field in descending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * - * @property {number} pageSize - * The maximum number of results to return in a single response. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * - * @typedef ListAlertPoliciesRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListAlertPoliciesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto} - */ -const ListAlertPoliciesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `ListAlertPolicies` response. - * - * @property {Object[]} alertPolicies - * The returned alert policies. - * - * This object should have the same structure as [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} - * - * @property {string} nextPageToken - * If there might be more results than were returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @typedef ListAlertPoliciesResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListAlertPoliciesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto} - */ -const ListAlertPoliciesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `UpdateAlertPolicy` request. - * - * @property {Object} updateMask - * Optional. A list of alerting policy field names. If this field is not - * empty, each listed field in the existing alerting policy is set to the - * value of the corresponding field in the supplied policy (`alert_policy`), - * or to the field's default value if the field is not in the supplied - * alerting policy. Fields not listed retain their previous value. - * - * Examples of valid field masks include `display_name`, `documentation`, - * `documentation.content`, `documentation.mime_type`, `user_labels`, - * `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc. - * - * If this field is empty, then the supplied alerting policy replaces the - * existing policy. It is the same as deleting the existing policy and - * adding the supplied policy, except for the following: - * - * + The new policy will have the same `[ALERT_POLICY_ID]` as the former - * policy. This gives you continuity with the former policy in your - * notifications and incidents. - * + Conditions in the new policy will keep their former `[CONDITION_ID]` if - * the supplied condition includes the `name` field with that - * `[CONDITION_ID]`. If the supplied condition omits the `name` field, - * then a new `[CONDITION_ID]` is created. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {Object} alertPolicy - * Required. The updated alerting policy or the updated values for the - * fields listed in `update_mask`. - * If `update_mask` is not empty, any fields in this policy that are - * not in `update_mask` are ignored. - * - * This object should have the same structure as [AlertPolicy]{@link google.monitoring.v3.AlertPolicy} - * - * @typedef UpdateAlertPolicyRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UpdateAlertPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto} - */ -const UpdateAlertPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `DeleteAlertPolicy` request. - * - * @property {string} name - * Required. The alerting policy to delete. The format is: - * - * projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * - * For more information, see AlertPolicy. - * - * @typedef DeleteAlertPolicyRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteAlertPolicyRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/alert_service.proto} - */ -const DeleteAlertPolicyRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_common.js b/src/v3/doc/google/monitoring/v3/doc_common.js deleted file mode 100644 index de50b3b9..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_common.js +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A single strongly-typed value. - * - * @property {boolean} boolValue - * A Boolean value: `true` or `false`. - * - * @property {number} int64Value - * A 64-bit integer. Its range is approximately ±9.2x1018. - * - * @property {number} doubleValue - * A 64-bit double-precision floating-point number. Its magnitude - * is approximately ±10±300 and it has 16 - * significant digits of precision. - * - * @property {string} stringValue - * A variable-length string value. - * - * @property {Object} distributionValue - * A distribution value. - * - * This object should have the same structure as [Distribution]{@link google.api.Distribution} - * - * @typedef TypedValue - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.TypedValue definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/common.proto} - */ -const TypedValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. In no case can the end time be earlier than the start time. - * - * * For a `GAUGE` metric, the `startTime` value is technically optional; if - * no value is specified, the start time defaults to the value of the - * end time, and the interval represents a single point in time. If both - * start and end times are specified, they must be identical. Such an - * interval is valid only for `GAUGE` metrics, which are point-in-time - * measurements. - * - * * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier - * than the end time. - * - * * In all cases, the start time of the next interval must be - * at least a microsecond after the end time of the previous interval. - * Because the interval is closed, if the start time of a new interval - * is the same as the end time of the previous interval, data written - * at the new start time could overwrite data written at the previous - * end time. - * - * @property {Object} endTime - * Required. The end of the time interval. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {Object} startTime - * Optional. The beginning of the time interval. The default value - * for the start time is the end time. The start time must not be - * later than the end time. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef TimeInterval - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.TimeInterval definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/common.proto} - */ -const TimeInterval = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Describes how to combine multiple time series to provide a different view of - * the data. Aggregation of time series is done in two steps. First, each time - * series in the set is _aligned_ to the same time interval boundaries, then the - * set of time series is optionally _reduced_ in number. - * - * Alignment consists of applying the `per_series_aligner` operation - * to each time series after its data has been divided into regular - * `alignment_period` time intervals. This process takes _all_ of the data - * points in an alignment period, applies a mathematical transformation such as - * averaging, minimum, maximum, delta, etc., and converts them into a single - * data point per period. - * - * Reduction is when the aligned and transformed time series can optionally be - * combined, reducing the number of time series through similar mathematical - * transformations. Reduction involves applying a `cross_series_reducer` to - * all the time series, optionally sorting the time series into subsets with - * `group_by_fields`, and applying the reducer to each subset. - * - * The raw time series data can contain a huge amount of information from - * multiple sources. Alignment and reduction transforms this mass of data into - * a more manageable and representative collection of data, for example "the - * 95% latency across the average of all tasks in a cluster". This - * representative data can be more easily graphed and comprehended, and the - * individual time series data is still available for later drilldown. For more - * details, see [Aggregating Time - * Series](https://cloud.google.com/monitoring/api/v3/metrics#aggregating_time_series). - * - * @property {Object} alignmentPeriod - * The `alignment_period` specifies a time interval, in seconds, that is used - * to divide the data in all the - * time series into consistent blocks of - * time. This will be done before the per-series aligner can be applied to - * the data. - * - * The value must be at least 60 seconds. If a per-series aligner other than - * `ALIGN_NONE` is specified, this field is required or an error is returned. - * If no per-series aligner is specified, or the aligner `ALIGN_NONE` is - * specified, then this field is ignored. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {number} perSeriesAligner - * An `Aligner` describes how to bring the data points in a single - * time series into temporal alignment. Except for `ALIGN_NONE`, all - * alignments cause all the data points in an `alignment_period` to be - * mathematically grouped together, resulting in a single data point for - * each `alignment_period` with end timestamp at the end of the period. - * - * Not all alignment operations may be applied to all time series. The valid - * choices depend on the `metric_kind` and `value_type` of the original time - * series. Alignment can change the `metric_kind` or the `value_type` of - * the time series. - * - * Time series data must be aligned in order to perform cross-time - * series reduction. If `cross_series_reducer` is specified, then - * `per_series_aligner` must be specified and not equal to `ALIGN_NONE` - * and `alignment_period` must be specified; otherwise, an error is - * returned. - * - * The number should be among the values of [Aligner]{@link google.monitoring.v3.Aligner} - * - * @property {number} crossSeriesReducer - * The reduction operation to be used to combine time series into a single - * time series, where the value of each data point in the resulting series is - * a function of all the already aligned values in the input time series. - * - * Not all reducer operations can be applied to all time series. The valid - * choices depend on the `metric_kind` and the `value_type` of the original - * time series. Reduction can yield a time series with a different - * `metric_kind` or `value_type` than the input time series. - * - * Time series data must first be aligned (see `per_series_aligner`) in order - * to perform cross-time series reduction. If `cross_series_reducer` is - * specified, then `per_series_aligner` must be specified, and must not be - * `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an - * error is returned. - * - * The number should be among the values of [Reducer]{@link google.monitoring.v3.Reducer} - * - * @property {string[]} groupByFields - * The set of fields to preserve when `cross_series_reducer` is - * specified. The `group_by_fields` determine how the time series are - * partitioned into subsets prior to applying the aggregation - * operation. Each subset contains time series that have the same - * value for each of the grouping fields. Each individual time - * series is a member of exactly one subset. The - * `cross_series_reducer` is applied to each subset of time series. - * It is not possible to reduce across different resource types, so - * this field implicitly contains `resource.type`. Fields not - * specified in `group_by_fields` are aggregated away. If - * `group_by_fields` is not specified and all the time series have - * the same resource type, then the time series are aggregated into - * a single output time series. If `cross_series_reducer` is not - * defined, this field is ignored. - * - * @typedef Aggregation - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Aggregation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/common.proto} - */ -const Aggregation = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The `Aligner` specifies the operation that will be applied to the data - * points in each alignment period in a time series. Except for - * `ALIGN_NONE`, which specifies that no operation be applied, each alignment - * operation replaces the set of data values in each alignment period with - * a single value: the result of applying the operation to the data values. - * An aligned time series has a single data value at the end of each - * `alignment_period`. - * - * An alignment operation can change the data type of the values, too. For - * example, if you apply a counting operation to boolean values, the data - * `value_type` in the original time series is `BOOLEAN`, but the `value_type` - * in the aligned result is `INT64`. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - Aligner: { - - /** - * No alignment. Raw data is returned. Not valid if cross-series reduction - * is requested. The `value_type` of the result is the same as the - * `value_type` of the input. - */ - ALIGN_NONE: 0, - - /** - * Align and convert to - * DELTA. - * The output is `delta = y1 - y0`. - * - * This alignment is valid for - * CUMULATIVE and - * `DELTA` metrics. If the selected alignment period results in periods - * with no data, then the aligned value for such a period is created by - * interpolation. The `value_type` of the aligned result is the same as - * the `value_type` of the input. - */ - ALIGN_DELTA: 1, - - /** - * Align and convert to a rate. The result is computed as - * `rate = (y1 - y0)/(t1 - t0)`, or "delta over time". - * Think of this aligner as providing the slope of the line that passes - * through the value at the start and at the end of the `alignment_period`. - * - * This aligner is valid for `CUMULATIVE` - * and `DELTA` metrics with numeric values. If the selected alignment - * period results in periods with no data, then the aligned value for - * such a period is created by interpolation. The output is a `GAUGE` - * metric with `value_type` `DOUBLE`. - * - * If, by "rate", you mean "percentage change", see the - * `ALIGN_PERCENT_CHANGE` aligner instead. - */ - ALIGN_RATE: 2, - - /** - * Align by interpolating between adjacent points around the alignment - * period boundary. This aligner is valid for `GAUGE` metrics with - * numeric values. The `value_type` of the aligned result is the same as the - * `value_type` of the input. - */ - ALIGN_INTERPOLATE: 3, - - /** - * Align by moving the most recent data point before the end of the - * alignment period to the boundary at the end of the alignment - * period. This aligner is valid for `GAUGE` metrics. The `value_type` of - * the aligned result is the same as the `value_type` of the input. - */ - ALIGN_NEXT_OLDER: 4, - - /** - * Align the time series by returning the minimum value in each alignment - * period. This aligner is valid for `GAUGE` and `DELTA` metrics with - * numeric values. The `value_type` of the aligned result is the same as - * the `value_type` of the input. - */ - ALIGN_MIN: 10, - - /** - * Align the time series by returning the maximum value in each alignment - * period. This aligner is valid for `GAUGE` and `DELTA` metrics with - * numeric values. The `value_type` of the aligned result is the same as - * the `value_type` of the input. - */ - ALIGN_MAX: 11, - - /** - * Align the time series by returning the mean value in each alignment - * period. This aligner is valid for `GAUGE` and `DELTA` metrics with - * numeric values. The `value_type` of the aligned result is `DOUBLE`. - */ - ALIGN_MEAN: 12, - - /** - * Align the time series by returning the number of values in each alignment - * period. This aligner is valid for `GAUGE` and `DELTA` metrics with - * numeric or Boolean values. The `value_type` of the aligned result is - * `INT64`. - */ - ALIGN_COUNT: 13, - - /** - * Align the time series by returning the sum of the values in each - * alignment period. This aligner is valid for `GAUGE` and `DELTA` - * metrics with numeric and distribution values. The `value_type` of the - * aligned result is the same as the `value_type` of the input. - */ - ALIGN_SUM: 14, - - /** - * Align the time series by returning the standard deviation of the values - * in each alignment period. This aligner is valid for `GAUGE` and - * `DELTA` metrics with numeric values. The `value_type` of the output is - * `DOUBLE`. - */ - ALIGN_STDDEV: 15, - - /** - * Align the time series by returning the number of `True` values in - * each alignment period. This aligner is valid for `GAUGE` metrics with - * Boolean values. The `value_type` of the output is `INT64`. - */ - ALIGN_COUNT_TRUE: 16, - - /** - * Align the time series by returning the number of `False` values in - * each alignment period. This aligner is valid for `GAUGE` metrics with - * Boolean values. The `value_type` of the output is `INT64`. - */ - ALIGN_COUNT_FALSE: 24, - - /** - * Align the time series by returning the ratio of the number of `True` - * values to the total number of values in each alignment period. This - * aligner is valid for `GAUGE` metrics with Boolean values. The output - * value is in the range [0.0, 1.0] and has `value_type` `DOUBLE`. - */ - ALIGN_FRACTION_TRUE: 17, - - /** - * Align the time series by using [percentile - * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting - * data point in each alignment period is the 99th percentile of all data - * points in the period. This aligner is valid for `GAUGE` and `DELTA` - * metrics with distribution values. The output is a `GAUGE` metric with - * `value_type` `DOUBLE`. - */ - ALIGN_PERCENTILE_99: 18, - - /** - * Align the time series by using [percentile - * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting - * data point in each alignment period is the 95th percentile of all data - * points in the period. This aligner is valid for `GAUGE` and `DELTA` - * metrics with distribution values. The output is a `GAUGE` metric with - * `value_type` `DOUBLE`. - */ - ALIGN_PERCENTILE_95: 19, - - /** - * Align the time series by using [percentile - * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting - * data point in each alignment period is the 50th percentile of all data - * points in the period. This aligner is valid for `GAUGE` and `DELTA` - * metrics with distribution values. The output is a `GAUGE` metric with - * `value_type` `DOUBLE`. - */ - ALIGN_PERCENTILE_50: 20, - - /** - * Align the time series by using [percentile - * aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting - * data point in each alignment period is the 5th percentile of all data - * points in the period. This aligner is valid for `GAUGE` and `DELTA` - * metrics with distribution values. The output is a `GAUGE` metric with - * `value_type` `DOUBLE`. - */ - ALIGN_PERCENTILE_05: 21, - - /** - * Align and convert to a percentage change. This aligner is valid for - * `GAUGE` and `DELTA` metrics with numeric values. This alignment returns - * `((current - previous)/previous) * 100`, where the value of `previous` is - * determined based on the `alignment_period`. - * - * If the values of `current` and `previous` are both 0, then the returned - * value is 0. If only `previous` is 0, the returned value is infinity. - * - * A 10-minute moving mean is computed at each point of the alignment period - * prior to the above calculation to smooth the metric and prevent false - * positives from very short-lived spikes. The moving mean is only - * applicable for data whose values are `>= 0`. Any values `< 0` are - * treated as a missing datapoint, and are ignored. While `DELTA` - * metrics are accepted by this alignment, special care should be taken that - * the values for the metric will always be positive. The output is a - * `GAUGE` metric with `value_type` `DOUBLE`. - */ - ALIGN_PERCENT_CHANGE: 23 - }, - - /** - * A Reducer operation describes how to aggregate data points from multiple - * time series into a single time series, where the value of each data point - * in the resulting series is a function of all the already aligned values in - * the input time series. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - Reducer: { - - /** - * No cross-time series reduction. The output of the `Aligner` is - * returned. - */ - REDUCE_NONE: 0, - - /** - * Reduce by computing the mean value across time series for each - * alignment period. This reducer is valid for - * DELTA and - * GAUGE metrics with - * numeric or distribution values. The `value_type` of the output is - * DOUBLE. - */ - REDUCE_MEAN: 1, - - /** - * Reduce by computing the minimum value across time series for each - * alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics - * with numeric values. The `value_type` of the output is the same as the - * `value_type` of the input. - */ - REDUCE_MIN: 2, - - /** - * Reduce by computing the maximum value across time series for each - * alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics - * with numeric values. The `value_type` of the output is the same as the - * `value_type` of the input. - */ - REDUCE_MAX: 3, - - /** - * Reduce by computing the sum across time series for each - * alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics - * with numeric and distribution values. The `value_type` of the output is - * the same as the `value_type` of the input. - */ - REDUCE_SUM: 4, - - /** - * Reduce by computing the standard deviation across time series - * for each alignment period. This reducer is valid for `DELTA` and - * `GAUGE` metrics with numeric or distribution values. The `value_type` - * of the output is `DOUBLE`. - */ - REDUCE_STDDEV: 5, - - /** - * Reduce by computing the number of data points across time series - * for each alignment period. This reducer is valid for `DELTA` and - * `GAUGE` metrics of numeric, Boolean, distribution, and string - * `value_type`. The `value_type` of the output is `INT64`. - */ - REDUCE_COUNT: 6, - - /** - * Reduce by computing the number of `True`-valued data points across time - * series for each alignment period. This reducer is valid for `DELTA` and - * `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output - * is `INT64`. - */ - REDUCE_COUNT_TRUE: 7, - - /** - * Reduce by computing the number of `False`-valued data points across time - * series for each alignment period. This reducer is valid for `DELTA` and - * `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output - * is `INT64`. - */ - REDUCE_COUNT_FALSE: 15, - - /** - * Reduce by computing the ratio of the number of `True`-valued data points - * to the total number of data points for each alignment period. This - * reducer is valid for `DELTA` and `GAUGE` metrics of Boolean `value_type`. - * The output value is in the range [0.0, 1.0] and has `value_type` - * `DOUBLE`. - */ - REDUCE_FRACTION_TRUE: 8, - - /** - * Reduce by computing the [99th - * percentile](https://en.wikipedia.org/wiki/Percentile) of data points - * across time series for each alignment period. This reducer is valid for - * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value - * of the output is `DOUBLE`. - */ - REDUCE_PERCENTILE_99: 9, - - /** - * Reduce by computing the [95th - * percentile](https://en.wikipedia.org/wiki/Percentile) of data points - * across time series for each alignment period. This reducer is valid for - * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value - * of the output is `DOUBLE`. - */ - REDUCE_PERCENTILE_95: 10, - - /** - * Reduce by computing the [50th - * percentile](https://en.wikipedia.org/wiki/Percentile) of data points - * across time series for each alignment period. This reducer is valid for - * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value - * of the output is `DOUBLE`. - */ - REDUCE_PERCENTILE_50: 11, - - /** - * Reduce by computing the [5th - * percentile](https://en.wikipedia.org/wiki/Percentile) of data points - * across time series for each alignment period. This reducer is valid for - * `GAUGE` and `DELTA` metrics of numeric and distribution type. The value - * of the output is `DOUBLE`. - */ - REDUCE_PERCENTILE_05: 12 - } -}; - -/** - * Specifies an ordering relationship on two arguments, called `left` and - * `right`. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ -const ComparisonType = { - - /** - * No ordering relationship is specified. - */ - COMPARISON_UNSPECIFIED: 0, - - /** - * True if the left argument is greater than the right argument. - */ - COMPARISON_GT: 1, - - /** - * True if the left argument is greater than or equal to the right argument. - */ - COMPARISON_GE: 2, - - /** - * True if the left argument is less than the right argument. - */ - COMPARISON_LT: 3, - - /** - * True if the left argument is less than or equal to the right argument. - */ - COMPARISON_LE: 4, - - /** - * True if the left argument is equal to the right argument. - */ - COMPARISON_EQ: 5, - - /** - * True if the left argument is not equal to the right argument. - */ - COMPARISON_NE: 6 -}; - -/** - * The tier of service for a Workspace. Please see the - * [service tiers - * documentation](https://cloud.google.com/monitoring/workspaces/tiers) for more - * details. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ -const ServiceTier = { - - /** - * An invalid sentinel value, used to indicate that a tier has not - * been provided explicitly. - */ - SERVICE_TIER_UNSPECIFIED: 0, - - /** - * The Stackdriver Basic tier, a free tier of service that provides basic - * features, a moderate allotment of logs, and access to built-in metrics. - * A number of features are not available in this tier. For more details, - * see [the service tiers - * documentation](https://cloud.google.com/monitoring/workspaces/tiers). - */ - SERVICE_TIER_BASIC: 1, - - /** - * The Stackdriver Premium tier, a higher, more expensive tier of service - * that provides access to all Stackdriver features, lets you use Stackdriver - * with AWS accounts, and has a larger allotments for logs and metrics. For - * more details, see [the service tiers - * documentation](https://cloud.google.com/monitoring/workspaces/tiers). - */ - SERVICE_TIER_PREMIUM: 2 -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_group.js b/src/v3/doc/google/monitoring/v3/doc_group.js deleted file mode 100644 index 2626b0f7..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_group.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The description of a dynamic collection of monitored resources. Each group - * has a filter that is matched against monitored resources and their associated - * metadata. If a group's filter matches an available monitored resource, then - * that resource is a member of that group. Groups can contain any number of - * monitored resources, and each monitored resource can be a member of any - * number of groups. - * - * Groups can be nested in parent-child hierarchies. The `parentName` field - * identifies an optional parent for each group. If a group has a parent, then - * the only monitored resources available to be matched by the group's filter - * are the resources contained in the parent group. In other words, a group - * contains the monitored resources that match its filter and the filters of all - * the group's ancestors. A group without a parent can contain any monitored - * resource. - * - * For example, consider an infrastructure running a set of instances with two - * user-defined tags: `"environment"` and `"role"`. A parent group has a filter, - * `environment="production"`. A child of that parent group has a filter, - * `role="transcoder"`. The parent group contains all instances in the - * production environment, regardless of their roles. The child group contains - * instances that have the transcoder role *and* are in the production - * environment. - * - * The monitored resources contained in a group can change at any moment, - * depending on what resources exist and what filters are associated with the - * group and its ancestors. - * - * @property {string} name - * Output only. The name of this group. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * When creating a group, this field is ignored and a new name is created - * consisting of the project specified in the call to `CreateGroup` - * and a unique `{group_id}` that is generated automatically. - * - * @property {string} displayName - * A user-assigned name for this group, used only for display purposes. - * - * @property {string} parentName - * The name of the group's parent, if it has one. - * The format is `"projects/{project_id_or_number}/groups/{group_id}"`. - * For groups with no parent, `parentName` is the empty string, `""`. - * - * @property {string} filter - * The filter used to determine which monitored resources belong to this - * group. - * - * @property {boolean} isCluster - * If true, the members of this group are considered to be a cluster. - * The system can perform additional analysis on groups that are clusters. - * - * @typedef Group - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Group definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group.proto} - */ -const Group = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_group_service.js b/src/v3/doc/google/monitoring/v3/doc_group_service.js deleted file mode 100644 index 7d9a40b3..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_group_service.js +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `ListGroup` request. - * - * @property {string} name - * Required. The project whose groups are to be listed. The format is - * `"projects/{project_id_or_number}"`. - * - * @property {string} childrenOfGroup - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns groups whose `parentName` field contains the group - * name. If no groups have this parent, the results are empty. - * - * @property {string} ancestorsOfGroup - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns groups that are ancestors of the specified group. - * The groups are returned in order, starting with the immediate parent and - * ending with the most distant ancestor. If the specified group has no - * immediate parent, the results are empty. - * - * @property {string} descendantsOfGroup - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns the descendants of the specified group. This is a superset of - * the results returned by the `childrenOfGroup` filter, and includes - * children-of-children, and so forth. - * - * @property {number} pageSize - * A positive number that is the maximum number of results to return. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @typedef ListGroupsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListGroupsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const ListGroupsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListGroups` response. - * - * @property {Object[]} group - * The groups that match the specified filters. - * - * This object should have the same structure as [Group]{@link google.monitoring.v3.Group} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @typedef ListGroupsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListGroupsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const ListGroupsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetGroup` request. - * - * @property {string} name - * Required. The group to retrieve. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * - * @typedef GetGroupRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetGroupRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const GetGroupRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `CreateGroup` request. - * - * @property {string} name - * Required. The project in which to create the group. The format is - * `"projects/{project_id_or_number}"`. - * - * @property {Object} group - * Required. A group definition. It is an error to define the `name` field because - * the system assigns the name. - * - * This object should have the same structure as [Group]{@link google.monitoring.v3.Group} - * - * @property {boolean} validateOnly - * If true, validate this request but do not create the group. - * - * @typedef CreateGroupRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateGroupRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const CreateGroupRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `UpdateGroup` request. - * - * @property {Object} group - * Required. The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of this group. - * - * This object should have the same structure as [Group]{@link google.monitoring.v3.Group} - * - * @property {boolean} validateOnly - * If true, validate this request but do not update the existing group. - * - * @typedef UpdateGroupRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UpdateGroupRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const UpdateGroupRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `DeleteGroup` request. The default behavior is to be able to delete a - * single group without any descendants. - * - * @property {string} name - * Required. The group to delete. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * - * @property {boolean} recursive - * If this field is true, then the request means to delete a group with all - * its descendants. Otherwise, the request means to delete a group only when - * it has no descendants. The default value is false. - * - * @typedef DeleteGroupRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteGroupRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const DeleteGroupRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListGroupMembers` request. - * - * @property {string} name - * Required. The group whose members are listed. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * - * @property {number} pageSize - * A positive number that is the maximum number of results to return. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @property {string} filter - * An optional [list filter](https://cloud.google.com/monitoring/api/learn_more#filtering) describing - * the members to be returned. The filter may reference the type, labels, and - * metadata of monitored resources that comprise the group. - * For example, to return only resources representing Compute Engine VM - * instances, use this filter: - * - * resource.type = "gce_instance" - * - * @property {Object} interval - * An optional time interval for which results should be returned. Only - * members that were part of the group during the specified interval are - * included in the response. If no interval is provided then the group - * membership over the last minute is returned. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * - * @typedef ListGroupMembersRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListGroupMembersRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const ListGroupMembersRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListGroupMembers` response. - * - * @property {Object[]} members - * A set of monitored resources in the group. - * - * This object should have the same structure as [MonitoredResource]{@link google.api.MonitoredResource} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is - * set to a non-empty value. To see the additional results, use that value as - * `pageToken` in the next call to this method. - * - * @property {number} totalSize - * The total number of elements matching this request. - * - * @typedef ListGroupMembersResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListGroupMembersResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/group_service.proto} - */ -const ListGroupMembersResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_metric.js b/src/v3/doc/google/monitoring/v3/doc_metric.js deleted file mode 100644 index db79df90..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_metric.js +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A single data point in a time series. - * - * @property {Object} interval - * The time interval to which the data point applies. For `GAUGE` metrics, - * the start time is optional, but if it is supplied, it must equal the - * end time. For `DELTA` metrics, the start - * and end time should specify a non-zero interval, with subsequent points - * specifying contiguous and non-overlapping intervals. For `CUMULATIVE` - * metrics, the start and end time should specify a non-zero interval, with - * subsequent points specifying the same start time and increasing end times, - * until an event resets the cumulative value to zero and sets a new start - * time for the following points. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * - * @property {Object} value - * The value of the data point. - * - * This object should have the same structure as [TypedValue]{@link google.monitoring.v3.TypedValue} - * - * @typedef Point - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Point definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric.proto} - */ -const Point = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A collection of data points that describes the time-varying values - * of a metric. A time series is identified by a combination of a - * fully-specified monitored resource and a fully-specified metric. - * This type is used for both listing and creating time series. - * - * @property {Object} metric - * The associated metric. A fully-specified metric used to identify the time - * series. - * - * This object should have the same structure as [Metric]{@link google.api.Metric} - * - * @property {Object} resource - * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. - * - * This object should have the same structure as [MonitoredResource]{@link google.api.MonitoredResource} - * - * @property {Object} metadata - * Output only. The associated monitored resource metadata. When reading a - * a timeseries, this field will include metadata labels that are explicitly - * named in the reduction. When creating a timeseries, this field is ignored. - * - * This object should have the same structure as [MonitoredResourceMetadata]{@link google.api.MonitoredResourceMetadata} - * - * @property {number} metricKind - * The metric kind of the time series. When listing time series, this metric - * kind might be different from the metric kind of the associated metric if - * this time series is an alignment or reduction of other time series. - * - * When creating a time series, this field is optional. If present, it must be - * the same as the metric kind of the associated metric. If the associated - * metric's descriptor must be auto-created, then this field specifies the - * metric kind of the new descriptor and must be either `GAUGE` (the default) - * or `CUMULATIVE`. - * - * The number should be among the values of [MetricKind]{@link google.api.MetricKind} - * - * @property {number} valueType - * The value type of the time series. When listing time series, this value - * type might be different from the value type of the associated metric if - * this time series is an alignment or reduction of other time series. - * - * When creating a time series, this field is optional. If present, it must be - * the same as the type of the data in the `points` field. - * - * The number should be among the values of [ValueType]{@link google.api.ValueType} - * - * @property {Object[]} points - * The data points of this time series. When listing time series, points are - * returned in reverse time order. - * - * When creating a time series, this field must contain exactly one point and - * the point's type must be the same as the value type of the associated - * metric. If the associated metric's descriptor must be auto-created, then - * the value type of the descriptor is determined by the point's type, which - * must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`. - * - * This object should have the same structure as [Point]{@link google.monitoring.v3.Point} - * - * @typedef TimeSeries - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.TimeSeries definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric.proto} - */ -const TimeSeries = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_metric_service.js b/src/v3/doc/google/monitoring/v3/doc_metric_service.js deleted file mode 100644 index 7947a0f7..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_metric_service.js +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `ListMonitoredResourceDescriptors` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * - * @property {string} filter - * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) describing - * the descriptors to be returned. The filter can reference - * the descriptor's type and labels. For example, the - * following filter returns only Google Compute Engine descriptors - * that have an `id` label: - * - * resource.type = starts_with("gce_") AND resource.label:id - * - * @property {number} pageSize - * A positive number that is the maximum number of results to return. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @typedef ListMonitoredResourceDescriptorsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListMonitoredResourceDescriptorsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const ListMonitoredResourceDescriptorsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListMonitoredResourceDescriptors` response. - * - * @property {Object[]} resourceDescriptors - * The monitored resource descriptors that are available to this project - * and that match `filter`, if present. - * - * This object should have the same structure as [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @typedef ListMonitoredResourceDescriptorsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListMonitoredResourceDescriptorsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const ListMonitoredResourceDescriptorsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetMonitoredResourceDescriptor` request. - * - * @property {string} name - * Required. The monitored resource descriptor to get. The format is - * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. - * The `{resource_type}` is a predefined type, such as - * `cloudsql_database`. - * - * @typedef GetMonitoredResourceDescriptorRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetMonitoredResourceDescriptorRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const GetMonitoredResourceDescriptorRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListMetricDescriptors` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * - * @property {string} filter - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * - * metric.type = starts_with("custom.googleapis.com/") - * - * @property {number} pageSize - * A positive number that is the maximum number of results to return. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @typedef ListMetricDescriptorsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListMetricDescriptorsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const ListMetricDescriptorsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListMetricDescriptors` response. - * - * @property {Object[]} metricDescriptors - * The metric descriptors that are available to the project - * and that match the value of `filter`, if present. - * - * This object should have the same structure as [MetricDescriptor]{@link google.api.MetricDescriptor} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @typedef ListMetricDescriptorsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListMetricDescriptorsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const ListMetricDescriptorsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetMetricDescriptor` request. - * - * @property {string} name - * Required. The metric descriptor on which to execute the request. The format is - * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example value of `{metric_id}` is - * `"compute.googleapis.com/instance/disk/read_bytes_count"`. - * - * @typedef GetMetricDescriptorRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetMetricDescriptorRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const GetMetricDescriptorRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `CreateMetricDescriptor` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * - * @property {Object} metricDescriptor - * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * descriptor. - * - * This object should have the same structure as [MetricDescriptor]{@link google.api.MetricDescriptor} - * - * @typedef CreateMetricDescriptorRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateMetricDescriptorRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const CreateMetricDescriptorRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `DeleteMetricDescriptor` request. - * - * @property {string} name - * Required. The metric descriptor on which to execute the request. The format is - * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example of `{metric_id}` is: - * `"custom.googleapis.com/my_test_metric"`. - * - * @typedef DeleteMetricDescriptorRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteMetricDescriptorRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const DeleteMetricDescriptorRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListTimeSeries` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is - * "projects/{project_id_or_number}". - * - * @property {string} filter - * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time - * series should be returned. The filter must specify a single metric type, - * and can additionally specify metric labels and other information. For - * example: - * - * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND - * metric.labels.instance_name = "my-instance-name" - * - * @property {Object} interval - * Required. The time interval for which results should be returned. Only time series - * that contain data points in the specified interval are included - * in the response. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * - * @property {Object} aggregation - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series across specified labels. - * - * By default (if no `aggregation` is explicitly specified), the raw time - * series data is returned. - * - * This object should have the same structure as [Aggregation]{@link google.monitoring.v3.Aggregation} - * - * @property {string} orderBy - * Unsupported: must be left blank. The points in each time series are - * currently returned in reverse time order (most recent to oldest). - * - * @property {number} view - * Required. Specifies which information is returned about the time series. - * - * The number should be among the values of [TimeSeriesView]{@link google.monitoring.v3.TimeSeriesView} - * - * @property {number} pageSize - * A positive number that is the maximum number of results to return. If - * `page_size` is empty or more than 100,000 results, the effective - * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the - * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is - * the maximum number of `TimeSeries` returned. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @typedef ListTimeSeriesRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListTimeSeriesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const ListTimeSeriesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Controls which fields are returned by `ListTimeSeries`. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - TimeSeriesView: { - - /** - * Returns the identity of the metric(s), the time series, - * and the time series data. - */ - FULL: 0, - - /** - * Returns the identity of the metric and the time series resource, - * but not the time series data. - */ - HEADERS: 1 - } -}; - -/** - * The `ListTimeSeries` response. - * - * @property {Object[]} timeSeries - * One or more time series that match the filter included in the request. - * - * This object should have the same structure as [TimeSeries]{@link google.monitoring.v3.TimeSeries} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @property {Object[]} executionErrors - * Query execution errors that may have caused the time series data returned - * to be incomplete. - * - * This object should have the same structure as [Status]{@link google.rpc.Status} - * - * @typedef ListTimeSeriesResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListTimeSeriesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const ListTimeSeriesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `CreateTimeSeries` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * - * @property {Object[]} timeSeries - * Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * - * This object should have the same structure as [TimeSeries]{@link google.monitoring.v3.TimeSeries} - * - * @typedef CreateTimeSeriesRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateTimeSeriesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/metric_service.proto} - */ -const CreateTimeSeriesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_mutation_record.js b/src/v3/doc/google/monitoring/v3/doc_mutation_record.js deleted file mode 100644 index 11849884..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_mutation_record.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Describes a change made to a configuration. - * - * @property {Object} mutateTime - * When the change occurred. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @property {string} mutatedBy - * The email address of the user making the change. - * - * @typedef MutationRecord - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.MutationRecord definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/mutation_record.proto} - */ -const MutationRecord = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_notification.js b/src/v3/doc/google/monitoring/v3/doc_notification.js deleted file mode 100644 index a1393ad9..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_notification.js +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A description of a notification channel. The descriptor includes - * the properties of the channel and the set of labels or fields that - * must be specified to configure channels of a given type. - * - * @property {string} name - * The full REST resource name for this descriptor. The syntax is: - * - * projects/[PROJECT_ID]/notificationChannelDescriptors/[TYPE] - * - * In the above, `[TYPE]` is the value of the `type` field. - * - * @property {string} type - * The type of notification channel, such as "email", "sms", etc. - * Notification channel types are globally unique. - * - * @property {string} displayName - * A human-readable name for the notification channel type. This - * form of the name is suitable for a user interface. - * - * @property {string} description - * A human-readable description of the notification channel - * type. The description may include a description of the properties - * of the channel and pointers to external documentation. - * - * @property {Object[]} labels - * The set of labels that must be defined to identify a particular - * channel of the corresponding type. Each label includes a - * description for how that field should be populated. - * - * This object should have the same structure as [LabelDescriptor]{@link google.api.LabelDescriptor} - * - * @property {number[]} supportedTiers - * The tiers that support this notification channel; the project service tier - * must be one of the supported_tiers. - * - * The number should be among the values of [ServiceTier]{@link google.monitoring.v3.ServiceTier} - * - * @property {number} launchStage - * The product launch stage for channels of this type. - * - * The number should be among the values of [LaunchStage]{@link google.api.LaunchStage} - * - * @typedef NotificationChannelDescriptor - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.NotificationChannelDescriptor definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification.proto} - */ -const NotificationChannelDescriptor = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A `NotificationChannel` is a medium through which an alert is - * delivered when a policy violation is detected. Examples of channels - * include email, SMS, and third-party messaging applications. Fields - * containing sensitive information like authentication tokens or - * contact info are only partially populated on retrieval. - * - * @property {string} type - * The type of the notification channel. This field matches the - * value of the NotificationChannelDescriptor.type field. - * - * @property {string} name - * The full REST resource name for this channel. The syntax is: - * - * projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] - * - * The `[CHANNEL_ID]` is automatically assigned by the server on creation. - * - * @property {string} displayName - * An optional human-readable name for this notification channel. It is - * recommended that you specify a non-empty and unique name in order to - * make it easier to identify the channels in your project, though this is - * not enforced. The display name is limited to 512 Unicode characters. - * - * @property {string} description - * An optional human-readable description of this notification channel. This - * description may provide additional details, beyond the display - * name, for the channel. This may not exceed 1024 Unicode characters. - * - * @property {Object.} labels - * Configuration fields that define the channel and its behavior. The - * permissible and required labels are specified in the - * NotificationChannelDescriptor.labels of the - * `NotificationChannelDescriptor` corresponding to the `type` field. - * - * @property {Object.} userLabels - * User-supplied key/value data that does not need to conform to - * the corresponding `NotificationChannelDescriptor`'s schema, unlike - * the `labels` field. This field is intended to be used for organizing - * and identifying the `NotificationChannel` objects. - * - * The field can contain up to 64 entries. Each key and value is limited to - * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and - * values can contain only lowercase letters, numerals, underscores, and - * dashes. Keys must begin with a letter. - * - * @property {number} verificationStatus - * Indicates whether this channel has been verified or not. On a - * `ListNotificationChannels` - * or - * `GetNotificationChannel` - * operation, this field is expected to be populated. - * - * If the value is `UNVERIFIED`, then it indicates that the channel is - * non-functioning (it both requires verification and lacks verification); - * otherwise, it is assumed that the channel works. - * - * If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that - * the channel is of a type that does not require verification or that - * this specific channel has been exempted from verification because it was - * created prior to verification being required for channels of this type. - * - * This field cannot be modified using a standard - * `UpdateNotificationChannel` - * operation. To change the value of this field, you must call - * `VerifyNotificationChannel`. - * - * The number should be among the values of [VerificationStatus]{@link google.monitoring.v3.VerificationStatus} - * - * @property {Object} enabled - * Whether notifications are forwarded to the described channel. This makes - * it possible to disable delivery of notifications to a particular channel - * without removing the channel from all alerting policies that reference - * the channel. This is a more convenient approach when the change is - * temporary and you want to receive notifications from the same set - * of alerting policies on the channel at some point in the future. - * - * This object should have the same structure as [BoolValue]{@link google.protobuf.BoolValue} - * - * @typedef NotificationChannel - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.NotificationChannel definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification.proto} - */ -const NotificationChannel = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Indicates whether the channel has been verified or not. It is illegal - * to specify this field in a - * `CreateNotificationChannel` - * or an - * `UpdateNotificationChannel` - * operation. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - VerificationStatus: { - - /** - * Sentinel value used to indicate that the state is unknown, omitted, or - * is not applicable (as in the case of channels that neither support - * nor require verification in order to function). - */ - VERIFICATION_STATUS_UNSPECIFIED: 0, - - /** - * The channel has yet to be verified and requires verification to function. - * Note that this state also applies to the case where the verification - * process has been initiated by sending a verification code but where - * the verification code has not been submitted to complete the process. - */ - UNVERIFIED: 1, - - /** - * It has been proven that notifications can be received on this - * notification channel and that someone on the project has access - * to messages that are delivered to that channel. - */ - VERIFIED: 2 - } -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_notification_service.js b/src/v3/doc/google/monitoring/v3/doc_notification_service.js deleted file mode 100644 index c45d834a..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_notification_service.js +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `ListNotificationChannelDescriptors` request. - * - * @property {string} name - * Required. The REST resource name of the parent from which to retrieve - * the notification channel descriptors. The expected syntax is: - * - * projects/[PROJECT_ID] - * - * Note that this names the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the - * GetNotificationChannelDescriptor - * operation, instead. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. If - * not set to a positive number, a reasonable value will be chosen by the - * service. - * - * @property {string} pageToken - * If non-empty, `page_token` must contain a value returned as the - * `next_page_token` in a previous response to request the next set - * of results. - * - * @typedef ListNotificationChannelDescriptorsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListNotificationChannelDescriptorsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const ListNotificationChannelDescriptorsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListNotificationChannelDescriptors` response. - * - * @property {Object[]} channelDescriptors - * The monitored resource descriptors supported for the specified - * project, optionally filtered. - * - * This object should have the same structure as [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor} - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * - * @typedef ListNotificationChannelDescriptorsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListNotificationChannelDescriptorsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const ListNotificationChannelDescriptorsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetNotificationChannelDescriptor` response. - * - * @property {string} name - * Required. The channel type for which to execute the request. The format is - * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. - * - * @typedef GetNotificationChannelDescriptorRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetNotificationChannelDescriptorRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const GetNotificationChannelDescriptorRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `CreateNotificationChannel` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is: - * - * projects/[PROJECT_ID] - * - * Note that this names the container into which the channel will be - * written. This does not name the newly created channel. The resulting - * channel's name will have a normalized version of this field as a prefix, - * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. - * - * @property {Object} notificationChannel - * Required. The definition of the `NotificationChannel` to create. - * - * This object should have the same structure as [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} - * - * @typedef CreateNotificationChannelRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateNotificationChannelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const CreateNotificationChannelRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListNotificationChannels` request. - * - * @property {string} name - * Required. The project on which to execute the request. The format is - * `projects/[PROJECT_ID]`. That is, this names the container - * in which to look for the notification channels; it does not name a - * specific channel. To query a specific channel by REST resource name, use - * the - * `GetNotificationChannel` - * operation. - * - * @property {string} filter - * If provided, this field specifies the criteria that must be met by - * notification channels to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * - * @property {string} orderBy - * A comma-separated list of fields by which to sort the result. Supports - * the same set of fields as in `filter`. Entries can be prefixed with - * a minus sign to sort in descending rather than ascending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * - * @property {number} pageSize - * The maximum number of results to return in a single response. If - * not set to a positive number, a reasonable value will be chosen by the - * service. - * - * @property {string} pageToken - * If non-empty, `page_token` must contain a value returned as the - * `next_page_token` in a previous response to request the next set - * of results. - * - * @typedef ListNotificationChannelsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListNotificationChannelsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const ListNotificationChannelsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListNotificationChannels` response. - * - * @property {Object[]} notificationChannels - * The notification channels defined for the specified project. - * - * This object should have the same structure as [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} - * - * @property {string} nextPageToken - * If not empty, indicates that there may be more results that match - * the request. Use the value in the `page_token` field in a - * subsequent request to fetch the next set of results. If empty, - * all results have been returned. - * - * @typedef ListNotificationChannelsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListNotificationChannelsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const ListNotificationChannelsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetNotificationChannel` request. - * - * @property {string} name - * Required. The channel for which to execute the request. The format is - * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. - * - * @typedef GetNotificationChannelRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetNotificationChannelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const GetNotificationChannelRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `UpdateNotificationChannel` request. - * - * @property {Object} updateMask - * The fields to update. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {Object} notificationChannel - * Required. A description of the changes to be applied to the specified - * notification channel. The description must provide a definition for - * fields to be updated; the names of these fields should also be - * included in the `update_mask`. - * - * This object should have the same structure as [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} - * - * @typedef UpdateNotificationChannelRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UpdateNotificationChannelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const UpdateNotificationChannelRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `DeleteNotificationChannel` request. - * - * @property {string} name - * Required. The channel for which to execute the request. The format is - * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. - * - * @property {boolean} force - * If true, the notification channel will be deleted regardless of its - * use in alert policies (the policies will be updated to remove the - * channel). If false, channels that are still referenced by an existing - * alerting policy will fail to be deleted in a delete operation. - * - * @typedef DeleteNotificationChannelRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteNotificationChannelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const DeleteNotificationChannelRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `SendNotificationChannelVerificationCode` request. - * - * @property {string} name - * Required. The notification channel to which to send a verification code. - * - * @typedef SendNotificationChannelVerificationCodeRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.SendNotificationChannelVerificationCodeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const SendNotificationChannelVerificationCodeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetNotificationChannelVerificationCode` request. - * - * @property {string} name - * Required. The notification channel for which a verification code is to be generated - * and retrieved. This must name a channel that is already verified; if - * the specified channel is not verified, the request will fail. - * - * @property {Object} expireTime - * The desired expiration time. If specified, the API will guarantee that - * the returned code will not be valid after the specified timestamp; - * however, the API cannot guarantee that the returned code will be - * valid for at least as long as the requested time (the API puts an upper - * bound on the amount of time for which a code may be valid). If omitted, - * a default expiration will be used, which may be less than the max - * permissible expiration (so specifying an expiration may extend the - * code's lifetime over omitting an expiration, even though the API does - * impose an upper limit on the maximum expiration that is permitted). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef GetNotificationChannelVerificationCodeRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetNotificationChannelVerificationCodeRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const GetNotificationChannelVerificationCodeRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetNotificationChannelVerificationCode` request. - * - * @property {string} code - * The verification code, which may be used to verify other channels - * that have an equivalent identity (i.e. other channels of the same - * type with the same fingerprint such as other email channels with - * the same email address or other sms channels with the same number). - * - * @property {Object} expireTime - * The expiration time associated with the code that was returned. If - * an expiration was provided in the request, this is the minimum of the - * requested expiration in the request and the max permitted expiration. - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * - * @typedef GetNotificationChannelVerificationCodeResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetNotificationChannelVerificationCodeResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const GetNotificationChannelVerificationCodeResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `VerifyNotificationChannel` request. - * - * @property {string} name - * Required. The notification channel to verify. - * - * @property {string} code - * Required. The verification code that was delivered to the channel as - * a result of invoking the `SendNotificationChannelVerificationCode` API - * method or that was retrieved from a verified channel via - * `GetNotificationChannelVerificationCode`. For example, one might have - * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only - * guaranteed that the code is valid UTF-8; one should not - * make any assumptions regarding the structure or format of the code). - * - * @typedef VerifyNotificationChannelRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.VerifyNotificationChannelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/notification_service.proto} - */ -const VerifyNotificationChannelRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_service.js b/src/v3/doc/google/monitoring/v3/doc_service.js deleted file mode 100644 index cc560220..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_service.js +++ /dev/null @@ -1,539 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A `Service` is a discrete, autonomous, and network-accessible unit, designed - * to solve an individual concern - * ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In - * Stackdriver Monitoring, a `Service` acts as the root resource under which - * operational aspects of the service are accessible. - * - * @property {string} name - * Resource name for this Service. Of the form - * `projects/{project_id}/services/{service_id}`. - * - * @property {string} displayName - * Name used for UI elements listing this Service. - * - * @property {Object} custom - * Custom service type. - * - * This object should have the same structure as [Custom]{@link google.monitoring.v3.Custom} - * - * @property {Object} appEngine - * Type used for App Engine services. - * - * This object should have the same structure as [AppEngine]{@link google.monitoring.v3.AppEngine} - * - * @property {Object} cloudEndpoints - * Type used for Cloud Endpoints services. - * - * This object should have the same structure as [CloudEndpoints]{@link google.monitoring.v3.CloudEndpoints} - * - * @property {Object} clusterIstio - * Type used for Istio services that live in a Kubernetes cluster. - * - * This object should have the same structure as [ClusterIstio]{@link google.monitoring.v3.ClusterIstio} - * - * @property {Object} telemetry - * Configuration for how to query telemetry on a Service. - * - * This object should have the same structure as [Telemetry]{@link google.monitoring.v3.Telemetry} - * - * @typedef Service - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Service definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const Service = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Custom view of service telemetry. Currently a place-holder pending final - * design. - * @typedef Custom - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Service.Custom definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - Custom: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * App Engine service. Learn more at https://cloud.google.com/appengine. - * - * @property {string} moduleId - * The ID of the App Engine module underlying this service. Corresponds to - * the `module_id` resource label in the `gae_app` monitored resource: - * https://cloud.google.com/monitoring/api/resources#tag_gae_app - * - * @typedef AppEngine - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Service.AppEngine definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - AppEngine: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints. - * - * @property {string} service - * The name of the Cloud Endpoints service underlying this service. - * Corresponds to the `service` resource label in the `api` monitored - * resource: https://cloud.google.com/monitoring/api/resources#tag_api - * - * @typedef CloudEndpoints - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Service.CloudEndpoints definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - CloudEndpoints: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Istio service. Learn more at http://istio.io. - * - * @property {string} location - * The location of the Kubernetes cluster in which this Istio service is - * defined. Corresponds to the `location` resource label in `k8s_cluster` - * resources. - * - * @property {string} clusterName - * The name of the Kubernetes cluster in which this Istio service is - * defined. Corresponds to the `cluster_name` resource label in - * `k8s_cluster` resources. - * - * @property {string} serviceNamespace - * The namespace of the Istio service underlying this service. Corresponds - * to the `destination_service_namespace` metric label in Istio metrics. - * - * @property {string} serviceName - * The name of the Istio service underlying this service. Corresponds to the - * `destination_service_name` metric label in Istio metrics. - * - * @typedef ClusterIstio - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Service.ClusterIstio definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - ClusterIstio: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Configuration for how to query telemetry on a Service. - * - * @property {string} resourceName - * The full name of the resource that defines this service. Formatted as - * described in https://cloud.google.com/apis/design/resource_names. - * - * @typedef Telemetry - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Service.Telemetry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - Telemetry: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * A Service-Level Objective (SLO) describes a level of desired good service. It - * consists of a service-level indicator (SLI), a performance goal, and a period - * over which the objective is to be evaluated against that goal. The SLO can - * use SLIs defined in a number of different manners. Typical SLOs might include - * "99% of requests in each rolling week have latency below 200 milliseconds" or - * "99.5% of requests in each calendar month return successfully." - * - * @property {string} name - * Resource name for this `ServiceLevelObjective`. - * Of the form - * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. - * - * @property {string} displayName - * Name used for UI elements listing this SLO. - * - * @property {Object} serviceLevelIndicator - * The definition of good service, used to measure and calculate the quality - * of the `Service`'s performance with respect to a single aspect of service - * quality. - * - * This object should have the same structure as [ServiceLevelIndicator]{@link google.monitoring.v3.ServiceLevelIndicator} - * - * @property {number} goal - * The fraction of service that must be good in order for this objective to be - * met. `0 < goal <= 0.999`. - * - * @property {Object} rollingPeriod - * A rolling time period, semantically "in the past ``". - * Must be an integer multiple of 1 day no larger than 30 days. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {number} calendarPeriod - * A calendar period, semantically "since the start of the current - * ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and - * `MONTH` are supported. - * - * The number should be among the values of [CalendarPeriod]{@link google.type.CalendarPeriod} - * - * @typedef ServiceLevelObjective - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ServiceLevelObjective definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const ServiceLevelObjective = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * `ServiceLevelObjective.View` determines what form of - * `ServiceLevelObjective` is returned from `GetServiceLevelObjective`, - * `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - View: { - - /** - * Same as FULL. - */ - VIEW_UNSPECIFIED: 0, - - /** - * Return the embedded `ServiceLevelIndicator` in the form in which it was - * defined. If it was defined using a `BasicSli`, return that `BasicSli`. - */ - FULL: 2, - - /** - * For `ServiceLevelIndicator`s using `BasicSli` articulation, instead - * return the `ServiceLevelIndicator` with its mode of computation fully - * spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using - * `RequestBasedSli` or `WindowsBasedSli`, return the - * `ServiceLevelIndicator` as it was provided. - */ - EXPLICIT: 1 - } -}; - -/** - * A Service-Level Indicator (SLI) describes the "performance" of a service. For - * some services, the SLI is well-defined. In such cases, the SLI can be - * described easily by referencing the well-known SLI and providing the needed - * parameters. Alternatively, a "custom" SLI can be defined with a query to the - * underlying metric store. An SLI is defined to be `good_service / - * total_service` over any queried time interval. The value of performance - * always falls into the range `0 <= performance <= 1`. A custom SLI describes - * how to compute this ratio, whether this is by dividing values from a pair of - * time series, cutting a `Distribution` into good and bad counts, or counting - * time windows in which the service complies with a criterion. For separation - * of concerns, a single Service-Level Indicator measures performance for only - * one aspect of service quality, such as fraction of successful queries or - * fast-enough queries. - * - * @property {Object} basicSli - * Basic SLI on a well-known service type. - * - * This object should have the same structure as [BasicSli]{@link google.monitoring.v3.BasicSli} - * - * @property {Object} requestBased - * Request-based SLIs - * - * This object should have the same structure as [RequestBasedSli]{@link google.monitoring.v3.RequestBasedSli} - * - * @property {Object} windowsBased - * Windows-based SLIs - * - * This object should have the same structure as [WindowsBasedSli]{@link google.monitoring.v3.WindowsBasedSli} - * - * @typedef ServiceLevelIndicator - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ServiceLevelIndicator definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const ServiceLevelIndicator = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * An SLI measuring performance on a well-known service type. Performance will - * be computed on the basis of pre-defined metrics. The type of the - * `service_resource` determines the metrics to use and the - * `service_resource.labels` and `metric_labels` are used to construct a - * monitoring filter to filter that metric down to just the data relevant to - * this service. - * - * @property {string[]} method - * OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from - * other methods will not be used to calculate performance for this SLI. If - * omitted, this SLI applies to all the Service's methods. For service types - * that don't support breaking down by method, setting this field will result - * in an error. - * - * @property {string[]} location - * OPTIONAL: The set of locations to which this SLI is relevant. Telemetry - * from other locations will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all locations in which the Service has - * activity. For service types that don't support breaking down by location, - * setting this field will result in an error. - * - * @property {string[]} version - * OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry - * from other API versions will not be used to calculate performance for this - * SLI. If omitted, this SLI applies to all API versions. For service types - * that don't support breaking down by version, setting this field will result - * in an error. - * - * @property {Object} availability - * Good service is defined to be the count of requests made to this service - * that return successfully. - * - * This object should have the same structure as [AvailabilityCriteria]{@link google.monitoring.v3.AvailabilityCriteria} - * - * @property {Object} latency - * Good service is defined to be the count of requests made to this service - * that are fast enough with respect to `latency.threshold`. - * - * This object should have the same structure as [LatencyCriteria]{@link google.monitoring.v3.LatencyCriteria} - * - * @typedef BasicSli - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.BasicSli definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const BasicSli = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Future parameters for the availability SLI. - * @typedef AvailabilityCriteria - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.BasicSli.AvailabilityCriteria definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - AvailabilityCriteria: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Parameters for a latency threshold SLI. - * - * @property {Object} threshold - * Good service is defined to be the count of requests made to this service - * that return in no more than `threshold`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @typedef LatencyCriteria - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.BasicSli.LatencyCriteria definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - LatencyCriteria: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; - -/** - * Range of numerical values, inclusive of `min` and exclusive of `max`. If the - * open range "< range.max" is desired, set `range.min = -infinity`. If the open - * range ">= range.min" is desired, set `range.max = infinity`. - * - * @property {number} min - * Range minimum. - * - * @property {number} max - * Range maximum. - * - * @typedef Range - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.Range definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const Range = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * Service Level Indicators for which atomic units of service are counted - * directly. - * - * @property {Object} goodTotalRatio - * `good_total_ratio` is used when the ratio of `good_service` to - * `total_service` is computed from two `TimeSeries`. - * - * This object should have the same structure as [TimeSeriesRatio]{@link google.monitoring.v3.TimeSeriesRatio} - * - * @property {Object} distributionCut - * `distribution_cut` is used when `good_service` is a count of values - * aggregated in a `Distribution` that fall into a good range. The - * `total_service` is the total count of all values aggregated in the - * `Distribution`. - * - * This object should have the same structure as [DistributionCut]{@link google.monitoring.v3.DistributionCut} - * - * @typedef RequestBasedSli - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.RequestBasedSli definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const RequestBasedSli = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the - * `good_service / total_service` ratio. The specified `TimeSeries` must have - * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = - * DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify - * exactly two of good, bad, and total, and the relationship `good_service + - * bad_service = total_service` will be assumed. - * - * @property {string} goodServiceFilter - * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifying a `TimeSeries` quantifying good service provided. Must have - * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = - * DELTA` or `MetricKind = CUMULATIVE`. - * - * @property {string} badServiceFilter - * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifying a `TimeSeries` quantifying bad service, either demanded service - * that was not provided or demanded service that was of inadequate quality. - * Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have - * `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. - * - * @property {string} totalServiceFilter - * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifying a `TimeSeries` quantifying total demanded service. Must have - * `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = - * DELTA` or `MetricKind = CUMULATIVE`. - * - * @typedef TimeSeriesRatio - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.TimeSeriesRatio definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const TimeSeriesRatio = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring - * good service and total service. The `TimeSeries` must have `ValueType = - * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The - * computed `good_service` will be the count of values x in the `Distribution` - * such that `range.min <= x < range.max`. - * - * @property {string} distributionFilter - * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifying a `TimeSeries` aggregating values. Must have `ValueType = - * DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. - * - * @property {Object} range - * Range of values considered "good." For a one-sided range, set one bound to - * an infinite value. - * - * This object should have the same structure as [Range]{@link google.monitoring.v3.Range} - * - * @typedef DistributionCut - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DistributionCut definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const DistributionCut = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * A `WindowsBasedSli` defines `good_service` as the count of time windows for - * which the provided service was of good quality. Criteria for determining - * if service was good are embedded in the `window_criterion`. - * - * @property {string} goodBadMetricFilter - * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if - * any `true` values appear in the window. - * - * @property {Object} goodTotalRatioThreshold - * A window is good if its `performance` is high enough. - * - * This object should have the same structure as [PerformanceThreshold]{@link google.monitoring.v3.PerformanceThreshold} - * - * @property {Object} metricMeanInRange - * A window is good if the metric's value is in a good range, averaged - * across returned streams. - * - * This object should have the same structure as [MetricRange]{@link google.monitoring.v3.MetricRange} - * - * @property {Object} metricSumInRange - * A window is good if the metric's value is in a good range, summed across - * returned streams. - * - * This object should have the same structure as [MetricRange]{@link google.monitoring.v3.MetricRange} - * - * @property {Object} windowPeriod - * Duration over which window quality is evaluated. Must be an integer - * fraction of a day and at least `60s`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @typedef WindowsBasedSli - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.WindowsBasedSli definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ -const WindowsBasedSli = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * A `PerformanceThreshold` is used when each window is good when that window - * has a sufficiently high `performance`. - * - * @property {Object} performance - * `RequestBasedSli` to evaluate to judge window quality. - * - * This object should have the same structure as [RequestBasedSli]{@link google.monitoring.v3.RequestBasedSli} - * - * @property {Object} basicSliPerformance - * `BasicSli` to evaluate to judge window quality. - * - * This object should have the same structure as [BasicSli]{@link google.monitoring.v3.BasicSli} - * - * @property {number} threshold - * If window `performance >= threshold`, the window is counted as good. - * - * @typedef PerformanceThreshold - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.WindowsBasedSli.PerformanceThreshold definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - PerformanceThreshold: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * A `MetricRange` is used when each window is good when the value x of a - * single `TimeSeries` satisfies `range.min <= x < range.max`. The provided - * `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and - * `MetricKind = GAUGE`. - * - * @property {string} timeSeries - * A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifying the `TimeSeries` to use for evaluating window quality. - * - * @property {Object} range - * Range of values considered "good." For a one-sided range, set one bound - * to an infinite value. - * - * This object should have the same structure as [Range]{@link google.monitoring.v3.Range} - * - * @typedef MetricRange - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.WindowsBasedSli.MetricRange definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service.proto} - */ - MetricRange: { - // This is for documentation. Actual contents will be loaded by gRPC. - } -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_service_service.js b/src/v3/doc/google/monitoring/v3/doc_service_service.js deleted file mode 100644 index 0add0041..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_service_service.js +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `CreateService` request. - * - * @property {string} parent - * Required. Resource name of the parent workspace. - * Of the form `projects/{project_id}`. - * - * @property {string} serviceId - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern [a-z0-9\-]+ - * - * @property {Object} service - * Required. The `Service` to create. - * - * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} - * - * @typedef CreateServiceRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const CreateServiceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetService` request. - * - * @property {string} name - * Required. Resource name of the `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * - * @typedef GetServiceRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const GetServiceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListServices` request. - * - * @property {string} parent - * Required. Resource name of the parent `Workspace`. - * Of the form `projects/{project_id}`. - * - * @property {string} filter - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` - * - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". - * - * @property {number} pageSize - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @typedef ListServicesRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListServicesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const ListServicesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListServices` response. - * - * @property {Object[]} services - * The `Service`s matching the specified filter. - * - * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @typedef ListServicesResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListServicesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const ListServicesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `UpdateService` request. - * - * @property {Object} service - * Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * - * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} - * - * @property {Object} updateMask - * A set of field paths defining which fields to use for the update. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateServiceRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UpdateServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const UpdateServiceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `DeleteService` request. - * - * @property {string} name - * Required. Resource name of the `Service` to delete. - * Of the form `projects/{project_id}/services/{service_id}`. - * - * @typedef DeleteServiceRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteServiceRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const DeleteServiceRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `CreateServiceLevelObjective` request. - * - * @property {string} parent - * Required. Resource name of the parent `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * - * @property {string} serviceLevelObjectiveId - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern [a-z0-9\-]+ - * - * @property {Object} serviceLevelObjective - * Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} - * - * @typedef CreateServiceLevelObjectiveRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const CreateServiceLevelObjectiveRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `GetServiceLevelObjective` request. - * - * @property {string} name - * Required. Resource name of the `ServiceLevelObjective` to get. - * Of the form - * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. - * - * @property {number} view - * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * The number should be among the values of [View]{@link google.monitoring.v3.View} - * - * @typedef GetServiceLevelObjectiveRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const GetServiceLevelObjectiveRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListServiceLevelObjectives` request. - * - * @property {string} parent - * Required. Resource name of the parent `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * - * @property {string} filter - * A filter specifying what `ServiceLevelObjective`s to return. - * - * @property {number} pageSize - * A non-negative number that is the maximum number of results to return. - * When 0, use default page size. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return additional results from the previous method call. - * - * @property {number} view - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * The number should be among the values of [View]{@link google.monitoring.v3.View} - * - * @typedef ListServiceLevelObjectivesRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListServiceLevelObjectivesRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const ListServiceLevelObjectivesRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `ListServiceLevelObjectives` response. - * - * @property {Object[]} serviceLevelObjectives - * The `ServiceLevelObjective`s matching the specified filter. - * - * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} - * - * @property {string} nextPageToken - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, - * use that value as `pageToken` in the next call to this method. - * - * @typedef ListServiceLevelObjectivesResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListServiceLevelObjectivesResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const ListServiceLevelObjectivesResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `UpdateServiceLevelObjective` request. - * - * @property {Object} serviceLevelObjective - * Required. The `ServiceLevelObjective` to draw updates from. - * The given `name` specifies the resource to update. - * - * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} - * - * @property {Object} updateMask - * A set of field paths defining which fields to use for the update. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @typedef UpdateServiceLevelObjectiveRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UpdateServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const UpdateServiceLevelObjectiveRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The `DeleteServiceLevelObjective` request. - * - * @property {string} name - * Required. Resource name of the `ServiceLevelObjective` to delete. - * Of the form - * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. - * - * @typedef DeleteServiceLevelObjectiveRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteServiceLevelObjectiveRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/service_service.proto} - */ -const DeleteServiceLevelObjectiveRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_uptime.js b/src/v3/doc/google/monitoring/v3/doc_uptime.js deleted file mode 100644 index 4f171a93..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_uptime.js +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * An internal checker allows Uptime checks to run on private/internal GCP - * resources. - * - * @property {string} name - * A unique resource name for this InternalChecker. The format is: - * - * `projects/[PROJECT_ID]/internalCheckers/[INTERNAL_CHECKER_ID]`. - * - * `[PROJECT_ID]` is the Stackdriver Workspace project for the - * Uptime check config associated with the internal checker. - * - * @property {string} displayName - * The checker's human-readable name. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. - * - * @property {string} network - * The [GCP VPC network](https://cloud.google.com/vpc/docs/vpc) where the - * internal resource lives (ex: "default"). - * - * @property {string} gcpZone - * The GCP zone the Uptime check should egress from. Only respected for - * internal Uptime checks, where internal_network is specified. - * - * @property {string} peerProjectId - * The GCP project ID where the internal checker lives. Not necessary - * the same as the Workspace project. - * - * @property {number} state - * The current operational state of the internal checker. - * - * The number should be among the values of [State]{@link google.monitoring.v3.State} - * - * @typedef InternalChecker - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.InternalChecker definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ -const InternalChecker = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Operational states for an internal checker. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - State: { - - /** - * An internal checker should never be in the unspecified state. - */ - UNSPECIFIED: 0, - - /** - * The checker is being created, provisioned, and configured. A checker in - * this state can be returned by `ListInternalCheckers` or - * `GetInternalChecker`, as well as by examining the [long running - * Operation](https://cloud.google.com/apis/design/design_patterns#long_running_operations) - * that created it. - */ - CREATING: 1, - - /** - * The checker is running and available for use. A checker in this state - * can be returned by `ListInternalCheckers` or `GetInternalChecker` as - * well as by examining the [long running - * Operation](https://cloud.google.com/apis/design/design_patterns#long_running_operations) - * that created it. - * If a checker is being torn down, it is neither visible nor usable, so - * there is no "deleting" or "down" state. - */ - RUNNING: 2 - } -}; - -/** - * This message configures which resources and services to monitor for - * availability. - * - * @property {string} name - * A unique resource name for this Uptime check configuration. The format is: - * - * `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. - * - * This field should be omitted when creating the Uptime check configuration; - * on create, the resource name is assigned by the server and included in the - * response. - * - * @property {string} displayName - * A human-friendly name for the Uptime check configuration. The display name - * should be unique within a Stackdriver Workspace in order to make it easier - * to identify; however, uniqueness is not enforced. Required. - * - * @property {Object} monitoredResource - * The [monitored - * resource](https://cloud.google.com/monitoring/api/resources) associated - * with the configuration. - * The following monitored resource types are supported for Uptime checks: - * `uptime_url`, - * `gce_instance`, - * `gae_app`, - * `aws_ec2_instance`, - * `aws_elb_load_balancer` - * - * This object should have the same structure as [MonitoredResource]{@link google.api.MonitoredResource} - * - * @property {Object} resourceGroup - * The group resource associated with the configuration. - * - * This object should have the same structure as [ResourceGroup]{@link google.monitoring.v3.ResourceGroup} - * - * @property {Object} httpCheck - * Contains information needed to make an HTTP or HTTPS check. - * - * This object should have the same structure as [HttpCheck]{@link google.monitoring.v3.HttpCheck} - * - * @property {Object} tcpCheck - * Contains information needed to make a TCP check. - * - * This object should have the same structure as [TcpCheck]{@link google.monitoring.v3.TcpCheck} - * - * @property {Object} period - * How often, in seconds, the Uptime check is performed. - * Currently, the only supported values are `60s` (1 minute), `300s` - * (5 minutes), `600s` (10 minutes), and `900s` (15 minutes). Optional, - * defaults to `60s`. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object} timeout - * The maximum amount of time to wait for the request to complete (must be - * between 1 and 60 seconds). Required. - * - * This object should have the same structure as [Duration]{@link google.protobuf.Duration} - * - * @property {Object[]} contentMatchers - * The content that is expected to appear in the data returned by the target - * server against which the check is run. Currently, only the first entry - * in the `content_matchers` list is supported, and additional entries will - * be ignored. This field is optional and should only be specified if a - * content match is required as part of the/ Uptime check. - * - * This object should have the same structure as [ContentMatcher]{@link google.monitoring.v3.ContentMatcher} - * - * @property {number[]} selectedRegions - * The list of regions from which the check will be run. - * Some regions contain one location, and others contain more than one. - * If this field is specified, enough regions must be provided to include a - * minimum of 3 locations. Not specifying this field will result in Uptime - * checks running from all available regions. - * - * The number should be among the values of [UptimeCheckRegion]{@link google.monitoring.v3.UptimeCheckRegion} - * - * @property {boolean} isInternal - * If this is `true`, then checks are made only from the 'internal_checkers'. - * If it is `false`, then checks are made only from the 'selected_regions'. - * It is an error to provide 'selected_regions' when is_internal is `true`, - * or to provide 'internal_checkers' when is_internal is `false`. - * - * @property {Object[]} internalCheckers - * The internal checkers that this check will egress from. If `is_internal` is - * `true` and this list is empty, the check will egress from all the - * InternalCheckers configured for the project that owns this - * `UptimeCheckConfig`. - * - * This object should have the same structure as [InternalChecker]{@link google.monitoring.v3.InternalChecker} - * - * @typedef UptimeCheckConfig - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ -const UptimeCheckConfig = { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The resource submessage for group checks. It can be used instead of a - * monitored resource, when multiple resources are being monitored. - * - * @property {string} groupId - * The group of resources being monitored. Should be only the `[GROUP_ID]`, - * and not the full-path `projects/[PROJECT_ID]/groups/[GROUP_ID]`. - * - * @property {number} resourceType - * The resource type of the group members. - * - * The number should be among the values of [GroupResourceType]{@link google.monitoring.v3.GroupResourceType} - * - * @typedef ResourceGroup - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckConfig.ResourceGroup definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ - ResourceGroup: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Information involved in an HTTP/HTTPS Uptime check request. - * - * @property {boolean} useSsl - * If `true`, use HTTPS instead of HTTP to run the check. - * - * @property {string} path - * Optional (defaults to "/"). The path to the page against which to run - * the check. Will be combined with the `host` (specified within the - * `monitored_resource`) and `port` to construct the full URL. If the - * provided path does not begin with "/", a "/" will be prepended - * automatically. - * - * @property {number} port - * Optional (defaults to 80 when `use_ssl` is `false`, and 443 when - * `use_ssl` is `true`). The TCP port on the HTTP server against which to - * run the check. Will be combined with host (specified within the - * `monitored_resource`) and `path` to construct the full URL. - * - * @property {Object} authInfo - * The authentication information. Optional when creating an HTTP check; - * defaults to empty. - * - * This object should have the same structure as [BasicAuthentication]{@link google.monitoring.v3.BasicAuthentication} - * - * @property {boolean} maskHeaders - * Boolean specifiying whether to encrypt the header information. - * Encryption should be specified for any headers related to authentication - * that you do not wish to be seen when retrieving the configuration. The - * server will be responsible for encrypting the headers. - * On Get/List calls, if `mask_headers` is set to `true` then the headers - * will be obscured with `******.` - * - * @property {Object.} headers - * The list of headers to send as part of the Uptime check request. - * If two headers have the same key and different values, they should - * be entered as a single header, with the value being a comma-separated - * list of all the desired values as described at - * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). - * Entering two separate headers with the same key in a Create call will - * cause the first to be overwritten by the second. - * The maximum number of headers allowed is 100. - * - * @property {boolean} validateSsl - * Boolean specifying whether to include SSL certificate validation as a - * part of the Uptime check. Only applies to checks where - * `monitored_resource` is set to `uptime_url`. If `use_ssl` is `false`, - * setting `validate_ssl` to `true` has no effect. - * - * @typedef HttpCheck - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckConfig.HttpCheck definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ - HttpCheck: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * The authentication parameters to provide to the specified resource or - * URL that requires a username and password. Currently, only - * [Basic HTTP authentication](https://tools.ietf.org/html/rfc7617) is - * supported in Uptime checks. - * - * @property {string} username - * The username to use when authenticating with the HTTP server. - * - * @property {string} password - * The password to use when authenticating with the HTTP server. - * - * @typedef BasicAuthentication - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckConfig.HttpCheck.BasicAuthentication definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ - BasicAuthentication: { - // This is for documentation. Actual contents will be loaded by gRPC. - } - }, - - /** - * Information required for a TCP Uptime check request. - * - * @property {number} port - * The TCP port on the server against which to run the check. Will be - * combined with host (specified within the `monitored_resource`) to - * construct the full URL. Required. - * - * @typedef TcpCheck - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckConfig.TcpCheck definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ - TcpCheck: { - // This is for documentation. Actual contents will be loaded by gRPC. - }, - - /** - * Optional. Used to perform content matching. This allows matching based on - * substrings and regular expressions, together with their negations. Only the - * first 4 MB of an HTTP or HTTPS check's response (and the first - * 1 MB of a TCP check's response) are examined for purposes of content - * matching. - * - * @property {string} content - * String or regex content to match. Maximum 1024 bytes. An empty `content` - * string indicates no content matching is to be performed. - * - * @property {number} matcher - * The type of content matcher that will be applied to the server output, - * compared to the `content` string when the check is run. - * - * The number should be among the values of [ContentMatcherOption]{@link google.monitoring.v3.ContentMatcherOption} - * - * @typedef ContentMatcher - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckConfig.ContentMatcher definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ - ContentMatcher: { - // This is for documentation. Actual contents will be loaded by gRPC. - - /** - * Options to perform content matching. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ - ContentMatcherOption: { - - /** - * No content matcher type specified (maintained for backward - * compatibility, but deprecated for future use). - * Treated as `CONTAINS_STRING`. - */ - CONTENT_MATCHER_OPTION_UNSPECIFIED: 0, - - /** - * Selects substring matching. The match succeeds if the output contains - * the `content` string. This is the default value for checks without - * a `matcher` option, or where the value of `matcher` is - * `CONTENT_MATCHER_OPTION_UNSPECIFIED`. - */ - CONTAINS_STRING: 1, - - /** - * Selects negation of substring matching. The match succeeds if the - * output does _NOT_ contain the `content` string. - */ - NOT_CONTAINS_STRING: 2, - - /** - * Selects regular-expression matching. The match succeeds of the output - * matches the regular expression specified in the `content` string. - */ - MATCHES_REGEX: 3, - - /** - * Selects negation of regular-expression matching. The match succeeds if - * the output does _NOT_ match the regular expression specified in the - * `content` string. - */ - NOT_MATCHES_REGEX: 4 - } - } -}; - -/** - * Contains the region, location, and list of IP - * addresses where checkers in the location run from. - * - * @property {number} region - * A broad region category in which the IP address is located. - * - * The number should be among the values of [UptimeCheckRegion]{@link google.monitoring.v3.UptimeCheckRegion} - * - * @property {string} location - * A more specific location within the region that typically encodes - * a particular city/town/metro (and its containing state/province or country) - * within the broader umbrella region category. - * - * @property {string} ipAddress - * The IP address from which the Uptime check originates. This is a fully - * specified IP address (not an IP address range). Most IP addresses, as of - * this publication, are in IPv4 format; however, one should not rely on the - * IP addresses being in IPv4 format indefinitely, and should support - * interpreting this field in either IPv4 or IPv6 format. - * - * @typedef UptimeCheckIp - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UptimeCheckIp definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime.proto} - */ -const UptimeCheckIp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The supported resource types that can be used as values of - * `group_resource.resource_type`. - * `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types. - * The resource types `gae_app` and `uptime_url` are not valid here because - * group checks on App Engine modules and URLs are not allowed. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ -const GroupResourceType = { - - /** - * Default value (not valid). - */ - RESOURCE_TYPE_UNSPECIFIED: 0, - - /** - * A group of instances from Google Cloud Platform (GCP) or - * Amazon Web Services (AWS). - */ - INSTANCE: 1, - - /** - * A group of Amazon ELB load balancers. - */ - AWS_ELB_LOAD_BALANCER: 2 -}; - -/** - * The regions from which an Uptime check can be run. - * - * @enum {number} - * @memberof google.monitoring.v3 - */ -const UptimeCheckRegion = { - - /** - * Default value if no region is specified. Will result in Uptime checks - * running from all regions. - */ - REGION_UNSPECIFIED: 0, - - /** - * Allows checks to run from locations within the United States of America. - */ - USA: 1, - - /** - * Allows checks to run from locations within the continent of Europe. - */ - EUROPE: 2, - - /** - * Allows checks to run from locations within the continent of South - * America. - */ - SOUTH_AMERICA: 3, - - /** - * Allows checks to run from locations within the Asia Pacific area (ex: - * Singapore). - */ - ASIA_PACIFIC: 4 -}; \ No newline at end of file diff --git a/src/v3/doc/google/monitoring/v3/doc_uptime_service.js b/src/v3/doc/google/monitoring/v3/doc_uptime_service.js deleted file mode 100644 index 29457c29..00000000 --- a/src/v3/doc/google/monitoring/v3/doc_uptime_service.js +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The protocol for the `ListUptimeCheckConfigs` request. - * - * @property {string} parent - * Required. The project whose Uptime check configurations are listed. The format - * is `projects/[PROJECT_ID]`. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. The server - * may further constrain the maximum number of results returned in a single - * page. If the page_size is <=0, the server will decide the number of results - * to be returned. - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * - * @typedef ListUptimeCheckConfigsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListUptimeCheckConfigsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const ListUptimeCheckConfigsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `ListUptimeCheckConfigs` response. - * - * @property {Object[]} uptimeCheckConfigs - * The returned Uptime check configurations. - * - * This object should have the same structure as [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} - * - * @property {string} nextPageToken - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * - * @property {number} totalSize - * The total number of Uptime check configurations for the project, - * irrespective of any pagination. - * - * @typedef ListUptimeCheckConfigsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListUptimeCheckConfigsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const ListUptimeCheckConfigsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `GetUptimeCheckConfig` request. - * - * @property {string} name - * Required. The Uptime check configuration to retrieve. The format - * is `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. - * - * @typedef GetUptimeCheckConfigRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.GetUptimeCheckConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const GetUptimeCheckConfigRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `CreateUptimeCheckConfig` request. - * - * @property {string} parent - * Required. The project in which to create the Uptime check. The format - * is `projects/[PROJECT_ID]`. - * - * @property {Object} uptimeCheckConfig - * Required. The new Uptime check configuration. - * - * This object should have the same structure as [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} - * - * @typedef CreateUptimeCheckConfigRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.CreateUptimeCheckConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const CreateUptimeCheckConfigRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `UpdateUptimeCheckConfig` request. - * - * @property {Object} updateMask - * Optional. If present, only the listed fields in the current Uptime check - * configuration are updated with values from the new configuration. If this - * field is empty, then the current configuration is completely replaced with - * the new configuration. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * - * @property {Object} uptimeCheckConfig - * Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * - * This object should have the same structure as [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} - * - * @typedef UpdateUptimeCheckConfigRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.UpdateUptimeCheckConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const UpdateUptimeCheckConfigRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `DeleteUptimeCheckConfig` request. - * - * @property {string} name - * Required. The Uptime check configuration to delete. The format - * is `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. - * - * @typedef DeleteUptimeCheckConfigRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.DeleteUptimeCheckConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const DeleteUptimeCheckConfigRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `ListUptimeCheckIps` request. - * - * @property {number} pageSize - * The maximum number of results to return in a single response. The server - * may further constrain the maximum number of results returned in a single - * page. If the page_size is <=0, the server will decide the number of results - * to be returned. - * NOTE: this field is not yet implemented - * - * @property {string} pageToken - * If this field is not empty then it must contain the `nextPageToken` value - * returned by a previous call to this method. Using this field causes the - * method to return more results from the previous method call. - * NOTE: this field is not yet implemented - * - * @typedef ListUptimeCheckIpsRequest - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListUptimeCheckIpsRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const ListUptimeCheckIpsRequest = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * The protocol for the `ListUptimeCheckIps` response. - * - * @property {Object[]} uptimeCheckIps - * The returned list of IP addresses (including region and location) that the - * checkers run from. - * - * This object should have the same structure as [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp} - * - * @property {string} nextPageToken - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - * NOTE: this field is not yet implemented - * - * @typedef ListUptimeCheckIpsResponse - * @memberof google.monitoring.v3 - * @see [google.monitoring.v3.ListUptimeCheckIpsResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/monitoring/v3/uptime_service.proto} - */ -const ListUptimeCheckIpsResponse = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_any.js b/src/v3/doc/google/protobuf/doc_any.js deleted file mode 100644 index 813682aa..00000000 --- a/src/v3/doc/google/protobuf/doc_any.js +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. - * - * Protobuf library provides support to pack/unpack Any values in the form - * of utility functions or additional generated methods of the Any type. - * - * Example 1: Pack and unpack a message in C++. - * - * Foo foo = ...; - * Any any; - * any.PackFrom(foo); - * ... - * if (any.UnpackTo(&foo)) { - * ... - * } - * - * Example 2: Pack and unpack a message in Java. - * - * Foo foo = ...; - * Any any = Any.pack(foo); - * ... - * if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); - * } - * - * Example 3: Pack and unpack a message in Python. - * - * foo = Foo(...) - * any = Any() - * any.Pack(foo) - * ... - * if any.Is(Foo.DESCRIPTOR): - * any.Unpack(foo) - * ... - * - * Example 4: Pack and unpack a message in Go - * - * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) - * ... - * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... - * } - * - * The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' - * in the type URL, for example "foo.bar.com/x/y.z" will yield type - * name "y.z". - * - * - * # JSON - * - * The JSON representation of an `Any` value uses the regular - * representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: - * - * package google.profile; - * message Person { - * string first_name = 1; - * string last_name = 2; - * } - * - * { - * "@type": "type.googleapis.com/google.profile.Person", - * "firstName": , - * "lastName": - * } - * - * If the embedded message type is well-known and has a custom JSON - * representation, that representation will be embedded adding a field - * `value` which holds the custom JSON in addition to the `@type` - * field. Example (for message google.protobuf.Duration): - * - * { - * "@type": "type.googleapis.com/google.protobuf.Duration", - * "value": "1.212s" - * } - * - * @property {string} typeUrl - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a google.protobuf.Type - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * - * @property {Buffer} value - * Must be a valid serialized protocol buffer of the above specified type. - * - * @typedef Any - * @memberof google.protobuf - * @see [google.protobuf.Any definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/any.proto} - */ -const Any = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_duration.js b/src/v3/doc/google/protobuf/doc_duration.js deleted file mode 100644 index bd4b4ee6..00000000 --- a/src/v3/doc/google/protobuf/doc_duration.js +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - * - * @property {number} seconds - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - * - * @property {number} nanos - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - * - * @typedef Duration - * @memberof google.protobuf - * @see [google.protobuf.Duration definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/duration.proto} - */ -const Duration = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_empty.js b/src/v3/doc/google/protobuf/doc_empty.js deleted file mode 100644 index 1e3961d6..00000000 --- a/src/v3/doc/google/protobuf/doc_empty.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request - * or the response type of an API method. For instance: - * - * service Foo { - * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - * } - * - * The JSON representation for `Empty` is empty JSON object `{}`. - * @typedef Empty - * @memberof google.protobuf - * @see [google.protobuf.Empty definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/empty.proto} - */ -const Empty = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_field_mask.js b/src/v3/doc/google/protobuf/doc_field_mask.js deleted file mode 100644 index 59e745f3..00000000 --- a/src/v3/doc/google/protobuf/doc_field_mask.js +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. - * - * @property {string[]} paths - * The set of field mask paths. - * - * @typedef FieldMask - * @memberof google.protobuf - * @see [google.protobuf.FieldMask definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/field_mask.proto} - */ -const FieldMask = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_struct.js b/src/v3/doc/google/protobuf/doc_struct.js deleted file mode 100644 index a143b9a6..00000000 --- a/src/v3/doc/google/protobuf/doc_struct.js +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * `Struct` represents a structured data value, consisting of fields - * which map to dynamically typed values. In some languages, `Struct` - * might be supported by a native representation. For example, in - * scripting languages like JS a struct is represented as an - * object. The details of that representation are described together - * with the proto support for the language. - * - * The JSON representation for `Struct` is JSON object. - * - * @property {Object.} fields - * Unordered map of dynamically typed values. - * - * @typedef Struct - * @memberof google.protobuf - * @see [google.protobuf.Struct definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Struct = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `Value` represents a dynamically typed value which can be either - * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of that - * variants, absence of any variant indicates an error. - * - * The JSON representation for `Value` is JSON value. - * - * @property {number} nullValue - * Represents a null value. - * - * The number should be among the values of [NullValue]{@link google.protobuf.NullValue} - * - * @property {number} numberValue - * Represents a double value. - * - * @property {string} stringValue - * Represents a string value. - * - * @property {boolean} boolValue - * Represents a boolean value. - * - * @property {Object} structValue - * Represents a structured value. - * - * This object should have the same structure as [Struct]{@link google.protobuf.Struct} - * - * @property {Object} listValue - * Represents a repeated `Value`. - * - * This object should have the same structure as [ListValue]{@link google.protobuf.ListValue} - * - * @typedef Value - * @memberof google.protobuf - * @see [google.protobuf.Value definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const Value = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `ListValue` is a wrapper around a repeated field of values. - * - * The JSON representation for `ListValue` is JSON array. - * - * @property {Object[]} values - * Repeated field of dynamically typed values. - * - * This object should have the same structure as [Value]{@link google.protobuf.Value} - * - * @typedef ListValue - * @memberof google.protobuf - * @see [google.protobuf.ListValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/struct.proto} - */ -const ListValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; - -/** - * `NullValue` is a singleton enumeration to represent the null value for the - * `Value` type union. - * - * The JSON representation for `NullValue` is JSON `null`. - * - * @enum {number} - * @memberof google.protobuf - */ -const NullValue = { - - /** - * Null value. - */ - NULL_VALUE: 0 -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_timestamp.js b/src/v3/doc/google/protobuf/doc_timestamp.js deleted file mode 100644 index ad801cc9..00000000 --- a/src/v3/doc/google/protobuf/doc_timestamp.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * - * Example 5: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`](https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D) to obtain a formatter capable of generating timestamps in this format. - * - * @property {number} seconds - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - * - * @property {number} nanos - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - * - * @typedef Timestamp - * @memberof google.protobuf - * @see [google.protobuf.Timestamp definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto} - */ -const Timestamp = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/protobuf/doc_wrappers.js b/src/v3/doc/google/protobuf/doc_wrappers.js deleted file mode 100644 index 158af088..00000000 --- a/src/v3/doc/google/protobuf/doc_wrappers.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * Wrapper message for `bool`. - * - * The JSON representation for `BoolValue` is JSON `true` and `false`. - * - * @property {boolean} value - * The bool value. - * - * @typedef BoolValue - * @memberof google.protobuf - * @see [google.protobuf.BoolValue definition in proto format]{@link https://github.com/google/protobuf/blob/master/src/google/protobuf/wrappers.proto} - */ -const BoolValue = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/doc/google/rpc/doc_status.js b/src/v3/doc/google/rpc/doc_status.js deleted file mode 100644 index 750e0af7..00000000 --- a/src/v3/doc/google/rpc/doc_status.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 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. - -// Note: this file is purely for documentation. Any contents are not expected -// to be loaded as the JS file. - -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). Each `Status` message contains - * three pieces of data: error code, error message, and error details. - * - * You can find out more about this error model and how to work with it in the - * [API Design Guide](https://cloud.google.com/apis/design/errors). - * - * @property {number} code - * The status code, which should be an enum value of google.rpc.Code. - * - * @property {string} message - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - * - * @property {Object[]} details - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - * - * This object should have the same structure as [Any]{@link google.protobuf.Any} - * - * @typedef Status - * @memberof google.rpc - * @see [google.rpc.Status definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto} - */ -const Status = { - // This is for documentation. Actual contents will be loaded by gRPC. -}; \ No newline at end of file diff --git a/src/v3/group_service_client.js b/src/v3/group_service_client.js deleted file mode 100644 index fd4b1558..00000000 --- a/src/v3/group_service_client.js +++ /dev/null @@ -1,933 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./group_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * The Group API lets you inspect and manage your - * [groups](https://cloud.google.com#google.monitoring.v3.Group). - * - * A group is a named filter that is used to identify - * a collection of monitored resources. Groups are typically used to - * mirror the physical and/or logical topology of the environment. - * Because group membership is computed dynamically, monitored - * resources that are started in the future are automatically placed - * in matching groups. By using a group to name monitored resources in, - * for example, an alert policy, the target of that alert policy is - * updated automatically as monitored resources are added and removed - * from the infrastructure. - * - * @class - * @memberof v3 - */ -class GroupServiceClient { - /** - * Construct an instance of GroupServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - groupPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/groups/{group}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - // 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 = { - listGroups: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'group' - ), - listGroupMembers: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'members' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.monitoring.v3.GroupService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.monitoring.v3.GroupService. - const groupServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.monitoring.v3.GroupService') - : protos.google.monitoring.v3.GroupService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const groupServiceStubMethods = [ - 'listGroups', - 'getGroup', - 'createGroup', - 'updateGroup', - 'deleteGroup', - 'listGroupMembers', - ]; - for (const methodName of groupServiceStubMethods) { - const innerCallPromise = groupServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'monitoring.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'monitoring.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Lists the existing groups. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project whose groups are to be listed. The format is - * `"projects/{project_id_or_number}"`. - * @param {string} [request.childrenOfGroup] - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns groups whose `parentName` field contains the group - * name. If no groups have this parent, the results are empty. - * @param {string} [request.ancestorsOfGroup] - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns groups that are ancestors of the specified group. - * The groups are returned in order, starting with the immediate parent and - * ending with the most distant ancestor. If the specified group has no - * immediate parent, the results are empty. - * @param {string} [request.descendantsOfGroup] - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns the descendants of the specified group. This is a superset of - * the results returned by the `childrenOfGroup` filter, and includes - * children-of-children, and so forth. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Group]{@link google.monitoring.v3.Group}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListGroupsResponse]{@link google.monitoring.v3.ListGroupsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Group]{@link google.monitoring.v3.Group}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Group]{@link google.monitoring.v3.Group} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListGroupsResponse]{@link google.monitoring.v3.ListGroupsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * - * client.listGroups({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listGroups(nextRequest, options).then(callback); - * } - * } - * client.listGroups({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listGroups(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listGroups(request, options, callback); - } - - /** - * Equivalent to {@link listGroups}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGroups} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project whose groups are to be listed. The format is - * `"projects/{project_id_or_number}"`. - * @param {string} [request.childrenOfGroup] - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns groups whose `parentName` field contains the group - * name. If no groups have this parent, the results are empty. - * @param {string} [request.ancestorsOfGroup] - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns groups that are ancestors of the specified group. - * The groups are returned in order, starting with the immediate parent and - * ending with the most distant ancestor. If the specified group has no - * immediate parent, the results are empty. - * @param {string} [request.descendantsOfGroup] - * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. - * Returns the descendants of the specified group. This is a superset of - * the results returned by the `childrenOfGroup` filter, and includes - * children-of-children, and so forth. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Group]{@link google.monitoring.v3.Group} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * client.listGroupsStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listGroupsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listGroups.createStream( - this._innerApiCalls.listGroups, - request, - options - ); - } - - /** - * Gets a single group. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The group to retrieve. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Group]{@link google.monitoring.v3.Group}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Group]{@link google.monitoring.v3.Group}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - * client.getGroup({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getGroup(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getGroup(request, options, callback); - } - - /** - * Creates a new group. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project in which to create the group. The format is - * `"projects/{project_id_or_number}"`. - * @param {Object} request.group - * Required. A group definition. It is an error to define the `name` field because - * the system assigns the name. - * - * This object should have the same structure as [Group]{@link google.monitoring.v3.Group} - * @param {boolean} [request.validateOnly] - * If true, validate this request but do not create the group. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Group]{@link google.monitoring.v3.Group}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Group]{@link google.monitoring.v3.Group}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * const group = {}; - * const request = { - * name: formattedName, - * group: group, - * }; - * client.createGroup(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createGroup(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createGroup(request, options, callback); - } - - /** - * Updates an existing group. - * You can change any group attributes except `name`. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.group - * Required. The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of this group. - * - * This object should have the same structure as [Group]{@link google.monitoring.v3.Group} - * @param {boolean} [request.validateOnly] - * If true, validate this request but do not update the existing group. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Group]{@link google.monitoring.v3.Group}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Group]{@link google.monitoring.v3.Group}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * const group = {}; - * client.updateGroup({group: group}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateGroup(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'group.name': request.group.name, - }); - - return this._innerApiCalls.updateGroup(request, options, callback); - } - - /** - * Deletes an existing group. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The group to delete. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * @param {boolean} [request.recursive] - * If this field is true, then the request means to delete a group with all - * its descendants. Otherwise, the request means to delete a group only when - * it has no descendants. The default value is false. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - * client.deleteGroup({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteGroup(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteGroup(request, options, callback); - } - - /** - * Lists the monitored resources that are members of a group. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The group whose members are listed. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * @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 {string} [request.filter] - * An optional [list filter](https://cloud.google.com/monitoring/api/learn_more#filtering) describing - * the members to be returned. The filter may reference the type, labels, and - * metadata of monitored resources that comprise the group. - * For example, to return only resources representing Compute Engine VM - * instances, use this filter: - * - * resource.type = "gce_instance" - * @param {Object} [request.interval] - * An optional time interval for which results should be returned. Only - * members that were part of the group during the specified interval are - * included in the response. If no interval is provided then the group - * membership over the last minute is returned. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [MonitoredResource]{@link google.api.MonitoredResource}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListGroupMembersResponse]{@link google.monitoring.v3.ListGroupMembersResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MonitoredResource]{@link google.api.MonitoredResource}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [MonitoredResource]{@link google.api.MonitoredResource} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListGroupMembersResponse]{@link google.monitoring.v3.ListGroupMembersResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - * - * client.listGroupMembers({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listGroupMembers(nextRequest, options).then(callback); - * } - * } - * client.listGroupMembers({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listGroupMembers(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listGroupMembers(request, options, callback); - } - - /** - * Equivalent to {@link listGroupMembers}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGroupMembers} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The group whose members are listed. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * @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 {string} [request.filter] - * An optional [list filter](https://cloud.google.com/monitoring/api/learn_more#filtering) describing - * the members to be returned. The filter may reference the type, labels, and - * metadata of monitored resources that comprise the group. - * For example, to return only resources representing Compute Engine VM - * instances, use this filter: - * - * resource.type = "gce_instance" - * @param {Object} [request.interval] - * An optional time interval for which results should be returned. Only - * members that were part of the group during the specified interval are - * included in the response. If no interval is provided then the group - * membership over the last minute is returned. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [MonitoredResource]{@link google.api.MonitoredResource} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.GroupServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - * client.listGroupMembersStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listGroupMembersStream(request, options) { - options = options || {}; - - return this._descriptors.page.listGroupMembers.createStream( - this._innerApiCalls.listGroupMembers, - request, - options - ); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified group resource name string. - * - * @param {String} project - * @param {String} group - * @returns {String} - */ - groupPath(project, group) { - return this._pathTemplates.groupPathTemplate.render({ - project: project, - group: group, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the groupName from a group resource. - * - * @param {String} groupName - * A fully-qualified path representing a group resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromGroupName(groupName) { - return this._pathTemplates.groupPathTemplate.match(groupName).project; - } - - /** - * Parse the groupName from a group resource. - * - * @param {String} groupName - * A fully-qualified path representing a group resources. - * @returns {String} - A string representing the group. - */ - matchGroupFromGroupName(groupName) { - return this._pathTemplates.groupPathTemplate.match(groupName).group; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = GroupServiceClient; diff --git a/src/v3/group_service_client.ts b/src/v3/group_service_client.ts new file mode 100644 index 00000000..a3b3787d --- /dev/null +++ b/src/v3/group_service_client.ts @@ -0,0 +1,2011 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './group_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Group API lets you inspect and manage your + * [groups](#google.monitoring.v3.Group). + * + * A group is a named filter that is used to identify + * a collection of monitored resources. Groups are typically used to + * mirror the physical and/or logical topology of the environment. + * Because group membership is computed dynamically, monitored + * resources that are started in the future are automatically placed + * in matching groups. By using a group to name monitored resources in, + * for example, an alert policy, the target of that alert policy is + * updated automatically as monitored resources are added and removed + * from the infrastructure. + * @class + * @memberof v3 + */ +export class GroupServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + groupServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GroupServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof GroupServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof GroupServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + folderAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/alertPolicies/{alert_policy}' + ), + folderChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannelDescriptors/{channel_descriptor}' + ), + folderGroupPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/groups/{group}' + ), + folderNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannels/{notification_channel}' + ), + folderServicePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}' + ), + organizationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), + organizationGroupPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/groups/{group}' + ), + organizationNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + projectChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' + ), + projectGroupPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/groups/{group}' + ), + projectNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannels/{notification_channel}' + ), + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' + ), + }; + + // 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 = { + listGroups: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'group' + ), + listGroupMembers: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'members' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.GroupService', + 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 = {}; + + // Put together the "service stub" for + // google.monitoring.v3.GroupService. + this.groupServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.monitoring.v3.GroupService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.monitoring.v3.GroupService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const groupServiceStubMethods = [ + 'listGroups', + 'getGroup', + 'createGroup', + 'updateGroup', + 'deleteGroup', + 'listGroupMembers', + ]; + + for (const methodName of groupServiceStubMethods) { + const innerCallPromise = this.groupServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getGroup( + request: protosTypes.google.monitoring.v3.IGetGroupRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IGetGroupRequest | undefined, + {} | undefined + ] + >; + getGroup( + request: protosTypes.google.monitoring.v3.IGetGroupRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IGetGroupRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a single group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The group to retrieve. The format is + * `"projects/{project_id_or_number}/groups/{group_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 [Group]{@link google.monitoring.v3.Group}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGroup( + request: protosTypes.google.monitoring.v3.IGetGroupRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IGetGroupRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IGetGroupRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IGetGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getGroup(request, options, callback); + } + createGroup( + request: protosTypes.google.monitoring.v3.ICreateGroupRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.ICreateGroupRequest | undefined, + {} | undefined + ] + >; + createGroup( + request: protosTypes.google.monitoring.v3.ICreateGroupRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.ICreateGroupRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates a new group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project in which to create the group. The format is + * `"projects/{project_id_or_number}"`. + * @param {google.monitoring.v3.Group} request.group + * Required. A group definition. It is an error to define the `name` field because + * the system assigns the name. + * @param {boolean} request.validateOnly + * If true, validate this request but do not create the group. + * @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 [Group]{@link google.monitoring.v3.Group}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGroup( + request: protosTypes.google.monitoring.v3.ICreateGroupRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.ICreateGroupRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.ICreateGroupRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.ICreateGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.createGroup(request, options, callback); + } + updateGroup( + request: protosTypes.google.monitoring.v3.IUpdateGroupRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IUpdateGroupRequest | undefined, + {} | undefined + ] + >; + updateGroup( + request: protosTypes.google.monitoring.v3.IUpdateGroupRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IUpdateGroupRequest | undefined, + {} | undefined + > + ): void; + /** + * Updates an existing group. + * You can change any group attributes except `name`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.monitoring.v3.Group} request.group + * Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * @param {boolean} request.validateOnly + * If true, validate this request but do not update the existing group. + * @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 [Group]{@link google.monitoring.v3.Group}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGroup( + request: protosTypes.google.monitoring.v3.IUpdateGroupRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IUpdateGroupRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IUpdateGroupRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup, + protosTypes.google.monitoring.v3.IUpdateGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + 'group.name': request.group!.name || '', + }); + return this._innerApiCalls.updateGroup(request, options, callback); + } + deleteGroup( + request: protosTypes.google.monitoring.v3.IDeleteGroupRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteGroupRequest | undefined, + {} | undefined + ] + >; + deleteGroup( + request: protosTypes.google.monitoring.v3.IDeleteGroupRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteGroupRequest | undefined, + {} | undefined + > + ): void; + /** + * Deletes an existing group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The group to delete. The format is + * `"projects/{project_id_or_number}/groups/{group_id}"`. + * @param {boolean} request.recursive + * If this field is true, then the request means to delete a group with all + * its descendants. Otherwise, the request means to delete a group only when + * it has no descendants. The default value is false. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGroup( + request: protosTypes.google.monitoring.v3.IDeleteGroupRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteGroupRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteGroupRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteGroup(request, options, callback); + } + + listGroups( + request: protosTypes.google.monitoring.v3.IListGroupsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup[], + protosTypes.google.monitoring.v3.IListGroupsRequest | null, + protosTypes.google.monitoring.v3.IListGroupsResponse + ] + >; + listGroups( + request: protosTypes.google.monitoring.v3.IListGroupsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IGroup[], + protosTypes.google.monitoring.v3.IListGroupsRequest | null, + protosTypes.google.monitoring.v3.IListGroupsResponse + > + ): void; + /** + * Lists the existing groups. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project whose groups are to be listed. The format is + * `"projects/{project_id_or_number}"`. + * @param {string} request.childrenOfGroup + * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. + * Returns groups whose `parentName` field contains the group + * name. If no groups have this parent, the results are empty. + * @param {string} request.ancestorsOfGroup + * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. + * Returns groups that are ancestors of the specified group. + * The groups are returned in order, starting with the immediate parent and + * ending with the most distant ancestor. If the specified group has no + * immediate parent, the results are empty. + * @param {string} request.descendantsOfGroup + * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. + * Returns the descendants of the specified group. This is a superset of + * the results returned by the `childrenOfGroup` filter, and includes + * children-of-children, and so forth. + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [Group]{@link google.monitoring.v3.Group}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Group]{@link google.monitoring.v3.Group} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGroupsRequest]{@link google.monitoring.v3.ListGroupsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGroupsResponse]{@link google.monitoring.v3.ListGroupsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGroups( + request: protosTypes.google.monitoring.v3.IListGroupsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IGroup[], + protosTypes.google.monitoring.v3.IListGroupsRequest | null, + protosTypes.google.monitoring.v3.IListGroupsResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IGroup[], + protosTypes.google.monitoring.v3.IListGroupsRequest | null, + protosTypes.google.monitoring.v3.IListGroupsResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IGroup[], + protosTypes.google.monitoring.v3.IListGroupsRequest | null, + protosTypes.google.monitoring.v3.IListGroupsResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listGroups(request, options, callback); + } + + /** + * Equivalent to {@link listGroups}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGroups} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project whose groups are to be listed. The format is + * `"projects/{project_id_or_number}"`. + * @param {string} request.childrenOfGroup + * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. + * Returns groups whose `parentName` field contains the group + * name. If no groups have this parent, the results are empty. + * @param {string} request.ancestorsOfGroup + * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. + * Returns groups that are ancestors of the specified group. + * The groups are returned in order, starting with the immediate parent and + * ending with the most distant ancestor. If the specified group has no + * immediate parent, the results are empty. + * @param {string} request.descendantsOfGroup + * A group name: `"projects/{project_id_or_number}/groups/{group_id}"`. + * Returns the descendants of the specified group. This is a superset of + * the results returned by the `childrenOfGroup` filter, and includes + * children-of-children, and so forth. + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [Group]{@link google.monitoring.v3.Group} on 'data' event. + */ + listGroupsStream( + request?: protosTypes.google.monitoring.v3.IListGroupsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listGroups.createStream( + this._innerApiCalls.listGroups as gax.GaxCall, + request, + callSettings + ); + } + listGroupMembers( + request: protosTypes.google.monitoring.v3.IListGroupMembersRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.api.IMonitoredResource[], + protosTypes.google.monitoring.v3.IListGroupMembersRequest | null, + protosTypes.google.monitoring.v3.IListGroupMembersResponse + ] + >; + listGroupMembers( + request: protosTypes.google.monitoring.v3.IListGroupMembersRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.api.IMonitoredResource[], + protosTypes.google.monitoring.v3.IListGroupMembersRequest | null, + protosTypes.google.monitoring.v3.IListGroupMembersResponse + > + ): void; + /** + * Lists the monitored resources that are members of a group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The group whose members are listed. The format is + * `"projects/{project_id_or_number}/groups/{group_id}"`. + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @param {string} request.filter + * An optional [list filter](https://cloud.google.com/monitoring/api/learn_more#filtering) describing + * the members to be returned. The filter may reference the type, labels, and + * metadata of monitored resources that comprise the group. + * For example, to return only resources representing Compute Engine VM + * instances, use this filter: + * + * resource.type = "gce_instance" + * @param {google.monitoring.v3.TimeInterval} request.interval + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * @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 [MonitoredResource]{@link google.api.MonitoredResource}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [MonitoredResource]{@link google.api.MonitoredResource} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGroupMembersRequest]{@link google.monitoring.v3.ListGroupMembersRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGroupMembersResponse]{@link google.monitoring.v3.ListGroupMembersResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGroupMembers( + request: protosTypes.google.monitoring.v3.IListGroupMembersRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.api.IMonitoredResource[], + protosTypes.google.monitoring.v3.IListGroupMembersRequest | null, + protosTypes.google.monitoring.v3.IListGroupMembersResponse + >, + callback?: Callback< + protosTypes.google.api.IMonitoredResource[], + protosTypes.google.monitoring.v3.IListGroupMembersRequest | null, + protosTypes.google.monitoring.v3.IListGroupMembersResponse + > + ): Promise< + [ + protosTypes.google.api.IMonitoredResource[], + protosTypes.google.monitoring.v3.IListGroupMembersRequest | null, + protosTypes.google.monitoring.v3.IListGroupMembersResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listGroupMembers(request, options, callback); + } + + /** + * Equivalent to {@link listGroupMembers}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGroupMembers} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The group whose members are listed. The format is + * `"projects/{project_id_or_number}/groups/{group_id}"`. + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @param {string} request.filter + * An optional [list filter](https://cloud.google.com/monitoring/api/learn_more#filtering) describing + * the members to be returned. The filter may reference the type, labels, and + * metadata of monitored resources that comprise the group. + * For example, to return only resources representing Compute Engine VM + * instances, use this filter: + * + * resource.type = "gce_instance" + * @param {google.monitoring.v3.TimeInterval} request.interval + * An optional time interval for which results should be returned. Only + * members that were part of the group during the specified interval are + * included in the response. If no interval is provided then the group + * membership over the last minute is returned. + * @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 [MonitoredResource]{@link google.api.MonitoredResource} on 'data' event. + */ + listGroupMembersStream( + request?: protosTypes.google.monitoring.v3.IListGroupMembersRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listGroupMembers.createStream( + this._innerApiCalls.listGroupMembers as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAlertPolicy resource name string. + * + * @param {string} folder + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + folderAlertPolicyPath(folder: string, alertPolicy: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.render({ + folder, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the folder from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).folder; + } + + /** + * Parse the alert_policy from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified folderChannelDescriptor resource name string. + * + * @param {string} folder + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + folderChannelDescriptorPath(folder: string, channelDescriptor: string) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.render({ + folder, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the folder from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).folder; + } + + /** + * Parse the channel_descriptor from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified folderGroup resource name string. + * + * @param {string} folder + * @param {string} group + * @returns {string} Resource name string. + */ + folderGroupPath(folder: string, group: string) { + return this._pathTemplates.folderGroupPathTemplate.render({ + folder, + group, + }); + } + + /** + * Parse the folder from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .folder; + } + + /** + * Parse the group from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .group; + } + + /** + * Return a fully-qualified folderNotificationChannel resource name string. + * + * @param {string} folder + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + folderNotificationChannelPath(folder: string, notificationChannel: string) { + return this._pathTemplates.folderNotificationChannelPathTemplate.render({ + folder, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the folder from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).folder; + } + + /** + * Parse the notification_channel from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder, + service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).service; + } + + /** + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * + * @param {string} folder + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + folderServiceServiceLevelObjectivePath( + folder: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render( + { + folder, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the folder from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).folder; + } + + /** + * Parse the service from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified folderUptimeCheckConfig resource name string. + * + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the folder from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).folder; + } + + /** + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Return a fully-qualified organizationAlertPolicy resource name string. + * + * @param {string} organization + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + organizationAlertPolicyPath(organization: string, alertPolicy: string) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.render({ + organization, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the organization from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).organization; + } + + /** + * Parse the alert_policy from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified organizationChannelDescriptor resource name string. + * + * @param {string} organization + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + organizationChannelDescriptorPath( + organization: string, + channelDescriptor: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.render( + { + organization, + channel_descriptor: channelDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).organization; + } + + /** + * Parse the channel_descriptor from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified organizationGroup resource name string. + * + * @param {string} organization + * @param {string} group + * @returns {string} Resource name string. + */ + organizationGroupPath(organization: string, group: string) { + return this._pathTemplates.organizationGroupPathTemplate.render({ + organization, + group, + }); + } + + /** + * Parse the organization from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).organization; + } + + /** + * Parse the group from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).group; + } + + /** + * Return a fully-qualified organizationNotificationChannel resource name string. + * + * @param {string} organization + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + organizationNotificationChannelPath( + organization: string, + notificationChannel: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.render( + { + organization, + notification_channel: notificationChannel, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).organization; + } + + /** + * Parse the notification_channel from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization, + service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified organizationServiceServiceLevelObjective resource name string. + * + * @param {string} organization + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + organizationServiceServiceLevelObjectivePath( + organization: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render( + { + organization, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the organization from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).organization; + } + + /** + * Parse the service from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * + * @param {string} organization + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + organizationUptimeCheckConfigPath( + organization: string, + uptimeCheckConfig: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render( + { + organization, + uptime_check_config: uptimeCheckConfig, + } + ); + } + + /** + * Parse the organization from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).organization; + } + + /** + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * 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, + }); + } + + /** + * 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 projectAlertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + projectAlertPolicyPath(project: string, alertPolicy: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.render({ + project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).project; + } + + /** + * Parse the alert_policy from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified projectChannelDescriptor resource name string. + * + * @param {string} project + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + projectChannelDescriptorPath(project: string, channelDescriptor: string) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.render({ + project, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the project from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).project; + } + + /** + * Parse the channel_descriptor from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified projectGroup resource name string. + * + * @param {string} project + * @param {string} group + * @returns {string} Resource name string. + */ + projectGroupPath(project: string, group: string) { + return this._pathTemplates.projectGroupPathTemplate.render({ + project, + group, + }); + } + + /** + * Parse the project from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .project; + } + + /** + * Parse the group from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .group; + } + + /** + * Return a fully-qualified projectNotificationChannel resource name string. + * + * @param {string} project + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + projectNotificationChannelPath(project: string, notificationChannel: string) { + return this._pathTemplates.projectNotificationChannelPathTemplate.render({ + project, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the project from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).project; + } + + /** + * Parse the notification_channel from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this._pathTemplates.projectServicePathTemplate.render({ + project, + service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } + + /** + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * + * @param {string} project + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + projectServiceServiceLevelObjectivePath( + project: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render( + { + project, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the project from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).project; + } + + /** + * Parse the service from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the project from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).project; + } + + /** + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.groupServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3/group_service_client_config.json b/src/v3/group_service_client_config.json index a57878c2..72f178cb 100644 --- a/src/v3/group_service_client_config.json +++ b/src/v3/group_service_client_config.json @@ -2,53 +2,62 @@ "interfaces": { "google.monitoring.v3.GroupService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ListGroups": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "DeleteGroup": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListGroupMembers": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" } } } diff --git a/src/v3/group_service_proto_list.json b/src/v3/group_service_proto_list.json index 589717a4..0534dc6a 100644 --- a/src/v3/group_service_proto_list.json +++ b/src/v3/group_service_proto_list.json @@ -1,3 +1,18 @@ [ - "../../protos/google/monitoring/v3/group_service.proto" + "../../protos/google/monitoring/v3/alert.proto", + "../../protos/google/monitoring/v3/alert_service.proto", + "../../protos/google/monitoring/v3/common.proto", + "../../protos/google/monitoring/v3/dropped_labels.proto", + "../../protos/google/monitoring/v3/group.proto", + "../../protos/google/monitoring/v3/group_service.proto", + "../../protos/google/monitoring/v3/metric.proto", + "../../protos/google/monitoring/v3/metric_service.proto", + "../../protos/google/monitoring/v3/mutation_record.proto", + "../../protos/google/monitoring/v3/notification.proto", + "../../protos/google/monitoring/v3/notification_service.proto", + "../../protos/google/monitoring/v3/service.proto", + "../../protos/google/monitoring/v3/service_service.proto", + "../../protos/google/monitoring/v3/span_context.proto", + "../../protos/google/monitoring/v3/uptime.proto", + "../../protos/google/monitoring/v3/uptime_service.proto" ] diff --git a/src/v3/index.js b/src/v3/index.js deleted file mode 100644 index e93937c9..00000000 --- a/src/v3/index.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const AlertPolicyServiceClient = require('./alert_policy_service_client'); -const GroupServiceClient = require('./group_service_client'); -const MetricServiceClient = require('./metric_service_client'); -const NotificationChannelServiceClient = require('./notification_channel_service_client'); -const ServiceMonitoringServiceClient = require('./service_monitoring_service_client'); -const UptimeCheckServiceClient = require('./uptime_check_service_client'); - -module.exports.AlertPolicyServiceClient = AlertPolicyServiceClient; -module.exports.GroupServiceClient = GroupServiceClient; -module.exports.MetricServiceClient = MetricServiceClient; -module.exports.NotificationChannelServiceClient = NotificationChannelServiceClient; -module.exports.ServiceMonitoringServiceClient = ServiceMonitoringServiceClient; -module.exports.UptimeCheckServiceClient = UptimeCheckServiceClient; diff --git a/src/v3/index.ts b/src/v3/index.ts new file mode 100644 index 00000000..137839b9 --- /dev/null +++ b/src/v3/index.ts @@ -0,0 +1,24 @@ +// Copyright 2019 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 {AlertPolicyServiceClient} from './alert_policy_service_client'; +export {GroupServiceClient} from './group_service_client'; +export {MetricServiceClient} from './metric_service_client'; +export {NotificationChannelServiceClient} from './notification_channel_service_client'; +export {ServiceMonitoringServiceClient} from './service_monitoring_service_client'; +export {UptimeCheckServiceClient} from './uptime_check_service_client'; diff --git a/src/v3/metric_service_client.js b/src/v3/metric_service_client.js deleted file mode 100644 index d6e8cfce..00000000 --- a/src/v3/metric_service_client.js +++ /dev/null @@ -1,1282 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./metric_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * Manages metric descriptors, monitored resource descriptors, and - * time series data. - * - * @class - * @memberof v3 - */ -class MetricServiceClient { - /** - * Construct an instance of MetricServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - metricDescriptorPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/metricDescriptors/{metric_descriptor=**}' - ), - monitoredResourceDescriptorPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - // 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 = { - listMonitoredResourceDescriptors: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'resourceDescriptors' - ), - listMetricDescriptors: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'metricDescriptors' - ), - listTimeSeries: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'timeSeries' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.monitoring.v3.MetricService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.monitoring.v3.MetricService. - const metricServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.monitoring.v3.MetricService') - : protos.google.monitoring.v3.MetricService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const metricServiceStubMethods = [ - 'listMonitoredResourceDescriptors', - 'getMonitoredResourceDescriptor', - 'listMetricDescriptors', - 'getMetricDescriptor', - 'createMetricDescriptor', - 'deleteMetricDescriptor', - 'listTimeSeries', - 'createTimeSeries', - ]; - for (const methodName of metricServiceStubMethods) { - const innerCallPromise = metricServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'monitoring.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'monitoring.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param {string} [request.filter] - * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) describing - * the descriptors to be returned. The filter can reference - * the descriptor's type and labels. For example, the - * following filter returns only Google Compute Engine descriptors - * that have an `id` label: - * - * resource.type = starts_with("gce_") AND resource.label:id - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListMonitoredResourceDescriptorsResponse]{@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListMonitoredResourceDescriptorsResponse]{@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * - * client.listMonitoredResourceDescriptors({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listMonitoredResourceDescriptors(nextRequest, options).then(callback); - * } - * } - * client.listMonitoredResourceDescriptors({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listMonitoredResourceDescriptors(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listMonitoredResourceDescriptors( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listMonitoredResourceDescriptors}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listMonitoredResourceDescriptors} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param {string} [request.filter] - * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) describing - * the descriptors to be returned. The filter can reference - * the descriptor's type and labels. For example, the - * following filter returns only Google Compute Engine descriptors - * that have an `id` label: - * - * resource.type = starts_with("gce_") AND resource.label:id - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * client.listMonitoredResourceDescriptorsStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listMonitoredResourceDescriptorsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listMonitoredResourceDescriptors.createStream( - this._innerApiCalls.listMonitoredResourceDescriptors, - request, - options - ); - } - - /** - * Gets a single monitored resource descriptor. This method does not require a Stackdriver account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The monitored resource descriptor to get. The format is - * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. - * The `{resource_type}` is a predefined type, such as - * `cloudsql_database`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.monitoredResourceDescriptorPath('[PROJECT]', '[MONITORED_RESOURCE_DESCRIPTOR]'); - * client.getMonitoredResourceDescriptor({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getMonitoredResourceDescriptor(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getMonitoredResourceDescriptor( - request, - options, - callback - ); - } - - /** - * Lists metric descriptors that match a filter. This method does not require a Stackdriver account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param {string} [request.filter] - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * - * metric.type = starts_with("custom.googleapis.com/") - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [MetricDescriptor]{@link google.api.MetricDescriptor}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListMetricDescriptorsResponse]{@link google.monitoring.v3.ListMetricDescriptorsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [MetricDescriptor]{@link google.api.MetricDescriptor}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [MetricDescriptor]{@link google.api.MetricDescriptor} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListMetricDescriptorsResponse]{@link google.monitoring.v3.ListMetricDescriptorsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * - * client.listMetricDescriptors({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listMetricDescriptors(nextRequest, options).then(callback); - * } - * } - * client.listMetricDescriptors({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listMetricDescriptors(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listMetricDescriptors( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listMetricDescriptors}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listMetricDescriptors} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param {string} [request.filter] - * If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): - * - * metric.type = starts_with("custom.googleapis.com/") - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [MetricDescriptor]{@link google.api.MetricDescriptor} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * client.listMetricDescriptorsStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listMetricDescriptorsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listMetricDescriptors.createStream( - this._innerApiCalls.listMetricDescriptors, - request, - options - ); - } - - /** - * Gets a single metric descriptor. This method does not require a Stackdriver account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The metric descriptor on which to execute the request. The format is - * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example value of `{metric_id}` is - * `"compute.googleapis.com/instance/disk/read_bytes_count"`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [MetricDescriptor]{@link google.api.MetricDescriptor}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetricDescriptor]{@link google.api.MetricDescriptor}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.metricDescriptorPath('[PROJECT]', '[METRIC_DESCRIPTOR]'); - * client.getMetricDescriptor({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getMetricDescriptor(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getMetricDescriptor(request, options, callback); - } - - /** - * Creates a new metric descriptor. - * User-created metric descriptors define - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param {Object} request.metricDescriptor - * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) - * descriptor. - * - * This object should have the same structure as [MetricDescriptor]{@link google.api.MetricDescriptor} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [MetricDescriptor]{@link google.api.MetricDescriptor}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MetricDescriptor]{@link google.api.MetricDescriptor}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * const metricDescriptor = {}; - * const request = { - * name: formattedName, - * metricDescriptor: metricDescriptor, - * }; - * client.createMetricDescriptor(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createMetricDescriptor(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createMetricDescriptor( - request, - options, - callback - ); - } - - /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The metric descriptor on which to execute the request. The format is - * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example of `{metric_id}` is: - * `"custom.googleapis.com/my_test_metric"`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.metricDescriptorPath('[PROJECT]', '[METRIC_DESCRIPTOR]'); - * client.deleteMetricDescriptor({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteMetricDescriptor(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteMetricDescriptor( - request, - options, - callback - ); - } - - /** - * Lists time series that match a filter. This method does not require a Stackdriver account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * "projects/{project_id_or_number}". - * @param {string} request.filter - * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time - * series should be returned. The filter must specify a single metric type, - * and can additionally specify metric labels and other information. For - * example: - * - * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND - * metric.labels.instance_name = "my-instance-name" - * @param {Object} request.interval - * Required. The time interval for which results should be returned. Only time series - * that contain data points in the specified interval are included - * in the response. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * @param {number} request.view - * Required. Specifies which information is returned about the time series. - * - * The number should be among the values of [TimeSeriesView]{@link google.monitoring.v3.TimeSeriesView} - * @param {Object} [request.aggregation] - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series across specified labels. - * - * By default (if no `aggregation` is explicitly specified), the raw time - * series data is returned. - * - * This object should have the same structure as [Aggregation]{@link google.monitoring.v3.Aggregation} - * @param {string} [request.orderBy] - * Unsupported: must be left blank. The points in each time series are - * currently returned in reverse time order (most recent to oldest). - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [TimeSeries]{@link google.monitoring.v3.TimeSeries}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListTimeSeriesResponse]{@link google.monitoring.v3.ListTimeSeriesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [TimeSeries]{@link google.monitoring.v3.TimeSeries}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [TimeSeries]{@link google.monitoring.v3.TimeSeries} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListTimeSeriesResponse]{@link google.monitoring.v3.ListTimeSeriesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * const filter = ''; - * const interval = {}; - * const view = 'FULL'; - * const request = { - * name: formattedName, - * filter: filter, - * interval: interval, - * view: view, - * }; - * - * client.listTimeSeries(request) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * const filter = ''; - * const interval = {}; - * const view = 'FULL'; - * const request = { - * name: formattedName, - * filter: filter, - * interval: interval, - * view: view, - * }; - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listTimeSeries(nextRequest, options).then(callback); - * } - * } - * client.listTimeSeries(request, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listTimeSeries(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listTimeSeries(request, options, callback); - } - - /** - * Equivalent to {@link listTimeSeries}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listTimeSeries} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * "projects/{project_id_or_number}". - * @param {string} request.filter - * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time - * series should be returned. The filter must specify a single metric type, - * and can additionally specify metric labels and other information. For - * example: - * - * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND - * metric.labels.instance_name = "my-instance-name" - * @param {Object} request.interval - * Required. The time interval for which results should be returned. Only time series - * that contain data points in the specified interval are included - * in the response. - * - * This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval} - * @param {number} request.view - * Required. Specifies which information is returned about the time series. - * - * The number should be among the values of [TimeSeriesView]{@link google.monitoring.v3.TimeSeriesView} - * @param {Object} [request.aggregation] - * Specifies the alignment of data points in individual time series as - * well as how to combine the retrieved time series across specified labels. - * - * By default (if no `aggregation` is explicitly specified), the raw time - * series data is returned. - * - * This object should have the same structure as [Aggregation]{@link google.monitoring.v3.Aggregation} - * @param {string} [request.orderBy] - * Unsupported: must be left blank. The points in each time series are - * currently returned in reverse time order (most recent to oldest). - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [TimeSeries]{@link google.monitoring.v3.TimeSeries} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * const filter = ''; - * const interval = {}; - * const view = 'FULL'; - * const request = { - * name: formattedName, - * filter: filter, - * interval: interval, - * view: view, - * }; - * client.listTimeSeriesStream(request) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listTimeSeriesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listTimeSeries.createStream( - this._innerApiCalls.listTimeSeries, - request, - options - ); - } - - /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param {Object[]} request.timeSeries - * Required. The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. - * - * The maximum number of `TimeSeries` objects per `Create` request is 200. - * - * This object should have the same structure as [TimeSeries]{@link google.monitoring.v3.TimeSeries} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.MetricServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * const timeSeries = []; - * const request = { - * name: formattedName, - * timeSeries: timeSeries, - * }; - * client.createTimeSeries(request).catch(err => { - * console.error(err); - * }); - */ - createTimeSeries(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createTimeSeries(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified metric_descriptor resource name string. - * - * @param {String} project - * @param {String} metricDescriptor - * @returns {String} - */ - metricDescriptorPath(project, metricDescriptor) { - return this._pathTemplates.metricDescriptorPathTemplate.render({ - project: project, - metric_descriptor: metricDescriptor, - }); - } - - /** - * Return a fully-qualified monitored_resource_descriptor resource name string. - * - * @param {String} project - * @param {String} monitoredResourceDescriptor - * @returns {String} - */ - monitoredResourceDescriptorPath(project, monitoredResourceDescriptor) { - return this._pathTemplates.monitoredResourceDescriptorPathTemplate.render({ - project: project, - monitored_resource_descriptor: monitoredResourceDescriptor, - }); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the metricDescriptorName from a metric_descriptor resource. - * - * @param {String} metricDescriptorName - * A fully-qualified path representing a metric_descriptor resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromMetricDescriptorName(metricDescriptorName) { - return this._pathTemplates.metricDescriptorPathTemplate.match( - metricDescriptorName - ).project; - } - - /** - * Parse the metricDescriptorName from a metric_descriptor resource. - * - * @param {String} metricDescriptorName - * A fully-qualified path representing a metric_descriptor resources. - * @returns {String} - A string representing the metric_descriptor. - */ - matchMetricDescriptorFromMetricDescriptorName(metricDescriptorName) { - return this._pathTemplates.metricDescriptorPathTemplate.match( - metricDescriptorName - ).metric_descriptor; - } - - /** - * Parse the monitoredResourceDescriptorName from a monitored_resource_descriptor resource. - * - * @param {String} monitoredResourceDescriptorName - * A fully-qualified path representing a monitored_resource_descriptor resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromMonitoredResourceDescriptorName( - monitoredResourceDescriptorName - ) { - return this._pathTemplates.monitoredResourceDescriptorPathTemplate.match( - monitoredResourceDescriptorName - ).project; - } - - /** - * Parse the monitoredResourceDescriptorName from a monitored_resource_descriptor resource. - * - * @param {String} monitoredResourceDescriptorName - * A fully-qualified path representing a monitored_resource_descriptor resources. - * @returns {String} - A string representing the monitored_resource_descriptor. - */ - matchMonitoredResourceDescriptorFromMonitoredResourceDescriptorName( - monitoredResourceDescriptorName - ) { - return this._pathTemplates.monitoredResourceDescriptorPathTemplate.match( - monitoredResourceDescriptorName - ).monitored_resource_descriptor; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = MetricServiceClient; diff --git a/src/v3/metric_service_client.ts b/src/v3/metric_service_client.ts new file mode 100644 index 00000000..91c509b3 --- /dev/null +++ b/src/v3/metric_service_client.ts @@ -0,0 +1,2612 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './metric_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Manages metric descriptors, monitored resource descriptors, and + * time series data. + * @class + * @memberof v3 + */ +export class MetricServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + metricServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MetricServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof MetricServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof MetricServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + folderAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/alertPolicies/{alert_policy}' + ), + folderChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannelDescriptors/{channel_descriptor}' + ), + folderGroupPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/groups/{group}' + ), + folderMetricDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/metricDescriptors/{metric_descriptor=**}' + ), + folderMonitoredResourceDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), + folderNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannels/{notification_channel}' + ), + folderServicePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}' + ), + organizationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), + organizationGroupPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/groups/{group}' + ), + organizationMetricDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/metricDescriptors/{metric_descriptor=**}' + ), + organizationMonitoredResourceDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), + organizationNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + projectChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' + ), + projectGroupPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/groups/{group}' + ), + projectMetricDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/metricDescriptors/{metric_descriptor=**}' + ), + projectMonitoredResourceDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}' + ), + projectNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannels/{notification_channel}' + ), + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' + ), + }; + + // 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 = { + listMonitoredResourceDescriptors: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'resourceDescriptors' + ), + listMetricDescriptors: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'metricDescriptors' + ), + listTimeSeries: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'timeSeries' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.MetricService', + 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 = {}; + + // Put together the "service stub" for + // google.monitoring.v3.MetricService. + this.metricServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.monitoring.v3.MetricService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.monitoring.v3.MetricService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const metricServiceStubMethods = [ + 'listMonitoredResourceDescriptors', + 'getMonitoredResourceDescriptor', + 'listMetricDescriptors', + 'getMetricDescriptor', + 'createMetricDescriptor', + 'deleteMetricDescriptor', + 'listTimeSeries', + 'createTimeSeries', + ]; + + for (const methodName of metricServiceStubMethods) { + const innerCallPromise = this.metricServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getMonitoredResourceDescriptor( + request: protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.api.IMonitoredResourceDescriptor, + ( + | protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest + | undefined + ), + {} | undefined + ] + >; + getMonitoredResourceDescriptor( + request: protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.api.IMonitoredResourceDescriptor, + | protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a single monitored resource descriptor. This method does not require a Stackdriver account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The monitored resource descriptor to get. The format is + * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. + * The `{resource_type}` is a predefined type, such as + * `cloudsql_database`. + * @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 [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getMonitoredResourceDescriptor( + request: protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.api.IMonitoredResourceDescriptor, + | protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.api.IMonitoredResourceDescriptor, + | protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.api.IMonitoredResourceDescriptor, + ( + | protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getMonitoredResourceDescriptor( + request, + options, + callback + ); + } + getMetricDescriptor( + request: protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.api.IMetricDescriptor, + protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest | undefined, + {} | undefined + ] + >; + getMetricDescriptor( + request: protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.api.IMetricDescriptor, + protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a single metric descriptor. This method does not require a Stackdriver account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The metric descriptor on which to execute the request. The format is + * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. + * An example value of `{metric_id}` is + * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * @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 [MetricDescriptor]{@link google.api.MetricDescriptor}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getMetricDescriptor( + request: protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.api.IMetricDescriptor, + | protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.api.IMetricDescriptor, + protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.api.IMetricDescriptor, + protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getMetricDescriptor(request, options, callback); + } + createMetricDescriptor( + request: protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.api.IMetricDescriptor, + ( + | protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest + | undefined + ), + {} | undefined + ] + >; + createMetricDescriptor( + request: protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.api.IMetricDescriptor, + | protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new metric descriptor. + * User-created metric descriptors define + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. + * @param {google.api.MetricDescriptor} request.metricDescriptor + * Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) + * descriptor. + * @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 [MetricDescriptor]{@link google.api.MetricDescriptor}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createMetricDescriptor( + request: protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.api.IMetricDescriptor, + | protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.api.IMetricDescriptor, + | protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.api.IMetricDescriptor, + ( + | protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.createMetricDescriptor( + request, + options, + callback + ); + } + deleteMetricDescriptor( + request: protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest + | undefined + ), + {} | undefined + ] + >; + deleteMetricDescriptor( + request: protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes a metric descriptor. Only user-created + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The metric descriptor on which to execute the request. The format is + * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. + * An example of `{metric_id}` is: + * `"custom.googleapis.com/my_test_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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteMetricDescriptor( + request: protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteMetricDescriptor( + request, + options, + callback + ); + } + createTimeSeries( + request: protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, + {} | undefined + ] + >; + createTimeSeries( + request: protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, + {} | undefined + > + ): void; + /** + * Creates or adds data to one or more time series. + * The response is empty if all time series in the request were written. + * If any time series could not be written, a corresponding failure message is + * included in the error response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. + * @param {number[]} request.timeSeries + * Required. The new data to be added to a list of time series. + * Adds at most one data point to each of several time series. The new data + * point must be more recent than any other point in its time series. Each + * `TimeSeries` value must fully specify a unique time series by supplying + * all label values for the metric and the monitored resource. + * + * The maximum number of `TimeSeries` objects per `Create` request is 200. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createTimeSeries( + request: protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.createTimeSeries(request, options, callback); + } + + listMonitoredResourceDescriptors( + request: protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.api.IMonitoredResourceDescriptor[], + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse + ] + >; + listMonitoredResourceDescriptors( + request: protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.api.IMonitoredResourceDescriptor[], + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse + > + ): void; + /** + * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. + * @param {string} request.filter + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) describing + * the descriptors to be returned. The filter can reference + * the descriptor's type and labels. For example, the + * following filter returns only Google Compute Engine descriptors + * that have an `id` label: + * + * resource.type = starts_with("gce_") AND resource.label:id + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListMonitoredResourceDescriptorsRequest]{@link google.monitoring.v3.ListMonitoredResourceDescriptorsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListMonitoredResourceDescriptorsResponse]{@link google.monitoring.v3.ListMonitoredResourceDescriptorsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listMonitoredResourceDescriptors( + request: protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.api.IMonitoredResourceDescriptor[], + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse + >, + callback?: Callback< + protosTypes.google.api.IMonitoredResourceDescriptor[], + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse + > + ): Promise< + [ + protosTypes.google.api.IMonitoredResourceDescriptor[], + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listMonitoredResourceDescriptors( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listMonitoredResourceDescriptors}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listMonitoredResourceDescriptors} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. + * @param {string} request.filter + * An optional [filter](https://cloud.google.com/monitoring/api/v3/filters) describing + * the descriptors to be returned. The filter can reference + * the descriptor's type and labels. For example, the + * following filter returns only Google Compute Engine descriptors + * that have an `id` label: + * + * resource.type = starts_with("gce_") AND resource.label:id + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [MonitoredResourceDescriptor]{@link google.api.MonitoredResourceDescriptor} on 'data' event. + */ + listMonitoredResourceDescriptorsStream( + request?: protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listMonitoredResourceDescriptors.createStream( + this._innerApiCalls.listMonitoredResourceDescriptors as gax.GaxCall, + request, + callSettings + ); + } + listMetricDescriptors( + request: protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.api.IMetricDescriptor[], + protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMetricDescriptorsResponse + ] + >; + listMetricDescriptors( + request: protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.api.IMetricDescriptor[], + protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMetricDescriptorsResponse + > + ): void; + /** + * Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. + * @param {string} request.filter + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * + * metric.type = starts_with("custom.googleapis.com/") + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [MetricDescriptor]{@link google.api.MetricDescriptor}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [MetricDescriptor]{@link google.api.MetricDescriptor} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListMetricDescriptorsRequest]{@link google.monitoring.v3.ListMetricDescriptorsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListMetricDescriptorsResponse]{@link google.monitoring.v3.ListMetricDescriptorsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listMetricDescriptors( + request: protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.api.IMetricDescriptor[], + protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMetricDescriptorsResponse + >, + callback?: Callback< + protosTypes.google.api.IMetricDescriptor[], + protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMetricDescriptorsResponse + > + ): Promise< + [ + protosTypes.google.api.IMetricDescriptor[], + protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListMetricDescriptorsResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listMetricDescriptors( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listMetricDescriptors}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listMetricDescriptors} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. + * @param {string} request.filter + * If this field is empty, all custom and + * system-defined metric descriptors are returned. + * Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters) + * specifies which metric descriptors are to be + * returned. For example, the following filter matches all + * [custom metrics](https://cloud.google.com/monitoring/custom-metrics): + * + * metric.type = starts_with("custom.googleapis.com/") + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [MetricDescriptor]{@link google.api.MetricDescriptor} on 'data' event. + */ + listMetricDescriptorsStream( + request?: protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listMetricDescriptors.createStream( + this._innerApiCalls.listMetricDescriptors as gax.GaxCall, + request, + callSettings + ); + } + listTimeSeries( + request: protosTypes.google.monitoring.v3.IListTimeSeriesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.ITimeSeries[], + protosTypes.google.monitoring.v3.IListTimeSeriesRequest | null, + protosTypes.google.monitoring.v3.IListTimeSeriesResponse + ] + >; + listTimeSeries( + request: protosTypes.google.monitoring.v3.IListTimeSeriesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.ITimeSeries[], + protosTypes.google.monitoring.v3.IListTimeSeriesRequest | null, + protosTypes.google.monitoring.v3.IListTimeSeriesResponse + > + ): void; + /** + * Lists time series that match a filter. This method does not require a Stackdriver account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * "projects/{project_id_or_number}". + * @param {string} request.filter + * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time + * series should be returned. The filter must specify a single metric type, + * and can additionally specify metric labels and other information. For + * example: + * + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * @param {google.monitoring.v3.TimeInterval} request.interval + * Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * @param {google.monitoring.v3.Aggregation} request.aggregation + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * @param {string} request.orderBy + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * @param {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} request.view + * Required. Specifies which information is returned about the time series. + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. If + * `page_size` is empty or more than 100,000 results, the effective + * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the + * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is + * the maximum number of `TimeSeries` returned. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [TimeSeries]{@link google.monitoring.v3.TimeSeries}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [TimeSeries]{@link google.monitoring.v3.TimeSeries} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListTimeSeriesRequest]{@link google.monitoring.v3.ListTimeSeriesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListTimeSeriesResponse]{@link google.monitoring.v3.ListTimeSeriesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listTimeSeries( + request: protosTypes.google.monitoring.v3.IListTimeSeriesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.ITimeSeries[], + protosTypes.google.monitoring.v3.IListTimeSeriesRequest | null, + protosTypes.google.monitoring.v3.IListTimeSeriesResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.ITimeSeries[], + protosTypes.google.monitoring.v3.IListTimeSeriesRequest | null, + protosTypes.google.monitoring.v3.IListTimeSeriesResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.ITimeSeries[], + protosTypes.google.monitoring.v3.IListTimeSeriesRequest | null, + protosTypes.google.monitoring.v3.IListTimeSeriesResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listTimeSeries(request, options, callback); + } + + /** + * Equivalent to {@link listTimeSeries}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTimeSeries} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * "projects/{project_id_or_number}". + * @param {string} request.filter + * Required. A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies which time + * series should be returned. The filter must specify a single metric type, + * and can additionally specify metric labels and other information. For + * example: + * + * metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND + * metric.labels.instance_name = "my-instance-name" + * @param {google.monitoring.v3.TimeInterval} request.interval + * Required. The time interval for which results should be returned. Only time series + * that contain data points in the specified interval are included + * in the response. + * @param {google.monitoring.v3.Aggregation} request.aggregation + * Specifies the alignment of data points in individual time series as + * well as how to combine the retrieved time series across specified labels. + * + * By default (if no `aggregation` is explicitly specified), the raw time + * series data is returned. + * @param {string} request.orderBy + * Unsupported: must be left blank. The points in each time series are + * currently returned in reverse time order (most recent to oldest). + * @param {google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView} request.view + * Required. Specifies which information is returned about the time series. + * @param {number} request.pageSize + * A positive number that is the maximum number of results to return. If + * `page_size` is empty or more than 100,000 results, the effective + * `page_size` is 100,000 results. If `view` is set to `FULL`, this is the + * maximum number of `Points` returned. If `view` is set to `HEADERS`, this is + * the maximum number of `TimeSeries` returned. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [TimeSeries]{@link google.monitoring.v3.TimeSeries} on 'data' event. + */ + listTimeSeriesStream( + request?: protosTypes.google.monitoring.v3.IListTimeSeriesRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listTimeSeries.createStream( + this._innerApiCalls.listTimeSeries as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAlertPolicy resource name string. + * + * @param {string} folder + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + folderAlertPolicyPath(folder: string, alertPolicy: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.render({ + folder, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the folder from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).folder; + } + + /** + * Parse the alert_policy from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified folderChannelDescriptor resource name string. + * + * @param {string} folder + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + folderChannelDescriptorPath(folder: string, channelDescriptor: string) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.render({ + folder, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the folder from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).folder; + } + + /** + * Parse the channel_descriptor from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified folderGroup resource name string. + * + * @param {string} folder + * @param {string} group + * @returns {string} Resource name string. + */ + folderGroupPath(folder: string, group: string) { + return this._pathTemplates.folderGroupPathTemplate.render({ + folder, + group, + }); + } + + /** + * Parse the folder from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .folder; + } + + /** + * Parse the group from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .group; + } + + /** + * Return a fully-qualified folderMetricDescriptor resource name string. + * + * @param {string} folder + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + folderMetricDescriptorPath(folder: string, metricDescriptor: string) { + return this._pathTemplates.folderMetricDescriptorPathTemplate.render({ + folder, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the folder from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMetricDescriptorName( + folderMetricDescriptorName: string + ) { + return this._pathTemplates.folderMetricDescriptorPathTemplate.match( + folderMetricDescriptorName + ).folder; + } + + /** + * Parse the metric_descriptor from FolderMetricDescriptor resource. + * + * @param {string} folderMetricDescriptorName + * A fully-qualified path representing folder_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromFolderMetricDescriptorName( + folderMetricDescriptorName: string + ) { + return this._pathTemplates.folderMetricDescriptorPathTemplate.match( + folderMetricDescriptorName + ).metric_descriptor; + } + + /** + * Return a fully-qualified folderMonitoredResourceDescriptor resource name string. + * + * @param {string} folder + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + folderMonitoredResourceDescriptorPath( + folder: string, + monitoredResourceDescriptor: string + ) { + return this._pathTemplates.folderMonitoredResourceDescriptorPathTemplate.render( + { + folder, + monitored_resource_descriptor: monitoredResourceDescriptor, + } + ); + } + + /** + * Parse the folder from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderMonitoredResourceDescriptorName( + folderMonitoredResourceDescriptorName: string + ) { + return this._pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match( + folderMonitoredResourceDescriptorName + ).folder; + } + + /** + * Parse the monitored_resource_descriptor from FolderMonitoredResourceDescriptor resource. + * + * @param {string} folderMonitoredResourceDescriptorName + * A fully-qualified path representing folder_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromFolderMonitoredResourceDescriptorName( + folderMonitoredResourceDescriptorName: string + ) { + return this._pathTemplates.folderMonitoredResourceDescriptorPathTemplate.match( + folderMonitoredResourceDescriptorName + ).monitored_resource_descriptor; + } + + /** + * Return a fully-qualified folderNotificationChannel resource name string. + * + * @param {string} folder + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + folderNotificationChannelPath(folder: string, notificationChannel: string) { + return this._pathTemplates.folderNotificationChannelPathTemplate.render({ + folder, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the folder from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).folder; + } + + /** + * Parse the notification_channel from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder, + service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).service; + } + + /** + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * + * @param {string} folder + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + folderServiceServiceLevelObjectivePath( + folder: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render( + { + folder, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the folder from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).folder; + } + + /** + * Parse the service from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified folderUptimeCheckConfig resource name string. + * + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the folder from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).folder; + } + + /** + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Return a fully-qualified organizationAlertPolicy resource name string. + * + * @param {string} organization + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + organizationAlertPolicyPath(organization: string, alertPolicy: string) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.render({ + organization, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the organization from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).organization; + } + + /** + * Parse the alert_policy from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified organizationChannelDescriptor resource name string. + * + * @param {string} organization + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + organizationChannelDescriptorPath( + organization: string, + channelDescriptor: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.render( + { + organization, + channel_descriptor: channelDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).organization; + } + + /** + * Parse the channel_descriptor from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified organizationGroup resource name string. + * + * @param {string} organization + * @param {string} group + * @returns {string} Resource name string. + */ + organizationGroupPath(organization: string, group: string) { + return this._pathTemplates.organizationGroupPathTemplate.render({ + organization, + group, + }); + } + + /** + * Parse the organization from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).organization; + } + + /** + * Parse the group from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).group; + } + + /** + * Return a fully-qualified organizationMetricDescriptor resource name string. + * + * @param {string} organization + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + organizationMetricDescriptorPath( + organization: string, + metricDescriptor: string + ) { + return this._pathTemplates.organizationMetricDescriptorPathTemplate.render({ + organization, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the organization from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMetricDescriptorName( + organizationMetricDescriptorName: string + ) { + return this._pathTemplates.organizationMetricDescriptorPathTemplate.match( + organizationMetricDescriptorName + ).organization; + } + + /** + * Parse the metric_descriptor from OrganizationMetricDescriptor resource. + * + * @param {string} organizationMetricDescriptorName + * A fully-qualified path representing organization_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromOrganizationMetricDescriptorName( + organizationMetricDescriptorName: string + ) { + return this._pathTemplates.organizationMetricDescriptorPathTemplate.match( + organizationMetricDescriptorName + ).metric_descriptor; + } + + /** + * Return a fully-qualified organizationMonitoredResourceDescriptor resource name string. + * + * @param {string} organization + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + organizationMonitoredResourceDescriptorPath( + organization: string, + monitoredResourceDescriptor: string + ) { + return this._pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.render( + { + organization, + monitored_resource_descriptor: monitoredResourceDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationMonitoredResourceDescriptorName( + organizationMonitoredResourceDescriptorName: string + ) { + return this._pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match( + organizationMonitoredResourceDescriptorName + ).organization; + } + + /** + * Parse the monitored_resource_descriptor from OrganizationMonitoredResourceDescriptor resource. + * + * @param {string} organizationMonitoredResourceDescriptorName + * A fully-qualified path representing organization_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromOrganizationMonitoredResourceDescriptorName( + organizationMonitoredResourceDescriptorName: string + ) { + return this._pathTemplates.organizationMonitoredResourceDescriptorPathTemplate.match( + organizationMonitoredResourceDescriptorName + ).monitored_resource_descriptor; + } + + /** + * Return a fully-qualified organizationNotificationChannel resource name string. + * + * @param {string} organization + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + organizationNotificationChannelPath( + organization: string, + notificationChannel: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.render( + { + organization, + notification_channel: notificationChannel, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).organization; + } + + /** + * Parse the notification_channel from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization, + service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified organizationServiceServiceLevelObjective resource name string. + * + * @param {string} organization + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + organizationServiceServiceLevelObjectivePath( + organization: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render( + { + organization, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the organization from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).organization; + } + + /** + * Parse the service from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * + * @param {string} organization + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + organizationUptimeCheckConfigPath( + organization: string, + uptimeCheckConfig: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render( + { + organization, + uptime_check_config: uptimeCheckConfig, + } + ); + } + + /** + * Parse the organization from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).organization; + } + + /** + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * 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, + }); + } + + /** + * 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 projectAlertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + projectAlertPolicyPath(project: string, alertPolicy: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.render({ + project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).project; + } + + /** + * Parse the alert_policy from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified projectChannelDescriptor resource name string. + * + * @param {string} project + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + projectChannelDescriptorPath(project: string, channelDescriptor: string) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.render({ + project, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the project from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).project; + } + + /** + * Parse the channel_descriptor from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified projectGroup resource name string. + * + * @param {string} project + * @param {string} group + * @returns {string} Resource name string. + */ + projectGroupPath(project: string, group: string) { + return this._pathTemplates.projectGroupPathTemplate.render({ + project, + group, + }); + } + + /** + * Parse the project from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .project; + } + + /** + * Parse the group from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .group; + } + + /** + * Return a fully-qualified projectMetricDescriptor resource name string. + * + * @param {string} project + * @param {string} metric_descriptor + * @returns {string} Resource name string. + */ + projectMetricDescriptorPath(project: string, metricDescriptor: string) { + return this._pathTemplates.projectMetricDescriptorPathTemplate.render({ + project, + metric_descriptor: metricDescriptor, + }); + } + + /** + * Parse the project from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMetricDescriptorName( + projectMetricDescriptorName: string + ) { + return this._pathTemplates.projectMetricDescriptorPathTemplate.match( + projectMetricDescriptorName + ).project; + } + + /** + * Parse the metric_descriptor from ProjectMetricDescriptor resource. + * + * @param {string} projectMetricDescriptorName + * A fully-qualified path representing project_metric_descriptor resource. + * @returns {string} A string representing the metric_descriptor. + */ + matchMetricDescriptorFromProjectMetricDescriptorName( + projectMetricDescriptorName: string + ) { + return this._pathTemplates.projectMetricDescriptorPathTemplate.match( + projectMetricDescriptorName + ).metric_descriptor; + } + + /** + * Return a fully-qualified projectMonitoredResourceDescriptor resource name string. + * + * @param {string} project + * @param {string} monitored_resource_descriptor + * @returns {string} Resource name string. + */ + projectMonitoredResourceDescriptorPath( + project: string, + monitoredResourceDescriptor: string + ) { + return this._pathTemplates.projectMonitoredResourceDescriptorPathTemplate.render( + { + project, + monitored_resource_descriptor: monitoredResourceDescriptor, + } + ); + } + + /** + * Parse the project from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectMonitoredResourceDescriptorName( + projectMonitoredResourceDescriptorName: string + ) { + return this._pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match( + projectMonitoredResourceDescriptorName + ).project; + } + + /** + * Parse the monitored_resource_descriptor from ProjectMonitoredResourceDescriptor resource. + * + * @param {string} projectMonitoredResourceDescriptorName + * A fully-qualified path representing project_monitored_resource_descriptor resource. + * @returns {string} A string representing the monitored_resource_descriptor. + */ + matchMonitoredResourceDescriptorFromProjectMonitoredResourceDescriptorName( + projectMonitoredResourceDescriptorName: string + ) { + return this._pathTemplates.projectMonitoredResourceDescriptorPathTemplate.match( + projectMonitoredResourceDescriptorName + ).monitored_resource_descriptor; + } + + /** + * Return a fully-qualified projectNotificationChannel resource name string. + * + * @param {string} project + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + projectNotificationChannelPath(project: string, notificationChannel: string) { + return this._pathTemplates.projectNotificationChannelPathTemplate.render({ + project, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the project from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).project; + } + + /** + * Parse the notification_channel from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this._pathTemplates.projectServicePathTemplate.render({ + project, + service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } + + /** + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * + * @param {string} project + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + projectServiceServiceLevelObjectivePath( + project: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render( + { + project, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the project from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).project; + } + + /** + * Parse the service from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the project from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).project; + } + + /** + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.metricServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3/metric_service_client_config.json b/src/v3/metric_service_client_config.json index c67d2422..1bb5d8d4 100644 --- a/src/v3/metric_service_client_config.json +++ b/src/v3/metric_service_client_config.json @@ -2,58 +2,67 @@ "interfaces": { "google.monitoring.v3.MetricService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ListMonitoredResourceDescriptors": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetMonitoredResourceDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListMetricDescriptors": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetMetricDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateMetricDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 12000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteMetricDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListTimeSeries": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateTimeSeries": { "timeout_millis": 12000, diff --git a/src/v3/metric_service_proto_list.json b/src/v3/metric_service_proto_list.json index 495ef207..0534dc6a 100644 --- a/src/v3/metric_service_proto_list.json +++ b/src/v3/metric_service_proto_list.json @@ -1,3 +1,18 @@ [ - "../../protos/google/monitoring/v3/metric_service.proto" + "../../protos/google/monitoring/v3/alert.proto", + "../../protos/google/monitoring/v3/alert_service.proto", + "../../protos/google/monitoring/v3/common.proto", + "../../protos/google/monitoring/v3/dropped_labels.proto", + "../../protos/google/monitoring/v3/group.proto", + "../../protos/google/monitoring/v3/group_service.proto", + "../../protos/google/monitoring/v3/metric.proto", + "../../protos/google/monitoring/v3/metric_service.proto", + "../../protos/google/monitoring/v3/mutation_record.proto", + "../../protos/google/monitoring/v3/notification.proto", + "../../protos/google/monitoring/v3/notification_service.proto", + "../../protos/google/monitoring/v3/service.proto", + "../../protos/google/monitoring/v3/service_service.proto", + "../../protos/google/monitoring/v3/span_context.proto", + "../../protos/google/monitoring/v3/uptime.proto", + "../../protos/google/monitoring/v3/uptime_service.proto" ] diff --git a/src/v3/notification_channel_service_client.js b/src/v3/notification_channel_service_client.js deleted file mode 100644 index 103c9fc3..00000000 --- a/src/v3/notification_channel_service_client.js +++ /dev/null @@ -1,1286 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./notification_channel_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * The Notification Channel API provides access to configuration that - * controls how messages related to incidents are sent. - * - * @class - * @memberof v3 - */ -class NotificationChannelServiceClient { - /** - * Construct an instance of NotificationChannelServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - notificationChannelPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/notificationChannels/{notification_channel}' - ), - notificationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' - ), - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - }; - - // 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 = { - listNotificationChannelDescriptors: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'channelDescriptors' - ), - listNotificationChannels: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'notificationChannels' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.monitoring.v3.NotificationChannelService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.monitoring.v3.NotificationChannelService. - const notificationChannelServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService( - 'google.monitoring.v3.NotificationChannelService' - ) - : protos.google.monitoring.v3.NotificationChannelService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const notificationChannelServiceStubMethods = [ - 'listNotificationChannelDescriptors', - 'getNotificationChannelDescriptor', - 'listNotificationChannels', - 'getNotificationChannel', - 'createNotificationChannel', - 'updateNotificationChannel', - 'deleteNotificationChannel', - 'sendNotificationChannelVerificationCode', - 'getNotificationChannelVerificationCode', - 'verifyNotificationChannel', - ]; - for (const methodName of notificationChannelServiceStubMethods) { - const innerCallPromise = notificationChannelServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'monitoring.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'monitoring.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Lists the descriptors for supported channel types. The use of descriptors - * makes it possible for new channel types to be dynamically added. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The REST resource name of the parent from which to retrieve - * the notification channel descriptors. The expected syntax is: - * - * projects/[PROJECT_ID] - * - * Note that this names the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the - * GetNotificationChannelDescriptor - * operation, instead. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListNotificationChannelDescriptorsResponse]{@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListNotificationChannelDescriptorsResponse]{@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * - * client.listNotificationChannelDescriptors({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listNotificationChannelDescriptors(nextRequest, options).then(callback); - * } - * } - * client.listNotificationChannelDescriptors({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listNotificationChannelDescriptors(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listNotificationChannelDescriptors( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listNotificationChannelDescriptors}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listNotificationChannelDescriptors} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The REST resource name of the parent from which to retrieve - * the notification channel descriptors. The expected syntax is: - * - * projects/[PROJECT_ID] - * - * Note that this names the parent container in which to look for the - * descriptors; to retrieve a single descriptor by name, use the - * GetNotificationChannelDescriptor - * operation, instead. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * client.listNotificationChannelDescriptorsStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listNotificationChannelDescriptorsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listNotificationChannelDescriptors.createStream( - this._innerApiCalls.listNotificationChannelDescriptors, - request, - options - ); - } - - /** - * Gets a single channel descriptor. The descriptor indicates which fields - * are expected / permitted for a notification channel of the given type. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The channel type for which to execute the request. The format is - * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.notificationChannelDescriptorPath('[PROJECT]', '[CHANNEL_DESCRIPTOR]'); - * client.getNotificationChannelDescriptor({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getNotificationChannelDescriptor(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getNotificationChannelDescriptor( - request, - options, - callback - ); - } - - /** - * Lists the notification channels that have been created for the project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `projects/[PROJECT_ID]`. That is, this names the container - * in which to look for the notification channels; it does not name a - * specific channel. To query a specific channel by REST resource name, use - * the - * `GetNotificationChannel` - * operation. - * @param {string} [request.filter] - * If provided, this field specifies the criteria that must be met by - * notification channels to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @param {string} [request.orderBy] - * A comma-separated list of fields by which to sort the result. Supports - * the same set of fields as in `filter`. Entries can be prefixed with - * a minus sign to sort in descending rather than ascending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListNotificationChannelsResponse]{@link google.monitoring.v3.ListNotificationChannelsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListNotificationChannelsResponse]{@link google.monitoring.v3.ListNotificationChannelsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedName = client.projectPath('[PROJECT]'); - * - * client.listNotificationChannels({name: formattedName}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedName = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listNotificationChannels(nextRequest, options).then(callback); - * } - * } - * client.listNotificationChannels({name: formattedName}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listNotificationChannels(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.listNotificationChannels( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listNotificationChannels}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listNotificationChannels} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is - * `projects/[PROJECT_ID]`. That is, this names the container - * in which to look for the notification channels; it does not name a - * specific channel. To query a specific channel by REST resource name, use - * the - * `GetNotificationChannel` - * operation. - * @param {string} [request.filter] - * If provided, this field specifies the criteria that must be met by - * notification channels to be included in the response. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @param {string} [request.orderBy] - * A comma-separated list of fields by which to sort the result. Supports - * the same set of fields as in `filter`. Entries can be prefixed with - * a minus sign to sort in descending rather than ascending order. - * - * For more details, see [sorting and - * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * client.listNotificationChannelsStream({name: formattedName}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listNotificationChannelsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listNotificationChannels.createStream( - this._innerApiCalls.listNotificationChannels, - request, - options - ); - } - - /** - * Gets a single notification channel. The channel includes the relevant - * configuration details with which the channel was created. However, the - * response may truncate or omit passwords, API keys, or other private key - * matter and thus the response may not be 100% identical to the information - * that was supplied in the call to the create method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The channel for which to execute the request. The format is - * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.notificationChannelPath('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * client.getNotificationChannel({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getNotificationChannel(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getNotificationChannel( - request, - options, - callback - ); - } - - /** - * Creates a new notification channel, representing a single notification - * endpoint such as an email address, SMS number, or PagerDuty service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The project on which to execute the request. The format is: - * - * projects/[PROJECT_ID] - * - * Note that this names the container into which the channel will be - * written. This does not name the newly created channel. The resulting - * channel's name will have a normalized version of this field as a prefix, - * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. - * @param {Object} request.notificationChannel - * Required. The definition of the `NotificationChannel` to create. - * - * This object should have the same structure as [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.projectPath('[PROJECT]'); - * const notificationChannel = {}; - * const request = { - * name: formattedName, - * notificationChannel: notificationChannel, - * }; - * client.createNotificationChannel(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createNotificationChannel(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.createNotificationChannel( - request, - options, - callback - ); - } - - /** - * Updates a notification channel. Fields not specified in the field mask - * remain unchanged. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.notificationChannel - * Required. A description of the changes to be applied to the specified - * notification channel. The description must provide a definition for - * fields to be updated; the names of these fields should also be - * included in the `update_mask`. - * - * This object should have the same structure as [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} - * @param {Object} [request.updateMask] - * The fields to update. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const notificationChannel = {}; - * client.updateNotificationChannel({notificationChannel: notificationChannel}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateNotificationChannel(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'notification_channel.name': request.notificationChannel.name, - }); - - return this._innerApiCalls.updateNotificationChannel( - request, - options, - callback - ); - } - - /** - * Deletes a notification channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The channel for which to execute the request. The format is - * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. - * @param {boolean} [request.force] - * If true, the notification channel will be deleted regardless of its - * use in alert policies (the policies will be updated to remove the - * channel). If false, channels that are still referenced by an existing - * alerting policy will fail to be deleted in a delete operation. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.notificationChannelPath('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * client.deleteNotificationChannel({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteNotificationChannel(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteNotificationChannel( - request, - options, - callback - ); - } - - /** - * Causes a verification code to be delivered to the channel. The code - * can then be supplied in `VerifyNotificationChannel` to verify the channel. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The notification channel to which to send a verification code. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.notificationChannelPath('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * client.sendNotificationChannelVerificationCode({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - sendNotificationChannelVerificationCode(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.sendNotificationChannelVerificationCode( - request, - options, - callback - ); - } - - /** - * Requests a verification code for an already verified channel that can then - * be used in a call to VerifyNotificationChannel() on a different channel - * with an equivalent identity in the same or in a different project. This - * makes it possible to copy a channel between projects without requiring - * manual reverification of the channel. If the channel is not in the - * verified state, this method will fail (in other words, this may only be - * used if the SendNotificationChannelVerificationCode and - * VerifyNotificationChannel paths have already been used to put the given - * channel into the verified state). - * - * There is no guarantee that the verification codes returned by this method - * will be of a similar structure or form as the ones that are delivered - * to the channel via SendNotificationChannelVerificationCode; while - * VerifyNotificationChannel() will recognize both the codes delivered via - * SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that - * the verification codes delivered via - * SendNotificationChannelVerificationCode() will be shorter and also - * have a shorter expiration (e.g. codes such as "G-123456") whereas - * GetVerificationCode() will typically return a much longer, websafe base - * 64 encoded string that has a longer expiration time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The notification channel for which a verification code is to be generated - * and retrieved. This must name a channel that is already verified; if - * the specified channel is not verified, the request will fail. - * @param {Object} [request.expireTime] - * The desired expiration time. If specified, the API will guarantee that - * the returned code will not be valid after the specified timestamp; - * however, the API cannot guarantee that the returned code will be - * valid for at least as long as the requested time (the API puts an upper - * bound on the amount of time for which a code may be valid). If omitted, - * a default expiration will be used, which may be less than the max - * permissible expiration (so specifying an expiration may extend the - * code's lifetime over omitting an expiration, even though the API does - * impose an upper limit on the maximum expiration that is permitted). - * - * This object should have the same structure as [Timestamp]{@link google.protobuf.Timestamp} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [GetNotificationChannelVerificationCodeResponse]{@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [GetNotificationChannelVerificationCodeResponse]{@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.notificationChannelPath('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * client.getNotificationChannelVerificationCode({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getNotificationChannelVerificationCode(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getNotificationChannelVerificationCode( - request, - options, - callback - ); - } - - /** - * Verifies a `NotificationChannel` by proving receipt of the code - * delivered to the channel as a result of calling - * `SendNotificationChannelVerificationCode`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The notification channel to verify. - * @param {string} request.code - * Required. The verification code that was delivered to the channel as - * a result of invoking the `SendNotificationChannelVerificationCode` API - * method or that was retrieved from a verified channel via - * `GetNotificationChannelVerificationCode`. For example, one might have - * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only - * guaranteed that the code is valid UTF-8; one should not - * make any assumptions regarding the structure or format of the code). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.NotificationChannelServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.notificationChannelPath('[PROJECT]', '[NOTIFICATION_CHANNEL]'); - * const code = ''; - * const request = { - * name: formattedName, - * code: code, - * }; - * client.verifyNotificationChannel(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - verifyNotificationChannel(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.verifyNotificationChannel( - request, - options, - callback - ); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified notification_channel resource name string. - * - * @param {String} project - * @param {String} notificationChannel - * @returns {String} - */ - notificationChannelPath(project, notificationChannel) { - return this._pathTemplates.notificationChannelPathTemplate.render({ - project: project, - notification_channel: notificationChannel, - }); - } - - /** - * Return a fully-qualified notification_channel_descriptor resource name string. - * - * @param {String} project - * @param {String} channelDescriptor - * @returns {String} - */ - notificationChannelDescriptorPath(project, channelDescriptor) { - return this._pathTemplates.notificationChannelDescriptorPathTemplate.render( - { - project: project, - channel_descriptor: channelDescriptor, - } - ); - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the notificationChannelName from a notification_channel resource. - * - * @param {String} notificationChannelName - * A fully-qualified path representing a notification_channel resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromNotificationChannelName(notificationChannelName) { - return this._pathTemplates.notificationChannelPathTemplate.match( - notificationChannelName - ).project; - } - - /** - * Parse the notificationChannelName from a notification_channel resource. - * - * @param {String} notificationChannelName - * A fully-qualified path representing a notification_channel resources. - * @returns {String} - A string representing the notification_channel. - */ - matchNotificationChannelFromNotificationChannelName(notificationChannelName) { - return this._pathTemplates.notificationChannelPathTemplate.match( - notificationChannelName - ).notification_channel; - } - - /** - * Parse the notificationChannelDescriptorName from a notification_channel_descriptor resource. - * - * @param {String} notificationChannelDescriptorName - * A fully-qualified path representing a notification_channel_descriptor resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromNotificationChannelDescriptorName( - notificationChannelDescriptorName - ) { - return this._pathTemplates.notificationChannelDescriptorPathTemplate.match( - notificationChannelDescriptorName - ).project; - } - - /** - * Parse the notificationChannelDescriptorName from a notification_channel_descriptor resource. - * - * @param {String} notificationChannelDescriptorName - * A fully-qualified path representing a notification_channel_descriptor resources. - * @returns {String} - A string representing the channel_descriptor. - */ - matchChannelDescriptorFromNotificationChannelDescriptorName( - notificationChannelDescriptorName - ) { - return this._pathTemplates.notificationChannelDescriptorPathTemplate.match( - notificationChannelDescriptorName - ).channel_descriptor; - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } -} - -module.exports = NotificationChannelServiceClient; diff --git a/src/v3/notification_channel_service_client.ts b/src/v3/notification_channel_service_client.ts new file mode 100644 index 00000000..9ffea455 --- /dev/null +++ b/src/v3/notification_channel_service_client.ts @@ -0,0 +1,2462 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './notification_channel_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Notification Channel API provides access to configuration that + * controls how messages related to incidents are sent. + * @class + * @memberof v3 + */ +export class NotificationChannelServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + notificationChannelServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NotificationChannelServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof NotificationChannelServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof NotificationChannelServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + folderAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/alertPolicies/{alert_policy}' + ), + folderChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannelDescriptors/{channel_descriptor}' + ), + folderGroupPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/groups/{group}' + ), + folderNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannels/{notification_channel}' + ), + folderServicePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}' + ), + organizationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), + organizationGroupPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/groups/{group}' + ), + organizationNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + projectChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' + ), + projectGroupPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/groups/{group}' + ), + projectNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannels/{notification_channel}' + ), + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' + ), + }; + + // 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 = { + listNotificationChannelDescriptors: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'channelDescriptors' + ), + listNotificationChannels: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'notificationChannels' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.NotificationChannelService', + 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 = {}; + + // Put together the "service stub" for + // google.monitoring.v3.NotificationChannelService. + this.notificationChannelServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.monitoring.v3.NotificationChannelService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.monitoring.v3.NotificationChannelService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const notificationChannelServiceStubMethods = [ + 'listNotificationChannelDescriptors', + 'getNotificationChannelDescriptor', + 'listNotificationChannels', + 'getNotificationChannel', + 'createNotificationChannel', + 'updateNotificationChannel', + 'deleteNotificationChannel', + 'sendNotificationChannelVerificationCode', + 'getNotificationChannelVerificationCode', + 'verifyNotificationChannel', + ]; + + for (const methodName of notificationChannelServiceStubMethods) { + const innerCallPromise = this.notificationChannelServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getNotificationChannelDescriptor( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannelDescriptor, + ( + | protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationChannelDescriptor( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannelDescriptor, + | protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a single channel descriptor. The descriptor indicates which fields + * are expected / permitted for a notification channel of the given type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The channel type for which to execute the request. The format is + * `projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}`. + * @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 [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getNotificationChannelDescriptor( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannelDescriptor, + | protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannelDescriptor, + | protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannelDescriptor, + ( + | protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getNotificationChannelDescriptor( + request, + options, + callback + ); + } + getNotificationChannel( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.IGetNotificationChannelRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationChannel( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IGetNotificationChannelRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets a single notification channel. The channel includes the relevant + * configuration details with which the channel was created. However, the + * response may truncate or omit passwords, API keys, or other private key + * matter and thus the response may not be 100% identical to the information + * that was supplied in the call to the create method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The channel for which to execute the request. The format is + * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getNotificationChannel( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IGetNotificationChannelRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IGetNotificationChannelRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.IGetNotificationChannelRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getNotificationChannel( + request, + options, + callback + ); + } + createNotificationChannel( + request: protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest + | undefined + ), + {} | undefined + ] + >; + createNotificationChannel( + request: protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new notification channel, representing a single notification + * endpoint such as an email address, SMS number, or PagerDuty service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is: + * + * projects/[PROJECT_ID] + * + * Note that this names the container into which the channel will be + * written. This does not name the newly created channel. The resulting + * channel's name will have a normalized version of this field as a prefix, + * but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel. + * @param {google.monitoring.v3.NotificationChannel} request.notificationChannel + * Required. The definition of the `NotificationChannel` to create. + * @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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createNotificationChannel( + request: protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.createNotificationChannel( + request, + options, + callback + ); + } + updateNotificationChannel( + request: protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest + | undefined + ), + {} | undefined + ] + >; + updateNotificationChannel( + request: protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates a notification channel. Fields not specified in the field mask + * remain unchanged. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * The fields to update. + * @param {google.monitoring.v3.NotificationChannel} request.notificationChannel + * Required. A description of the changes to be applied to the specified + * notification channel. The description must provide a definition for + * fields to be updated; the names of these fields should also be + * included in the `update_mask`. + * @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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateNotificationChannel( + request: protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + 'notification_channel.name': request.notificationChannel!.name || '', + }); + return this._innerApiCalls.updateNotificationChannel( + request, + options, + callback + ); + } + deleteNotificationChannel( + request: protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest + | undefined + ), + {} | undefined + ] + >; + deleteNotificationChannel( + request: protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes a notification channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The channel for which to execute the request. The format is + * `projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]`. + * @param {boolean} request.force + * If true, the notification channel will be deleted regardless of its + * use in alert policies (the policies will be updated to remove the + * channel). If false, channels that are still referenced by an existing + * alerting policy will fail to be deleted in a delete operation. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteNotificationChannel( + request: protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteNotificationChannel( + request, + options, + callback + ); + } + sendNotificationChannelVerificationCode( + request: protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest + | undefined + ), + {} | undefined + ] + >; + sendNotificationChannelVerificationCode( + request: protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest + | undefined, + {} | undefined + > + ): void; + /** + * Causes a verification code to be delivered to the channel. The code + * can then be supplied in `VerifyNotificationChannel` to verify the channel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The notification channel to which to send a verification code. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + sendNotificationChannelVerificationCode( + request: protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.sendNotificationChannelVerificationCode( + request, + options, + callback + ); + } + getNotificationChannelVerificationCode( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, + ( + | protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest + | undefined + ), + {} | undefined + ] + >; + getNotificationChannelVerificationCode( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, + | protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest + | undefined, + {} | undefined + > + ): void; + /** + * Requests a verification code for an already verified channel that can then + * be used in a call to VerifyNotificationChannel() on a different channel + * with an equivalent identity in the same or in a different project. This + * makes it possible to copy a channel between projects without requiring + * manual reverification of the channel. If the channel is not in the + * verified state, this method will fail (in other words, this may only be + * used if the SendNotificationChannelVerificationCode and + * VerifyNotificationChannel paths have already been used to put the given + * channel into the verified state). + * + * There is no guarantee that the verification codes returned by this method + * will be of a similar structure or form as the ones that are delivered + * to the channel via SendNotificationChannelVerificationCode; while + * VerifyNotificationChannel() will recognize both the codes delivered via + * SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that + * the verification codes delivered via + * SendNotificationChannelVerificationCode() will be shorter and also + * have a shorter expiration (e.g. codes such as "G-123456") whereas + * GetVerificationCode() will typically return a much longer, websafe base + * 64 encoded string that has a longer expiration time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if + * the specified channel is not verified, the request will fail. + * @param {google.protobuf.Timestamp} request.expireTime + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be + * valid for at least as long as the requested time (the API puts an upper + * bound on the amount of time for which a code may be valid). If omitted, + * a default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + * @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 [GetNotificationChannelVerificationCodeResponse]{@link google.monitoring.v3.GetNotificationChannelVerificationCodeResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getNotificationChannelVerificationCode( + request: protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, + | protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, + | protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, + ( + | protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getNotificationChannelVerificationCode( + request, + options, + callback + ); + } + verifyNotificationChannel( + request: protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest + | undefined + ), + {} | undefined + ] + >; + verifyNotificationChannel( + request: protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest + | undefined, + {} | undefined + > + ): void; + /** + * Verifies a `NotificationChannel` by proving receipt of the code + * delivered to the channel as a result of calling + * `SendNotificationChannelVerificationCode`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The notification channel to verify. + * @param {string} request.code + * Required. The verification code that was delivered to the channel as + * a result of invoking the `SendNotificationChannelVerificationCode` API + * method or that was retrieved from a verified channel via + * `GetNotificationChannelVerificationCode`. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only + * guaranteed that the code is valid UTF-8; one should not + * make any assumptions regarding the structure or format of the code). + * @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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + verifyNotificationChannel( + request: protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannel, + | protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel, + ( + | protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.verifyNotificationChannel( + request, + options, + callback + ); + } + + listNotificationChannelDescriptors( + request: protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannelDescriptor[], + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsResponse + ] + >; + listNotificationChannelDescriptors( + request: protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannelDescriptor[], + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsResponse + > + ): void; + /** + * Lists the descriptors for supported channel types. The use of descriptors + * makes it possible for new channel types to be dynamically added. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * + * projects/[PROJECT_ID] + * + * Note that this names the parent container in which to look for the + * descriptors; to retrieve a single descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * @param {string} request.pageToken + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * @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 [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListNotificationChannelDescriptorsRequest]{@link google.monitoring.v3.ListNotificationChannelDescriptorsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListNotificationChannelDescriptorsResponse]{@link google.monitoring.v3.ListNotificationChannelDescriptorsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listNotificationChannelDescriptors( + request: protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannelDescriptor[], + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannelDescriptor[], + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannelDescriptor[], + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listNotificationChannelDescriptors( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listNotificationChannelDescriptors}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listNotificationChannelDescriptors} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The REST resource name of the parent from which to retrieve + * the notification channel descriptors. The expected syntax is: + * + * projects/[PROJECT_ID] + * + * Note that this names the parent container in which to look for the + * descriptors; to retrieve a single descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * @param {string} request.pageToken + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * @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 [NotificationChannelDescriptor]{@link google.monitoring.v3.NotificationChannelDescriptor} on 'data' event. + */ + listNotificationChannelDescriptorsStream( + request?: protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listNotificationChannelDescriptors.createStream( + this._innerApiCalls.listNotificationChannelDescriptors as gax.GaxCall, + request, + callSettings + ); + } + listNotificationChannels( + request: protosTypes.google.monitoring.v3.IListNotificationChannelsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel[], + protosTypes.google.monitoring.v3.IListNotificationChannelsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelsResponse + ] + >; + listNotificationChannels( + request: protosTypes.google.monitoring.v3.IListNotificationChannelsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.INotificationChannel[], + protosTypes.google.monitoring.v3.IListNotificationChannelsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelsResponse + > + ): void; + /** + * Lists the notification channels that have been created for the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `projects/[PROJECT_ID]`. That is, this names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {string} request.orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {number} request.pageSize + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * @param {string} request.pageToken + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * @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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListNotificationChannelsRequest]{@link google.monitoring.v3.ListNotificationChannelsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListNotificationChannelsResponse]{@link google.monitoring.v3.ListNotificationChannelsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listNotificationChannels( + request: protosTypes.google.monitoring.v3.IListNotificationChannelsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.INotificationChannel[], + protosTypes.google.monitoring.v3.IListNotificationChannelsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelsResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.INotificationChannel[], + protosTypes.google.monitoring.v3.IListNotificationChannelsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelsResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.INotificationChannel[], + protosTypes.google.monitoring.v3.IListNotificationChannelsRequest | null, + protosTypes.google.monitoring.v3.IListNotificationChannelsResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.listNotificationChannels( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listNotificationChannels}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listNotificationChannels} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The project on which to execute the request. The format is + * `projects/[PROJECT_ID]`. That is, this names the container + * in which to look for the notification channels; it does not name a + * specific channel. To query a specific channel by REST resource name, use + * the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * @param {string} request.filter + * If provided, this field specifies the criteria that must be met by + * notification channels to be included in the response. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {string} request.orderBy + * A comma-separated list of fields by which to sort the result. Supports + * the same set of fields as in `filter`. Entries can be prefixed with + * a minus sign to sort in descending rather than ascending order. + * + * For more details, see [sorting and + * filtering](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). + * @param {number} request.pageSize + * The maximum number of results to return in a single response. If + * not set to a positive number, a reasonable value will be chosen by the + * service. + * @param {string} request.pageToken + * If non-empty, `page_token` must contain a value returned as the + * `next_page_token` in a previous response to request the next set + * of results. + * @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 [NotificationChannel]{@link google.monitoring.v3.NotificationChannel} on 'data' event. + */ + listNotificationChannelsStream( + request?: protosTypes.google.monitoring.v3.IListNotificationChannelsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listNotificationChannels.createStream( + this._innerApiCalls.listNotificationChannels as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAlertPolicy resource name string. + * + * @param {string} folder + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + folderAlertPolicyPath(folder: string, alertPolicy: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.render({ + folder, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the folder from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).folder; + } + + /** + * Parse the alert_policy from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified folderChannelDescriptor resource name string. + * + * @param {string} folder + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + folderChannelDescriptorPath(folder: string, channelDescriptor: string) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.render({ + folder, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the folder from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).folder; + } + + /** + * Parse the channel_descriptor from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified folderGroup resource name string. + * + * @param {string} folder + * @param {string} group + * @returns {string} Resource name string. + */ + folderGroupPath(folder: string, group: string) { + return this._pathTemplates.folderGroupPathTemplate.render({ + folder, + group, + }); + } + + /** + * Parse the folder from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .folder; + } + + /** + * Parse the group from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .group; + } + + /** + * Return a fully-qualified folderNotificationChannel resource name string. + * + * @param {string} folder + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + folderNotificationChannelPath(folder: string, notificationChannel: string) { + return this._pathTemplates.folderNotificationChannelPathTemplate.render({ + folder, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the folder from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).folder; + } + + /** + * Parse the notification_channel from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder, + service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).service; + } + + /** + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * + * @param {string} folder + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + folderServiceServiceLevelObjectivePath( + folder: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render( + { + folder, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the folder from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).folder; + } + + /** + * Parse the service from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified folderUptimeCheckConfig resource name string. + * + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the folder from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).folder; + } + + /** + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Return a fully-qualified organizationAlertPolicy resource name string. + * + * @param {string} organization + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + organizationAlertPolicyPath(organization: string, alertPolicy: string) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.render({ + organization, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the organization from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).organization; + } + + /** + * Parse the alert_policy from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified organizationChannelDescriptor resource name string. + * + * @param {string} organization + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + organizationChannelDescriptorPath( + organization: string, + channelDescriptor: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.render( + { + organization, + channel_descriptor: channelDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).organization; + } + + /** + * Parse the channel_descriptor from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified organizationGroup resource name string. + * + * @param {string} organization + * @param {string} group + * @returns {string} Resource name string. + */ + organizationGroupPath(organization: string, group: string) { + return this._pathTemplates.organizationGroupPathTemplate.render({ + organization, + group, + }); + } + + /** + * Parse the organization from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).organization; + } + + /** + * Parse the group from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).group; + } + + /** + * Return a fully-qualified organizationNotificationChannel resource name string. + * + * @param {string} organization + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + organizationNotificationChannelPath( + organization: string, + notificationChannel: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.render( + { + organization, + notification_channel: notificationChannel, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).organization; + } + + /** + * Parse the notification_channel from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization, + service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified organizationServiceServiceLevelObjective resource name string. + * + * @param {string} organization + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + organizationServiceServiceLevelObjectivePath( + organization: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render( + { + organization, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the organization from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).organization; + } + + /** + * Parse the service from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * + * @param {string} organization + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + organizationUptimeCheckConfigPath( + organization: string, + uptimeCheckConfig: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render( + { + organization, + uptime_check_config: uptimeCheckConfig, + } + ); + } + + /** + * Parse the organization from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).organization; + } + + /** + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * 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, + }); + } + + /** + * 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 projectAlertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + projectAlertPolicyPath(project: string, alertPolicy: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.render({ + project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).project; + } + + /** + * Parse the alert_policy from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified projectChannelDescriptor resource name string. + * + * @param {string} project + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + projectChannelDescriptorPath(project: string, channelDescriptor: string) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.render({ + project, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the project from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).project; + } + + /** + * Parse the channel_descriptor from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified projectGroup resource name string. + * + * @param {string} project + * @param {string} group + * @returns {string} Resource name string. + */ + projectGroupPath(project: string, group: string) { + return this._pathTemplates.projectGroupPathTemplate.render({ + project, + group, + }); + } + + /** + * Parse the project from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .project; + } + + /** + * Parse the group from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .group; + } + + /** + * Return a fully-qualified projectNotificationChannel resource name string. + * + * @param {string} project + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + projectNotificationChannelPath(project: string, notificationChannel: string) { + return this._pathTemplates.projectNotificationChannelPathTemplate.render({ + project, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the project from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).project; + } + + /** + * Parse the notification_channel from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this._pathTemplates.projectServicePathTemplate.render({ + project, + service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } + + /** + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * + * @param {string} project + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + projectServiceServiceLevelObjectivePath( + project: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render( + { + project, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the project from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).project; + } + + /** + * Parse the service from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the project from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).project; + } + + /** + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.notificationChannelServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3/notification_channel_service_client_config.json b/src/v3/notification_channel_service_client_config.json index 5fddaef1..58fb6cbe 100644 --- a/src/v3/notification_channel_service_client_config.json +++ b/src/v3/notification_channel_service_client_config.json @@ -2,73 +2,82 @@ "interfaces": { "google.monitoring.v3.NotificationChannelService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ListNotificationChannelDescriptors": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetNotificationChannelDescriptor": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListNotificationChannels": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "SendNotificationChannelVerificationCode": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetNotificationChannelVerificationCode": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "VerifyNotificationChannel": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" } } } diff --git a/src/v3/notification_channel_service_proto_list.json b/src/v3/notification_channel_service_proto_list.json index 0de383ff..0534dc6a 100644 --- a/src/v3/notification_channel_service_proto_list.json +++ b/src/v3/notification_channel_service_proto_list.json @@ -1,3 +1,18 @@ [ - "../../protos/google/monitoring/v3/notification_service.proto" + "../../protos/google/monitoring/v3/alert.proto", + "../../protos/google/monitoring/v3/alert_service.proto", + "../../protos/google/monitoring/v3/common.proto", + "../../protos/google/monitoring/v3/dropped_labels.proto", + "../../protos/google/monitoring/v3/group.proto", + "../../protos/google/monitoring/v3/group_service.proto", + "../../protos/google/monitoring/v3/metric.proto", + "../../protos/google/monitoring/v3/metric_service.proto", + "../../protos/google/monitoring/v3/mutation_record.proto", + "../../protos/google/monitoring/v3/notification.proto", + "../../protos/google/monitoring/v3/notification_service.proto", + "../../protos/google/monitoring/v3/service.proto", + "../../protos/google/monitoring/v3/service_service.proto", + "../../protos/google/monitoring/v3/span_context.proto", + "../../protos/google/monitoring/v3/uptime.proto", + "../../protos/google/monitoring/v3/uptime_service.proto" ] diff --git a/src/v3/service_monitoring_service_client.js b/src/v3/service_monitoring_service_client.js deleted file mode 100644 index 237f13f8..00000000 --- a/src/v3/service_monitoring_service_client.js +++ /dev/null @@ -1,1238 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./service_monitoring_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for - * managing and querying aspects of a workspace's services. These include the - * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy - * of categorized Health Metrics. - * - * @class - * @memberof v3 - */ -class ServiceMonitoringServiceClient { - /** - * Construct an instance of ServiceMonitoringServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - servicePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/services/{service}' - ), - serviceLevelObjectivePathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' - ), - }; - - // 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 = { - listServices: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'services' - ), - listServiceLevelObjectives: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'serviceLevelObjectives' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.monitoring.v3.ServiceMonitoringService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.monitoring.v3.ServiceMonitoringService. - const serviceMonitoringServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.monitoring.v3.ServiceMonitoringService') - : protos.google.monitoring.v3.ServiceMonitoringService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const serviceMonitoringServiceStubMethods = [ - 'createService', - 'getService', - 'listServices', - 'updateService', - 'deleteService', - 'createServiceLevelObjective', - 'getServiceLevelObjective', - 'listServiceLevelObjectives', - 'updateServiceLevelObjective', - 'deleteServiceLevelObjective', - ]; - for (const methodName of serviceMonitoringServiceStubMethods) { - const innerCallPromise = serviceMonitoringServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'monitoring.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'monitoring.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Create a `Service`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent workspace. - * Of the form `projects/{project_id}`. - * @param {Object} request.service - * Required. The `Service` to create. - * - * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} - * @param {string} [request.serviceId] - * Optional. The Service id to use for this Service. If omitted, an id will be - * generated instead. Must match the pattern [a-z0-9\-]+ - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Service]{@link google.monitoring.v3.Service}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Service]{@link google.monitoring.v3.Service}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const service = {}; - * const request = { - * parent: formattedParent, - * service: service, - * }; - * client.createService(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createService(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createService(request, options, callback); - } - - /** - * Get the named `Service`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Service]{@link google.monitoring.v3.Service}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Service]{@link google.monitoring.v3.Service}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); - * client.getService({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getService(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getService(request, options, callback); - } - - /** - * List `Service`s for this workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent `Workspace`. - * Of the form `projects/{project_id}`. - * @param {string} [request.filter] - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` - * - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [Service]{@link google.monitoring.v3.Service}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListServicesResponse]{@link google.monitoring.v3.ListServicesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Service]{@link google.monitoring.v3.Service}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Service]{@link google.monitoring.v3.Service} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListServicesResponse]{@link google.monitoring.v3.ListServicesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.projectPath('[PROJECT]'); - * - * client.listServices({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listServices(nextRequest, options).then(callback); - * } - * } - * client.listServices({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listServices(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listServices(request, options, callback); - } - - /** - * Equivalent to {@link listServices}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listServices} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent `Workspace`. - * Of the form `projects/{project_id}`. - * @param {string} [request.filter] - * A filter specifying what `Service`s to return. The filter currently - * supports the following fields: - * - * - `identifier_case` - * - `app_engine.module_id` - * - `cloud_endpoints.service` - * - `cluster_istio.location` - * - `cluster_istio.cluster_name` - * - `cluster_istio.service_namespace` - * - `cluster_istio.service_name` - * - * `identifier_case` refers to which option in the identifier oneof is - * populated. For example, the filter `identifier_case = "CUSTOM"` would match - * all services with a value for the `custom` field. Valid options are - * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [Service]{@link google.monitoring.v3.Service} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * client.listServicesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listServicesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listServices.createStream( - this._innerApiCalls.listServices, - request, - options - ); - } - - /** - * Update this `Service`. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.service - * Required. The `Service` to draw updates from. - * The given `name` specifies the resource to update. - * - * This object should have the same structure as [Service]{@link google.monitoring.v3.Service} - * @param {Object} [request.updateMask] - * A set of field paths defining which fields to use for the update. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [Service]{@link google.monitoring.v3.Service}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Service]{@link google.monitoring.v3.Service}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const service = {}; - * client.updateService({service: service}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateService(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'service.name': request.service.name, - }); - - return this._innerApiCalls.updateService(request, options, callback); - } - - /** - * Soft delete this `Service`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the `Service` to delete. - * Of the form `projects/{project_id}/services/{service_id}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); - * client.deleteService({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteService(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteService(request, options, callback); - } - - /** - * Create a `ServiceLevelObjective` for the given `Service`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * @param {Object} request.serviceLevelObjective - * Required. The `ServiceLevelObjective` to create. - * The provided `name` will be respected if no `ServiceLevelObjective` exists - * with this name. - * - * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} - * @param {string} [request.serviceLevelObjectiveId] - * Optional. The ServiceLevelObjective id to use for this - * ServiceLevelObjective. If omitted, an id will be generated instead. Must - * match the pattern [a-z0-9\-]+ - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - * const serviceLevelObjective = {}; - * const request = { - * parent: formattedParent, - * serviceLevelObjective: serviceLevelObjective, - * }; - * client.createServiceLevelObjective(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createServiceLevelObjective(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createServiceLevelObjective( - request, - options, - callback - ); - } - - /** - * Get a `ServiceLevelObjective` by name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the `ServiceLevelObjective` to get. - * Of the form - * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. - * @param {number} [request.view] - * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * The number should be among the values of [View]{@link google.monitoring.v3.View} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.serviceLevelObjectivePath('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - * client.getServiceLevelObjective({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getServiceLevelObjective(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getServiceLevelObjective( - request, - options, - callback - ); - } - - /** - * List the `ServiceLevelObjective`s for the given `Service`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * @param {string} [request.filter] - * A filter specifying what `ServiceLevelObjective`s to return. - * @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 {number} [request.view] - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * The number should be among the values of [View]{@link google.monitoring.v3.View} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListServiceLevelObjectivesResponse]{@link google.monitoring.v3.ListServiceLevelObjectivesResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListServiceLevelObjectivesResponse]{@link google.monitoring.v3.ListServiceLevelObjectivesResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - * - * client.listServiceLevelObjectives({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listServiceLevelObjectives(nextRequest, options).then(callback); - * } - * } - * client.listServiceLevelObjectives({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listServiceLevelObjectives(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listServiceLevelObjectives( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listServiceLevelObjectives}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listServiceLevelObjectives} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent `Service`. - * Of the form `projects/{project_id}/services/{service_id}`. - * @param {string} [request.filter] - * A filter specifying what `ServiceLevelObjective`s to return. - * @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 {number} [request.view] - * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each - * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the - * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the - * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. - * - * The number should be among the values of [View]{@link google.monitoring.v3.View} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - * client.listServiceLevelObjectivesStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listServiceLevelObjectivesStream(request, options) { - options = options || {}; - - return this._descriptors.page.listServiceLevelObjectives.createStream( - this._innerApiCalls.listServiceLevelObjectives, - request, - options - ); - } - - /** - * Update the given `ServiceLevelObjective`. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.serviceLevelObjective - * Required. The `ServiceLevelObjective` to draw updates from. - * The given `name` specifies the resource to update. - * - * This object should have the same structure as [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} - * @param {Object} [request.updateMask] - * A set of field paths defining which fields to use for the update. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const serviceLevelObjective = {}; - * client.updateServiceLevelObjective({serviceLevelObjective: serviceLevelObjective}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateServiceLevelObjective(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'service_level_objective.name': request.serviceLevelObjective.name, - }); - - return this._innerApiCalls.updateServiceLevelObjective( - request, - options, - callback - ); - } - - /** - * Delete the given `ServiceLevelObjective`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the `ServiceLevelObjective` to delete. - * Of the form - * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.ServiceMonitoringServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.serviceLevelObjectivePath('[PROJECT]', '[SERVICE]', '[SERVICE_LEVEL_OBJECTIVE]'); - * client.deleteServiceLevelObjective({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteServiceLevelObjective(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteServiceLevelObjective( - request, - options, - callback - ); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Return a fully-qualified service resource name string. - * - * @param {String} project - * @param {String} service - * @returns {String} - */ - servicePath(project, service) { - return this._pathTemplates.servicePathTemplate.render({ - project: project, - service: service, - }); - } - - /** - * Return a fully-qualified service_level_objective resource name string. - * - * @param {String} project - * @param {String} service - * @param {String} serviceLevelObjective - * @returns {String} - */ - serviceLevelObjectivePath(project, service, serviceLevelObjective) { - return this._pathTemplates.serviceLevelObjectivePathTemplate.render({ - project: project, - service: service, - service_level_objective: serviceLevelObjective, - }); - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Parse the serviceName from a service resource. - * - * @param {String} serviceName - * A fully-qualified path representing a service resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromServiceName(serviceName) { - return this._pathTemplates.servicePathTemplate.match(serviceName).project; - } - - /** - * Parse the serviceName from a service resource. - * - * @param {String} serviceName - * A fully-qualified path representing a service resources. - * @returns {String} - A string representing the service. - */ - matchServiceFromServiceName(serviceName) { - return this._pathTemplates.servicePathTemplate.match(serviceName).service; - } - - /** - * Parse the serviceLevelObjectiveName from a service_level_objective resource. - * - * @param {String} serviceLevelObjectiveName - * A fully-qualified path representing a service_level_objective resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromServiceLevelObjectiveName(serviceLevelObjectiveName) { - return this._pathTemplates.serviceLevelObjectivePathTemplate.match( - serviceLevelObjectiveName - ).project; - } - - /** - * Parse the serviceLevelObjectiveName from a service_level_objective resource. - * - * @param {String} serviceLevelObjectiveName - * A fully-qualified path representing a service_level_objective resources. - * @returns {String} - A string representing the service. - */ - matchServiceFromServiceLevelObjectiveName(serviceLevelObjectiveName) { - return this._pathTemplates.serviceLevelObjectivePathTemplate.match( - serviceLevelObjectiveName - ).service; - } - - /** - * Parse the serviceLevelObjectiveName from a service_level_objective resource. - * - * @param {String} serviceLevelObjectiveName - * A fully-qualified path representing a service_level_objective resources. - * @returns {String} - A string representing the service_level_objective. - */ - matchServiceLevelObjectiveFromServiceLevelObjectiveName( - serviceLevelObjectiveName - ) { - return this._pathTemplates.serviceLevelObjectivePathTemplate.match( - serviceLevelObjectiveName - ).service_level_objective; - } -} - -module.exports = ServiceMonitoringServiceClient; diff --git a/src/v3/service_monitoring_service_client.ts b/src/v3/service_monitoring_service_client.ts new file mode 100644 index 00000000..a32c8978 --- /dev/null +++ b/src/v3/service_monitoring_service_client.ts @@ -0,0 +1,2359 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './service_monitoring_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Stackdriver Monitoring Service-Oriented Monitoring API has endpoints for + * managing and querying aspects of a workspace's services. These include the + * `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy + * of categorized Health Metrics. + * @class + * @memberof v3 + */ +export class ServiceMonitoringServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + serviceMonitoringServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ServiceMonitoringServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof ServiceMonitoringServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof ServiceMonitoringServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + folderAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/alertPolicies/{alert_policy}' + ), + folderChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannelDescriptors/{channel_descriptor}' + ), + folderGroupPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/groups/{group}' + ), + folderNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannels/{notification_channel}' + ), + folderServicePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}' + ), + organizationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), + organizationGroupPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/groups/{group}' + ), + organizationNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + projectChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' + ), + projectGroupPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/groups/{group}' + ), + projectNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannels/{notification_channel}' + ), + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' + ), + }; + + // 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 = { + listServices: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'services' + ), + listServiceLevelObjectives: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'serviceLevelObjectives' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.ServiceMonitoringService', + 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 = {}; + + // Put together the "service stub" for + // google.monitoring.v3.ServiceMonitoringService. + this.serviceMonitoringServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.monitoring.v3.ServiceMonitoringService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.monitoring.v3.ServiceMonitoringService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const serviceMonitoringServiceStubMethods = [ + 'createService', + 'getService', + 'listServices', + 'updateService', + 'deleteService', + 'createServiceLevelObjective', + 'getServiceLevelObjective', + 'listServiceLevelObjectives', + 'updateServiceLevelObjective', + 'deleteServiceLevelObjective', + ]; + + for (const methodName of serviceMonitoringServiceStubMethods) { + const innerCallPromise = this.serviceMonitoringServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createService( + request: protosTypes.google.monitoring.v3.ICreateServiceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.ICreateServiceRequest | undefined, + {} | undefined + ] + >; + createService( + request: protosTypes.google.monitoring.v3.ICreateServiceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.ICreateServiceRequest | undefined, + {} | undefined + > + ): void; + /** + * Create a `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent workspace. + * Of the form `projects/{project_id}`. + * @param {string} request.serviceId + * Optional. The Service id to use for this Service. If omitted, an id will be + * generated instead. Must match the pattern [a-z0-9\-]+ + * @param {google.monitoring.v3.Service} request.service + * Required. The `Service` to create. + * @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 [Service]{@link google.monitoring.v3.Service}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createService( + request: protosTypes.google.monitoring.v3.ICreateServiceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.ICreateServiceRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.ICreateServiceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.ICreateServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createService(request, options, callback); + } + getService( + request: protosTypes.google.monitoring.v3.IGetServiceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IGetServiceRequest | undefined, + {} | undefined + ] + >; + getService( + request: protosTypes.google.monitoring.v3.IGetServiceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IGetServiceRequest | undefined, + {} | undefined + > + ): void; + /** + * Get the named `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the `Service`. + * Of the form `projects/{project_id}/services/{service_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 [Service]{@link google.monitoring.v3.Service}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getService( + request: protosTypes.google.monitoring.v3.IGetServiceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IGetServiceRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IGetServiceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IGetServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getService(request, options, callback); + } + updateService( + request: protosTypes.google.monitoring.v3.IUpdateServiceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IUpdateServiceRequest | undefined, + {} | undefined + ] + >; + updateService( + request: protosTypes.google.monitoring.v3.IUpdateServiceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IUpdateServiceRequest | undefined, + {} | undefined + > + ): void; + /** + * Update this `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.monitoring.v3.Service} request.service + * Required. The `Service` to draw updates from. + * The given `name` specifies the resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A set of field paths defining which fields to use for the update. + * @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 [Service]{@link google.monitoring.v3.Service}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateService( + request: protosTypes.google.monitoring.v3.IUpdateServiceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IUpdateServiceRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IUpdateServiceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IService, + protosTypes.google.monitoring.v3.IUpdateServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + 'service.name': request.service!.name || '', + }); + return this._innerApiCalls.updateService(request, options, callback); + } + deleteService( + request: protosTypes.google.monitoring.v3.IDeleteServiceRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteServiceRequest | undefined, + {} | undefined + ] + >; + deleteService( + request: protosTypes.google.monitoring.v3.IDeleteServiceRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteServiceRequest | undefined, + {} | undefined + > + ): void; + /** + * Soft delete this `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the `Service` to delete. + * Of the form `projects/{project_id}/services/{service_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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteService( + request: protosTypes.google.monitoring.v3.IDeleteServiceRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteServiceRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteServiceRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + protosTypes.google.monitoring.v3.IDeleteServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteService(request, options, callback); + } + createServiceLevelObjective( + request: protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective, + ( + | protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + >; + createServiceLevelObjective( + request: protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): void; + /** + * Create a `ServiceLevelObjective` for the given `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {string} request.serviceLevelObjectiveId + * Optional. The ServiceLevelObjective id to use for this + * ServiceLevelObjective. If omitted, an id will be generated instead. Must + * match the pattern [a-z0-9\-]+ + * @param {google.monitoring.v3.ServiceLevelObjective} request.serviceLevelObjective + * Required. The `ServiceLevelObjective` to create. + * The provided `name` will be respected if no `ServiceLevelObjective` exists + * with this name. + * @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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createServiceLevelObjective( + request: protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective, + ( + | protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createServiceLevelObjective( + request, + options, + callback + ); + } + getServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective, + ( + | protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + >; + getServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): void; + /** + * Get a `ServiceLevelObjective` by name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the `ServiceLevelObjective` to get. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @param {google.monitoring.v3.ServiceLevelObjective.View} request.view + * View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * @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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective, + ( + | protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getServiceLevelObjective( + request, + options, + callback + ); + } + updateServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective, + ( + | protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + >; + updateServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): void; + /** + * Update the given `ServiceLevelObjective`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.monitoring.v3.ServiceLevelObjective} request.serviceLevelObjective + * Required. The `ServiceLevelObjective` to draw updates from. + * The given `name` specifies the resource to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A set of field paths defining which fields to use for the update. + * @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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective, + | protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective, + ( + | protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + 'service_level_objective.name': request.serviceLevelObjective!.name || '', + }); + return this._innerApiCalls.updateServiceLevelObjective( + request, + options, + callback + ); + } + deleteServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + >; + deleteServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): void; + /** + * Delete the given `ServiceLevelObjective`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the `ServiceLevelObjective` to delete. + * Of the form + * `projects/{project_id}/services/{service_id}/serviceLevelObjectives/{slo_name}`. + * @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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteServiceLevelObjective( + request: protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteServiceLevelObjective( + request, + options, + callback + ); + } + + listServices( + request: protosTypes.google.monitoring.v3.IListServicesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IService[], + protosTypes.google.monitoring.v3.IListServicesRequest | null, + protosTypes.google.monitoring.v3.IListServicesResponse + ] + >; + listServices( + request: protosTypes.google.monitoring.v3.IListServicesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IService[], + protosTypes.google.monitoring.v3.IListServicesRequest | null, + protosTypes.google.monitoring.v3.IListServicesResponse + > + ): void; + /** + * List `Service`s for this workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent `Workspace`. + * Of the form `projects/{project_id}`. + * @param {string} request.filter + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` + * - `cluster_istio.location` + * - `cluster_istio.cluster_name` + * - `cluster_istio.service_namespace` + * - `cluster_istio.service_name` + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * @param {number} request.pageSize + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [Service]{@link google.monitoring.v3.Service}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Service]{@link google.monitoring.v3.Service} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListServicesRequest]{@link google.monitoring.v3.ListServicesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListServicesResponse]{@link google.monitoring.v3.ListServicesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listServices( + request: protosTypes.google.monitoring.v3.IListServicesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IService[], + protosTypes.google.monitoring.v3.IListServicesRequest | null, + protosTypes.google.monitoring.v3.IListServicesResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IService[], + protosTypes.google.monitoring.v3.IListServicesRequest | null, + protosTypes.google.monitoring.v3.IListServicesResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IService[], + protosTypes.google.monitoring.v3.IListServicesRequest | null, + protosTypes.google.monitoring.v3.IListServicesResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listServices(request, options, callback); + } + + /** + * Equivalent to {@link listServices}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listServices} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent `Workspace`. + * Of the form `projects/{project_id}`. + * @param {string} request.filter + * A filter specifying what `Service`s to return. The filter currently + * supports the following fields: + * + * - `identifier_case` + * - `app_engine.module_id` + * - `cloud_endpoints.service` + * - `cluster_istio.location` + * - `cluster_istio.cluster_name` + * - `cluster_istio.service_namespace` + * - `cluster_istio.service_name` + * + * `identifier_case` refers to which option in the identifier oneof is + * populated. For example, the filter `identifier_case = "CUSTOM"` would match + * all services with a value for the `custom` field. Valid options are + * "CUSTOM", "APP_ENGINE", "CLOUD_ENDPOINTS", and "CLUSTER_ISTIO". + * @param {number} request.pageSize + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method 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 [Service]{@link google.monitoring.v3.Service} on 'data' event. + */ + listServicesStream( + request?: protosTypes.google.monitoring.v3.IListServicesRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listServices.createStream( + this._innerApiCalls.listServices as gax.GaxCall, + request, + callSettings + ); + } + listServiceLevelObjectives( + request: protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective[], + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest | null, + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesResponse + ] + >; + listServiceLevelObjectives( + request: protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective[], + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest | null, + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesResponse + > + ): void; + /** + * List the `ServiceLevelObjective`s for the given `Service`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {string} request.filter + * A filter specifying what `ServiceLevelObjective`s to return. + * @param {number} request.pageSize + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @param {google.monitoring.v3.ServiceLevelObjective.View} request.view + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * @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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListServiceLevelObjectivesRequest]{@link google.monitoring.v3.ListServiceLevelObjectivesRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListServiceLevelObjectivesResponse]{@link google.monitoring.v3.ListServiceLevelObjectivesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listServiceLevelObjectives( + request: protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective[], + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest | null, + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IServiceLevelObjective[], + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest | null, + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IServiceLevelObjective[], + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest | null, + protosTypes.google.monitoring.v3.IListServiceLevelObjectivesResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listServiceLevelObjectives( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listServiceLevelObjectives}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listServiceLevelObjectives} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent `Service`. + * Of the form `projects/{project_id}/services/{service_id}`. + * @param {string} request.filter + * A filter specifying what `ServiceLevelObjective`s to return. + * @param {number} request.pageSize + * A non-negative number that is the maximum number of results to return. + * When 0, use default page size. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return additional results from the previous method call. + * @param {google.monitoring.v3.ServiceLevelObjective.View} request.view + * View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each + * `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the + * `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the + * `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. + * @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 [ServiceLevelObjective]{@link google.monitoring.v3.ServiceLevelObjective} on 'data' event. + */ + listServiceLevelObjectivesStream( + request?: protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listServiceLevelObjectives.createStream( + this._innerApiCalls.listServiceLevelObjectives as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAlertPolicy resource name string. + * + * @param {string} folder + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + folderAlertPolicyPath(folder: string, alertPolicy: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.render({ + folder, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the folder from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).folder; + } + + /** + * Parse the alert_policy from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified folderChannelDescriptor resource name string. + * + * @param {string} folder + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + folderChannelDescriptorPath(folder: string, channelDescriptor: string) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.render({ + folder, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the folder from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).folder; + } + + /** + * Parse the channel_descriptor from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified folderGroup resource name string. + * + * @param {string} folder + * @param {string} group + * @returns {string} Resource name string. + */ + folderGroupPath(folder: string, group: string) { + return this._pathTemplates.folderGroupPathTemplate.render({ + folder, + group, + }); + } + + /** + * Parse the folder from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .folder; + } + + /** + * Parse the group from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .group; + } + + /** + * Return a fully-qualified folderNotificationChannel resource name string. + * + * @param {string} folder + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + folderNotificationChannelPath(folder: string, notificationChannel: string) { + return this._pathTemplates.folderNotificationChannelPathTemplate.render({ + folder, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the folder from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).folder; + } + + /** + * Parse the notification_channel from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder, + service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).service; + } + + /** + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * + * @param {string} folder + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + folderServiceServiceLevelObjectivePath( + folder: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render( + { + folder, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the folder from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).folder; + } + + /** + * Parse the service from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified folderUptimeCheckConfig resource name string. + * + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the folder from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).folder; + } + + /** + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Return a fully-qualified organizationAlertPolicy resource name string. + * + * @param {string} organization + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + organizationAlertPolicyPath(organization: string, alertPolicy: string) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.render({ + organization, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the organization from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).organization; + } + + /** + * Parse the alert_policy from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified organizationChannelDescriptor resource name string. + * + * @param {string} organization + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + organizationChannelDescriptorPath( + organization: string, + channelDescriptor: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.render( + { + organization, + channel_descriptor: channelDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).organization; + } + + /** + * Parse the channel_descriptor from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified organizationGroup resource name string. + * + * @param {string} organization + * @param {string} group + * @returns {string} Resource name string. + */ + organizationGroupPath(organization: string, group: string) { + return this._pathTemplates.organizationGroupPathTemplate.render({ + organization, + group, + }); + } + + /** + * Parse the organization from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).organization; + } + + /** + * Parse the group from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).group; + } + + /** + * Return a fully-qualified organizationNotificationChannel resource name string. + * + * @param {string} organization + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + organizationNotificationChannelPath( + organization: string, + notificationChannel: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.render( + { + organization, + notification_channel: notificationChannel, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).organization; + } + + /** + * Parse the notification_channel from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization, + service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified organizationServiceServiceLevelObjective resource name string. + * + * @param {string} organization + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + organizationServiceServiceLevelObjectivePath( + organization: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render( + { + organization, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the organization from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).organization; + } + + /** + * Parse the service from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * + * @param {string} organization + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + organizationUptimeCheckConfigPath( + organization: string, + uptimeCheckConfig: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render( + { + organization, + uptime_check_config: uptimeCheckConfig, + } + ); + } + + /** + * Parse the organization from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).organization; + } + + /** + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * 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, + }); + } + + /** + * 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 projectAlertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + projectAlertPolicyPath(project: string, alertPolicy: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.render({ + project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).project; + } + + /** + * Parse the alert_policy from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified projectChannelDescriptor resource name string. + * + * @param {string} project + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + projectChannelDescriptorPath(project: string, channelDescriptor: string) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.render({ + project, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the project from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).project; + } + + /** + * Parse the channel_descriptor from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified projectGroup resource name string. + * + * @param {string} project + * @param {string} group + * @returns {string} Resource name string. + */ + projectGroupPath(project: string, group: string) { + return this._pathTemplates.projectGroupPathTemplate.render({ + project, + group, + }); + } + + /** + * Parse the project from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .project; + } + + /** + * Parse the group from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .group; + } + + /** + * Return a fully-qualified projectNotificationChannel resource name string. + * + * @param {string} project + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + projectNotificationChannelPath(project: string, notificationChannel: string) { + return this._pathTemplates.projectNotificationChannelPathTemplate.render({ + project, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the project from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).project; + } + + /** + * Parse the notification_channel from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this._pathTemplates.projectServicePathTemplate.render({ + project, + service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } + + /** + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * + * @param {string} project + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + projectServiceServiceLevelObjectivePath( + project: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render( + { + project, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the project from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).project; + } + + /** + * Parse the service from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the project from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).project; + } + + /** + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.serviceMonitoringServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3/service_monitoring_service_client_config.json b/src/v3/service_monitoring_service_client_config.json index dfa25dc0..b088f168 100644 --- a/src/v3/service_monitoring_service_client_config.json +++ b/src/v3/service_monitoring_service_client_config.json @@ -2,73 +2,82 @@ "interfaces": { "google.monitoring.v3.ServiceMonitoringService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "CreateService": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetService": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListServices": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "UpdateService": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteService": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateServiceLevelObjective": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "GetServiceLevelObjective": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListServiceLevelObjectives": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "UpdateServiceLevelObjective": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteServiceLevelObjective": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" } } } diff --git a/src/v3/service_monitoring_service_proto_list.json b/src/v3/service_monitoring_service_proto_list.json index 10dad482..0534dc6a 100644 --- a/src/v3/service_monitoring_service_proto_list.json +++ b/src/v3/service_monitoring_service_proto_list.json @@ -1,3 +1,18 @@ [ - "../../protos/google/monitoring/v3/service_service.proto" + "../../protos/google/monitoring/v3/alert.proto", + "../../protos/google/monitoring/v3/alert_service.proto", + "../../protos/google/monitoring/v3/common.proto", + "../../protos/google/monitoring/v3/dropped_labels.proto", + "../../protos/google/monitoring/v3/group.proto", + "../../protos/google/monitoring/v3/group_service.proto", + "../../protos/google/monitoring/v3/metric.proto", + "../../protos/google/monitoring/v3/metric_service.proto", + "../../protos/google/monitoring/v3/mutation_record.proto", + "../../protos/google/monitoring/v3/notification.proto", + "../../protos/google/monitoring/v3/notification_service.proto", + "../../protos/google/monitoring/v3/service.proto", + "../../protos/google/monitoring/v3/service_service.proto", + "../../protos/google/monitoring/v3/span_context.proto", + "../../protos/google/monitoring/v3/uptime.proto", + "../../protos/google/monitoring/v3/uptime_service.proto" ] diff --git a/src/v3/uptime_check_service_client.js b/src/v3/uptime_check_service_client.js deleted file mode 100644 index 3f322c5f..00000000 --- a/src/v3/uptime_check_service_client.js +++ /dev/null @@ -1,884 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const gapicConfig = require('./uptime_check_service_client_config.json'); -const gax = require('google-gax'); -const path = require('path'); - -const VERSION = require('../../package.json').version; - -/** - * The UptimeCheckService API is used to manage (list, create, delete, edit) - * Uptime check configurations in the Stackdriver Monitoring product. An Uptime - * check is a piece of configuration that determines which resources and - * services to monitor for availability. These configurations can also be - * configured interactively by navigating to the [Cloud Console] - * (http://console.cloud.google.com), selecting the appropriate project, - * clicking on "Monitoring" on the left-hand side to navigate to Stackdriver, - * and then clicking on "Uptime". - * - * @class - * @memberof v3 - */ -class UptimeCheckServiceClient { - /** - * Construct an instance of UptimeCheckServiceClient. - * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - */ - constructor(opts) { - opts = opts || {}; - this._descriptors = {}; - - if (global.isBrowser) { - // If we're in browser, we use gRPC fallback. - opts.fallback = true; - } - - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; - - const servicePath = - opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; - - // Ensure that options include the service address and port. - opts = Object.assign( - { - clientConfig: {}, - port: this.constructor.port, - servicePath, - }, - opts - ); - - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = this.constructor.scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); - - // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth; - - // Determine the client header string. - const clientHeader = []; - - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } - clientHeader.push(`gax/${gaxModule.version}`); - if (opts.fallback) { - clientHeader.push(`gl-web/${gaxModule.version}`); - } else { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); - } - clientHeader.push(`gapic/${VERSION}`); - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - - // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - const protos = gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath - ); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this._pathTemplates = { - projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), - uptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' - ), - }; - - // 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 = { - listUptimeCheckConfigs: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'uptimeCheckConfigs' - ), - listUptimeCheckIps: new gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'uptimeCheckIps' - ), - }; - - // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( - 'google.monitoring.v3.UptimeCheckService', - gapicConfig, - 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 = {}; - - // Put together the "service stub" for - // google.monitoring.v3.UptimeCheckService. - const uptimeCheckServiceStub = gaxGrpc.createStub( - opts.fallback - ? protos.lookupService('google.monitoring.v3.UptimeCheckService') - : protos.google.monitoring.v3.UptimeCheckService, - opts - ); - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const uptimeCheckServiceStubMethods = [ - 'listUptimeCheckConfigs', - 'getUptimeCheckConfig', - 'createUptimeCheckConfig', - 'updateUptimeCheckConfig', - 'deleteUptimeCheckConfig', - 'listUptimeCheckIps', - ]; - for (const methodName of uptimeCheckServiceStubMethods) { - const innerCallPromise = uptimeCheckServiceStub.then( - stub => (...args) => { - return stub[methodName].apply(stub, args); - }, - err => () => { - throw err; - } - ); - this._innerApiCalls[methodName] = gaxModule.createApiCall( - innerCallPromise, - defaults[methodName], - this._descriptors.page[methodName] - ); - } - } - - /** - * The DNS address for this API service. - */ - static get servicePath() { - return 'monitoring.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - */ - static get apiEndpoint() { - return 'monitoring.googleapis.com'; - } - - /** - * The port for this API service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/monitoring', - 'https://www.googleapis.com/auth/monitoring.read', - 'https://www.googleapis.com/auth/monitoring.write', - ]; - } - - /** - * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. - */ - getProjectId(callback) { - return this.auth.getProjectId(callback); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * Lists the existing valid Uptime check configurations for the project - * (leaving out any invalid configurations). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project whose Uptime check configurations are listed. The format - * is `projects/[PROJECT_ID]`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListUptimeCheckConfigsResponse]{@link google.monitoring.v3.ListUptimeCheckConfigsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListUptimeCheckConfigsResponse]{@link google.monitoring.v3.ListUptimeCheckConfigsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * const formattedParent = client.projectPath('[PROJECT]'); - * - * client.listUptimeCheckConfigs({parent: formattedParent}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * const formattedParent = client.projectPath('[PROJECT]'); - * - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listUptimeCheckConfigs(nextRequest, options).then(callback); - * } - * } - * client.listUptimeCheckConfigs({parent: formattedParent}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listUptimeCheckConfigs(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.listUptimeCheckConfigs( - request, - options, - callback - ); - } - - /** - * Equivalent to {@link listUptimeCheckConfigs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listUptimeCheckConfigs} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project whose Uptime check configurations are listed. The format - * is `projects/[PROJECT_ID]`. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * client.listUptimeCheckConfigsStream({parent: formattedParent}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listUptimeCheckConfigsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listUptimeCheckConfigs.createStream( - this._innerApiCalls.listUptimeCheckConfigs, - request, - options - ); - } - - /** - * Gets a single Uptime check configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Uptime check configuration to retrieve. The format - * is `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.uptimeCheckConfigPath('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - * client.getUptimeCheckConfig({name: formattedName}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - getUptimeCheckConfig(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.getUptimeCheckConfig(request, options, callback); - } - - /** - * Creates a new Uptime check configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project in which to create the Uptime check. The format - * is `projects/[PROJECT_ID]`. - * @param {Object} request.uptimeCheckConfig - * Required. The new Uptime check configuration. - * - * This object should have the same structure as [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedParent = client.projectPath('[PROJECT]'); - * const uptimeCheckConfig = {}; - * const request = { - * parent: formattedParent, - * uptimeCheckConfig: uptimeCheckConfig, - * }; - * client.createUptimeCheckConfig(request) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - createUptimeCheckConfig(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent, - }); - - return this._innerApiCalls.createUptimeCheckConfig( - request, - options, - callback - ); - } - - /** - * Updates an Uptime check configuration. You can either replace the entire - * configuration with a new one or replace only certain fields in the current - * configuration by specifying the fields to be updated via `updateMask`. - * Returns the updated configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {Object} request.uptimeCheckConfig - * Required. If an `updateMask` has been specified, this field gives - * the values for the set of fields mentioned in the `updateMask`. If an - * `updateMask` has not been given, this Uptime check configuration replaces - * the current configuration. If a field is mentioned in `updateMask` but - * the corresonding field is omitted in this partial Uptime check - * configuration, it has the effect of deleting/clearing the field from the - * configuration on the server. - * - * The following fields can be updated: `display_name`, - * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and - * `selected_regions`. - * - * This object should have the same structure as [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} - * @param {Object} [request.updateMask] - * Optional. If present, only the listed fields in the current Uptime check - * configuration are updated with values from the new configuration. If this - * field is empty, then the current configuration is completely replaced with - * the new configuration. - * - * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * const uptimeCheckConfig = {}; - * client.updateUptimeCheckConfig({uptimeCheckConfig: uptimeCheckConfig}) - * .then(responses => { - * const response = responses[0]; - * // doThingsWith(response) - * }) - * .catch(err => { - * console.error(err); - * }); - */ - updateUptimeCheckConfig(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'uptime_check_config.name': request.uptimeCheckConfig.name, - }); - - return this._innerApiCalls.updateUptimeCheckConfig( - request, - options, - callback - ); - } - - /** - * Deletes an Uptime check configuration. Note that this method will fail - * if the Uptime check configuration is referenced by an alert policy or - * other dependent configs that would be rendered invalid by the deletion. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The Uptime check configuration to delete. The format - * is `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error)} [callback] - * The function which will be called with the result of the API call. - * @returns {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * const formattedName = client.uptimeCheckConfigPath('[PROJECT]', '[UPTIME_CHECK_CONFIG]'); - * client.deleteUptimeCheckConfig({name: formattedName}).catch(err => { - * console.error(err); - * }); - */ - deleteUptimeCheckConfig(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name, - }); - - return this._innerApiCalls.deleteUptimeCheckConfig( - request, - options, - callback - ); - } - - /** - * Returns the list of IP addresses that checkers run from - * - * @param {Object} request - * The request object that will be sent. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Array, ?Object, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is Array of [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp}. - * - * When autoPaginate: false is specified through options, it contains the result - * in a single response. If the response indicates the next page exists, the third - * parameter is set to be used for the next request object. The fourth parameter keeps - * the raw response object of an object representing [ListUptimeCheckIpsResponse]{@link google.monitoring.v3.ListUptimeCheckIpsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp}. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp} in a single response. - * The second element is the next request object if the response - * indicates the next page exists, or null. The third element is - * an object representing [ListUptimeCheckIpsResponse]{@link google.monitoring.v3.ListUptimeCheckIpsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * // Iterate over all elements. - * client.listUptimeCheckIps({}) - * .then(responses => { - * const resources = responses[0]; - * for (const resource of resources) { - * // doThingsWith(resource) - * } - * }) - * .catch(err => { - * console.error(err); - * }); - * - * // Or obtain the paged response. - * - * const options = {autoPaginate: false}; - * const callback = responses => { - * // The actual resources in a response. - * const resources = responses[0]; - * // The next request if the response shows that there are more responses. - * const nextRequest = responses[1]; - * // The actual response object, if necessary. - * // const rawResponse = responses[2]; - * for (const resource of resources) { - * // doThingsWith(resource); - * } - * if (nextRequest) { - * // Fetch the next page. - * return client.listUptimeCheckIps(nextRequest, options).then(callback); - * } - * } - * client.listUptimeCheckIps({}, options) - * .then(callback) - * .catch(err => { - * console.error(err); - * }); - */ - listUptimeCheckIps(request, options, callback) { - if (options instanceof Function && callback === undefined) { - callback = options; - options = {}; - } - request = request || {}; - options = options || {}; - - return this._innerApiCalls.listUptimeCheckIps(request, options, callback); - } - - /** - * Equivalent to {@link listUptimeCheckIps}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listUptimeCheckIps} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * - * @param {Object} request - * The request object that will be sent. - * @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 [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @returns {Stream} - * An object stream which emits an object representing [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp} on 'data' event. - * - * @example - * - * const monitoring = require('@google-cloud/monitoring'); - * - * const client = new monitoring.v3.UptimeCheckServiceClient({ - * // optional auth parameters. - * }); - * - * - * client.listUptimeCheckIpsStream({}) - * .on('data', element => { - * // doThingsWith(element) - * }).on('error', err => { - * console.log(err); - * }); - */ - listUptimeCheckIpsStream(request, options) { - options = options || {}; - - return this._descriptors.page.listUptimeCheckIps.createStream( - this._innerApiCalls.listUptimeCheckIps, - request, - options - ); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified project resource name string. - * - * @param {String} project - * @returns {String} - */ - projectPath(project) { - return this._pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Return a fully-qualified uptime_check_config resource name string. - * - * @param {String} project - * @param {String} uptimeCheckConfig - * @returns {String} - */ - uptimeCheckConfigPath(project, uptimeCheckConfig) { - return this._pathTemplates.uptimeCheckConfigPathTemplate.render({ - project: project, - uptime_check_config: uptimeCheckConfig, - }); - } - - /** - * Parse the projectName from a project resource. - * - * @param {String} projectName - * A fully-qualified path representing a project resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromProjectName(projectName) { - return this._pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Parse the uptimeCheckConfigName from a uptime_check_config resource. - * - * @param {String} uptimeCheckConfigName - * A fully-qualified path representing a uptime_check_config resources. - * @returns {String} - A string representing the project. - */ - matchProjectFromUptimeCheckConfigName(uptimeCheckConfigName) { - return this._pathTemplates.uptimeCheckConfigPathTemplate.match( - uptimeCheckConfigName - ).project; - } - - /** - * Parse the uptimeCheckConfigName from a uptime_check_config resource. - * - * @param {String} uptimeCheckConfigName - * A fully-qualified path representing a uptime_check_config resources. - * @returns {String} - A string representing the uptime_check_config. - */ - matchUptimeCheckConfigFromUptimeCheckConfigName(uptimeCheckConfigName) { - return this._pathTemplates.uptimeCheckConfigPathTemplate.match( - uptimeCheckConfigName - ).uptime_check_config; - } -} - -module.exports = UptimeCheckServiceClient; diff --git a/src/v3/uptime_check_service_client.ts b/src/v3/uptime_check_service_client.ts new file mode 100644 index 00000000..7ebc5f5a --- /dev/null +++ b/src/v3/uptime_check_service_client.ts @@ -0,0 +1,2001 @@ +// Copyright 2019 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + PaginationResponse, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './uptime_check_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The UptimeCheckService API is used to manage (list, create, delete, edit) + * Uptime check configurations in the Stackdriver Monitoring product. An Uptime + * check is a piece of configuration that determines which resources and + * services to monitor for availability. These configurations can also be + * configured interactively by navigating to the [Cloud Console] + * (http://console.cloud.google.com), selecting the appropriate project, + * clicking on "Monitoring" on the left-hand side to navigate to Stackdriver, + * and then clicking on "Uptime". + * @class + * @memberof v3 + */ +export class UptimeCheckServiceClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + uptimeCheckServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UptimeCheckServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof UptimeCheckServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof UptimeCheckServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + folderAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/alertPolicies/{alert_policy}' + ), + folderChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannelDescriptors/{channel_descriptor}' + ), + folderGroupPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/groups/{group}' + ), + folderNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/notificationChannels/{notification_channel}' + ), + folderServicePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + folderServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + folderUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'folders/{folder}/uptimeCheckConfigs/{uptime_check_config}' + ), + organizationAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/alertPolicies/{alert_policy}' + ), + organizationChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}' + ), + organizationGroupPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/groups/{group}' + ), + organizationNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/notificationChannels/{notification_channel}' + ), + organizationServicePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + organizationServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + organizationUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}' + ), + projectPathTemplate: new gaxModule.PathTemplate('projects/{project}'), + projectAlertPolicyPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/alertPolicies/{alert_policy}' + ), + projectChannelDescriptorPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannelDescriptors/{channel_descriptor}' + ), + projectGroupPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/groups/{group}' + ), + projectNotificationChannelPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/notificationChannels/{notification_channel}' + ), + projectServicePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + projectServiceServiceLevelObjectivePathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}' + ), + projectUptimeCheckConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/uptimeCheckConfigs/{uptime_check_config}' + ), + }; + + // 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 = { + listUptimeCheckConfigs: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'uptimeCheckConfigs' + ), + listUptimeCheckIps: new gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'uptimeCheckIps' + ), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.monitoring.v3.UptimeCheckService', + 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 = {}; + + // Put together the "service stub" for + // google.monitoring.v3.UptimeCheckService. + this.uptimeCheckServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.monitoring.v3.UptimeCheckService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.monitoring.v3.UptimeCheckService, + opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const uptimeCheckServiceStubMethods = [ + 'listUptimeCheckConfigs', + 'getUptimeCheckConfig', + 'createUptimeCheckConfig', + 'updateUptimeCheckConfig', + 'deleteUptimeCheckConfig', + 'listUptimeCheckIps', + ]; + + for (const methodName of uptimeCheckServiceStubMethods) { + const innerCallPromise = this.uptimeCheckServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'monitoring.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'monitoring.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.read', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest | undefined, + {} | undefined + ] + >; + getUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets a single Uptime check configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Uptime check configuration to retrieve. The format + * is `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getUptimeCheckConfig(request, options, callback); + } + createUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + ( + | protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest + | undefined + ), + {} | undefined + ] + >; + createUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new Uptime check configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project in which to create the Uptime check. The format + * is `projects/[PROJECT_ID]`. + * @param {google.monitoring.v3.UptimeCheckConfig} request.uptimeCheckConfig + * Required. The new Uptime check configuration. + * @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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + ( + | protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createUptimeCheckConfig( + request, + options, + callback + ); + } + updateUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + ( + | protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Updates an Uptime check configuration. You can either replace the entire + * configuration with a new one or replace only certain fields in the current + * configuration by specifying the fields to be updated via `updateMask`. + * Returns the updated configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Optional. If present, only the listed fields in the current Uptime check + * configuration are updated with values from the new configuration. If this + * field is empty, then the current configuration is completely replaced with + * the new configuration. + * @param {google.monitoring.v3.UptimeCheckConfig} request.uptimeCheckConfig + * Required. If an `updateMask` has been specified, this field gives + * the values for the set of fields mentioned in the `updateMask`. If an + * `updateMask` has not been given, this Uptime check configuration replaces + * the current configuration. If a field is mentioned in `updateMask` but + * the corresonding field is omitted in this partial Uptime check + * configuration, it has the effect of deleting/clearing the field from the + * configuration on the server. + * + * The following fields can be updated: `display_name`, + * `http_check`, `tcp_check`, `timeout`, `content_matchers`, and + * `selected_regions`. + * @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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + | protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig, + ( + | protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + 'uptime_check_config.name': request.uptimeCheckConfig!.name || '', + }); + return this._innerApiCalls.updateUptimeCheckConfig( + request, + options, + callback + ); + } + deleteUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Deletes an Uptime check configuration. Note that this method will fail + * if the Uptime check configuration is referenced by an alert policy or + * other dependent configs that would be rendered invalid by the deletion. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Uptime check configuration to delete. The format + * is `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_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 [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteUptimeCheckConfig( + request: protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteUptimeCheckConfig( + request, + options, + callback + ); + } + + listUptimeCheckConfigs( + request: protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig[], + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsResponse + ] + >; + listUptimeCheckConfigs( + request: protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig[], + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsResponse + > + ): void; + /** + * Lists the existing valid Uptime check configurations for the project + * (leaving out any invalid configurations). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project whose Uptime check configurations are listed. The format + * is `projects/[PROJECT_ID]`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method 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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListUptimeCheckConfigsRequest]{@link google.monitoring.v3.ListUptimeCheckConfigsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListUptimeCheckConfigsResponse]{@link google.monitoring.v3.ListUptimeCheckConfigsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listUptimeCheckConfigs( + request: protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig[], + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckConfig[], + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckConfig[], + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckConfigsResponse + ] + > | void { + request = request || {}; + 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' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listUptimeCheckConfigs( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listUptimeCheckConfigs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listUptimeCheckConfigs} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project whose Uptime check configurations are listed. The format + * is `projects/[PROJECT_ID]`. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method 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 [UptimeCheckConfig]{@link google.monitoring.v3.UptimeCheckConfig} on 'data' event. + */ + listUptimeCheckConfigsStream( + request?: protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listUptimeCheckConfigs.createStream( + this._innerApiCalls.listUptimeCheckConfigs as gax.GaxCall, + request, + callSettings + ); + } + listUptimeCheckIps( + request: protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckIp[], + protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckIpsResponse + ] + >; + listUptimeCheckIps( + request: protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckIp[], + protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckIpsResponse + > + ): void; + /** + * Returns the list of IP addresses that checkers run from + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * NOTE: this field is not yet implemented + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * NOTE: this field is not yet implemented + * @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 [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp}. + * The client library support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListUptimeCheckIpsRequest]{@link google.monitoring.v3.ListUptimeCheckIpsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListUptimeCheckIpsResponse]{@link google.monitoring.v3.ListUptimeCheckIpsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listUptimeCheckIps( + request: protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.monitoring.v3.IUptimeCheckIp[], + protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckIpsResponse + >, + callback?: Callback< + protosTypes.google.monitoring.v3.IUptimeCheckIp[], + protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckIpsResponse + > + ): Promise< + [ + protosTypes.google.monitoring.v3.IUptimeCheckIp[], + protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest | null, + protosTypes.google.monitoring.v3.IListUptimeCheckIpsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + return this._innerApiCalls.listUptimeCheckIps(request, options, callback); + } + + /** + * Equivalent to {@link listUptimeCheckIps}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listUptimeCheckIps} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of results to return in a single response. The server + * may further constrain the maximum number of results returned in a single + * page. If the page_size is <=0, the server will decide the number of results + * to be returned. + * NOTE: this field is not yet implemented + * @param {string} request.pageToken + * If this field is not empty then it must contain the `nextPageToken` value + * returned by a previous call to this method. Using this field causes the + * method to return more results from the previous method call. + * NOTE: this field is not yet implemented + * @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 [UptimeCheckIp]{@link google.monitoring.v3.UptimeCheckIp} on 'data' event. + */ + listUptimeCheckIpsStream( + request?: protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + const callSettings = new gax.CallSettings(options); + return this._descriptors.page.listUptimeCheckIps.createStream( + this._innerApiCalls.listUptimeCheckIps as gax.GaxCall, + request, + callSettings + ); + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderAlertPolicy resource name string. + * + * @param {string} folder + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + folderAlertPolicyPath(folder: string, alertPolicy: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.render({ + folder, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the folder from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).folder; + } + + /** + * Parse the alert_policy from FolderAlertPolicy resource. + * + * @param {string} folderAlertPolicyName + * A fully-qualified path representing folder_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string) { + return this._pathTemplates.folderAlertPolicyPathTemplate.match( + folderAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified folderChannelDescriptor resource name string. + * + * @param {string} folder + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + folderChannelDescriptorPath(folder: string, channelDescriptor: string) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.render({ + folder, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the folder from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).folder; + } + + /** + * Parse the channel_descriptor from FolderChannelDescriptor resource. + * + * @param {string} folderChannelDescriptorName + * A fully-qualified path representing folder_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromFolderChannelDescriptorName( + folderChannelDescriptorName: string + ) { + return this._pathTemplates.folderChannelDescriptorPathTemplate.match( + folderChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified folderGroup resource name string. + * + * @param {string} folder + * @param {string} group + * @returns {string} Resource name string. + */ + folderGroupPath(folder: string, group: string) { + return this._pathTemplates.folderGroupPathTemplate.render({ + folder, + group, + }); + } + + /** + * Parse the folder from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .folder; + } + + /** + * Parse the group from FolderGroup resource. + * + * @param {string} folderGroupName + * A fully-qualified path representing folder_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromFolderGroupName(folderGroupName: string) { + return this._pathTemplates.folderGroupPathTemplate.match(folderGroupName) + .group; + } + + /** + * Return a fully-qualified folderNotificationChannel resource name string. + * + * @param {string} folder + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + folderNotificationChannelPath(folder: string, notificationChannel: string) { + return this._pathTemplates.folderNotificationChannelPathTemplate.render({ + folder, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the folder from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).folder; + } + + /** + * Parse the notification_channel from FolderNotificationChannel resource. + * + * @param {string} folderNotificationChannelName + * A fully-qualified path representing folder_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromFolderNotificationChannelName( + folderNotificationChannelName: string + ) { + return this._pathTemplates.folderNotificationChannelPathTemplate.match( + folderNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this._pathTemplates.folderServicePathTemplate.render({ + folder, + service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this._pathTemplates.folderServicePathTemplate.match( + folderServiceName + ).service; + } + + /** + * Return a fully-qualified folderServiceServiceLevelObjective resource name string. + * + * @param {string} folder + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + folderServiceServiceLevelObjectivePath( + folder: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.render( + { + folder, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the folder from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).folder; + } + + /** + * Parse the service from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from FolderServiceServiceLevelObjective resource. + * + * @param {string} folderServiceServiceLevelObjectiveName + * A fully-qualified path representing folder_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName( + folderServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.folderServiceServiceLevelObjectivePathTemplate.match( + folderServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified folderUptimeCheckConfig resource name string. + * + * @param {string} folder + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.render({ + folder, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the folder from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).folder; + } + + /** + * Parse the uptime_check_config from FolderUptimeCheckConfig resource. + * + * @param {string} folderUptimeCheckConfigName + * A fully-qualified path representing folder_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromFolderUptimeCheckConfigName( + folderUptimeCheckConfigName: string + ) { + return this._pathTemplates.folderUptimeCheckConfigPathTemplate.match( + folderUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Return a fully-qualified organizationAlertPolicy resource name string. + * + * @param {string} organization + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + organizationAlertPolicyPath(organization: string, alertPolicy: string) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.render({ + organization, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the organization from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).organization; + } + + /** + * Parse the alert_policy from OrganizationAlertPolicy resource. + * + * @param {string} organizationAlertPolicyName + * A fully-qualified path representing organization_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromOrganizationAlertPolicyName( + organizationAlertPolicyName: string + ) { + return this._pathTemplates.organizationAlertPolicyPathTemplate.match( + organizationAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified organizationChannelDescriptor resource name string. + * + * @param {string} organization + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + organizationChannelDescriptorPath( + organization: string, + channelDescriptor: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.render( + { + organization, + channel_descriptor: channelDescriptor, + } + ); + } + + /** + * Parse the organization from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).organization; + } + + /** + * Parse the channel_descriptor from OrganizationChannelDescriptor resource. + * + * @param {string} organizationChannelDescriptorName + * A fully-qualified path representing organization_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromOrganizationChannelDescriptorName( + organizationChannelDescriptorName: string + ) { + return this._pathTemplates.organizationChannelDescriptorPathTemplate.match( + organizationChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified organizationGroup resource name string. + * + * @param {string} organization + * @param {string} group + * @returns {string} Resource name string. + */ + organizationGroupPath(organization: string, group: string) { + return this._pathTemplates.organizationGroupPathTemplate.render({ + organization, + group, + }); + } + + /** + * Parse the organization from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).organization; + } + + /** + * Parse the group from OrganizationGroup resource. + * + * @param {string} organizationGroupName + * A fully-qualified path representing organization_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromOrganizationGroupName(organizationGroupName: string) { + return this._pathTemplates.organizationGroupPathTemplate.match( + organizationGroupName + ).group; + } + + /** + * Return a fully-qualified organizationNotificationChannel resource name string. + * + * @param {string} organization + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + organizationNotificationChannelPath( + organization: string, + notificationChannel: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.render( + { + organization, + notification_channel: notificationChannel, + } + ); + } + + /** + * Parse the organization from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).organization; + } + + /** + * Parse the notification_channel from OrganizationNotificationChannel resource. + * + * @param {string} organizationNotificationChannelName + * A fully-qualified path representing organization_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromOrganizationNotificationChannelName( + organizationNotificationChannelName: string + ) { + return this._pathTemplates.organizationNotificationChannelPathTemplate.match( + organizationNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this._pathTemplates.organizationServicePathTemplate.render({ + organization, + service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this._pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified organizationServiceServiceLevelObjective resource name string. + * + * @param {string} organization + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + organizationServiceServiceLevelObjectivePath( + organization: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.render( + { + organization, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the organization from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).organization; + } + + /** + * Parse the service from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource. + * + * @param {string} organizationServiceServiceLevelObjectiveName + * A fully-qualified path representing organization_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName( + organizationServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.organizationServiceServiceLevelObjectivePathTemplate.match( + organizationServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified organizationUptimeCheckConfig resource name string. + * + * @param {string} organization + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + organizationUptimeCheckConfigPath( + organization: string, + uptimeCheckConfig: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.render( + { + organization, + uptime_check_config: uptimeCheckConfig, + } + ); + } + + /** + * Parse the organization from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).organization; + } + + /** + * Parse the uptime_check_config from OrganizationUptimeCheckConfig resource. + * + * @param {string} organizationUptimeCheckConfigName + * A fully-qualified path representing organization_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName( + organizationUptimeCheckConfigName: string + ) { + return this._pathTemplates.organizationUptimeCheckConfigPathTemplate.match( + organizationUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * 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, + }); + } + + /** + * 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 projectAlertPolicy resource name string. + * + * @param {string} project + * @param {string} alert_policy + * @returns {string} Resource name string. + */ + projectAlertPolicyPath(project: string, alertPolicy: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.render({ + project, + alert_policy: alertPolicy, + }); + } + + /** + * Parse the project from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).project; + } + + /** + * Parse the alert_policy from ProjectAlertPolicy resource. + * + * @param {string} projectAlertPolicyName + * A fully-qualified path representing project_alert_policy resource. + * @returns {string} A string representing the alert_policy. + */ + matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string) { + return this._pathTemplates.projectAlertPolicyPathTemplate.match( + projectAlertPolicyName + ).alert_policy; + } + + /** + * Return a fully-qualified projectChannelDescriptor resource name string. + * + * @param {string} project + * @param {string} channel_descriptor + * @returns {string} Resource name string. + */ + projectChannelDescriptorPath(project: string, channelDescriptor: string) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.render({ + project, + channel_descriptor: channelDescriptor, + }); + } + + /** + * Parse the project from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).project; + } + + /** + * Parse the channel_descriptor from ProjectChannelDescriptor resource. + * + * @param {string} projectChannelDescriptorName + * A fully-qualified path representing project_channel_descriptor resource. + * @returns {string} A string representing the channel_descriptor. + */ + matchChannelDescriptorFromProjectChannelDescriptorName( + projectChannelDescriptorName: string + ) { + return this._pathTemplates.projectChannelDescriptorPathTemplate.match( + projectChannelDescriptorName + ).channel_descriptor; + } + + /** + * Return a fully-qualified projectGroup resource name string. + * + * @param {string} project + * @param {string} group + * @returns {string} Resource name string. + */ + projectGroupPath(project: string, group: string) { + return this._pathTemplates.projectGroupPathTemplate.render({ + project, + group, + }); + } + + /** + * Parse the project from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .project; + } + + /** + * Parse the group from ProjectGroup resource. + * + * @param {string} projectGroupName + * A fully-qualified path representing project_group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromProjectGroupName(projectGroupName: string) { + return this._pathTemplates.projectGroupPathTemplate.match(projectGroupName) + .group; + } + + /** + * Return a fully-qualified projectNotificationChannel resource name string. + * + * @param {string} project + * @param {string} notification_channel + * @returns {string} Resource name string. + */ + projectNotificationChannelPath(project: string, notificationChannel: string) { + return this._pathTemplates.projectNotificationChannelPathTemplate.render({ + project, + notification_channel: notificationChannel, + }); + } + + /** + * Parse the project from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).project; + } + + /** + * Parse the notification_channel from ProjectNotificationChannel resource. + * + * @param {string} projectNotificationChannelName + * A fully-qualified path representing project_notification_channel resource. + * @returns {string} A string representing the notification_channel. + */ + matchNotificationChannelFromProjectNotificationChannelName( + projectNotificationChannelName: string + ) { + return this._pathTemplates.projectNotificationChannelPathTemplate.match( + projectNotificationChannelName + ).notification_channel; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this._pathTemplates.projectServicePathTemplate.render({ + project, + service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this._pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } + + /** + * Return a fully-qualified projectServiceServiceLevelObjective resource name string. + * + * @param {string} project + * @param {string} service + * @param {string} service_level_objective + * @returns {string} Resource name string. + */ + projectServiceServiceLevelObjectivePath( + project: string, + service: string, + serviceLevelObjective: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.render( + { + project, + service, + service_level_objective: serviceLevelObjective, + } + ); + } + + /** + * Parse the project from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).project; + } + + /** + * Parse the service from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service; + } + + /** + * Parse the service_level_objective from ProjectServiceServiceLevelObjective resource. + * + * @param {string} projectServiceServiceLevelObjectiveName + * A fully-qualified path representing project_service_service_level_objective resource. + * @returns {string} A string representing the service_level_objective. + */ + matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName( + projectServiceServiceLevelObjectiveName: string + ) { + return this._pathTemplates.projectServiceServiceLevelObjectivePathTemplate.match( + projectServiceServiceLevelObjectiveName + ).service_level_objective; + } + + /** + * Return a fully-qualified projectUptimeCheckConfig resource name string. + * + * @param {string} project + * @param {string} uptime_check_config + * @returns {string} Resource name string. + */ + projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.render({ + project, + uptime_check_config: uptimeCheckConfig, + }); + } + + /** + * Parse the project from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).project; + } + + /** + * Parse the uptime_check_config from ProjectUptimeCheckConfig resource. + * + * @param {string} projectUptimeCheckConfigName + * A fully-qualified path representing project_uptime_check_config resource. + * @returns {string} A string representing the uptime_check_config. + */ + matchUptimeCheckConfigFromProjectUptimeCheckConfigName( + projectUptimeCheckConfigName: string + ) { + return this._pathTemplates.projectUptimeCheckConfigPathTemplate.match( + projectUptimeCheckConfigName + ).uptime_check_config; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.uptimeCheckServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v3/uptime_check_service_client_config.json b/src/v3/uptime_check_service_client_config.json index 11705881..90df7a47 100644 --- a/src/v3/uptime_check_service_client_config.json +++ b/src/v3/uptime_check_service_client_config.json @@ -2,53 +2,62 @@ "interfaces": { "google.monitoring.v3.UptimeCheckService": { "retry_codes": { + "non_idempotent": [], "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" - ], - "non_idempotent": [] + ] }, "retry_params": { "default": { "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "71ca22c74d2828b200f9ff1cc285a8beb96cc2af": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 } }, "methods": { "ListUptimeCheckConfigs": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "GetUptimeCheckConfig": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "CreateUptimeCheckConfig": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "UpdateUptimeCheckConfig": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "DeleteUptimeCheckConfig": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" }, "ListUptimeCheckIps": { - "timeout_millis": 60000, + "timeout_millis": 30000, "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_params_name": "71ca22c74d2828b200f9ff1cc285a8beb96cc2af" } } } diff --git a/src/v3/uptime_check_service_proto_list.json b/src/v3/uptime_check_service_proto_list.json index f504a3c2..0534dc6a 100644 --- a/src/v3/uptime_check_service_proto_list.json +++ b/src/v3/uptime_check_service_proto_list.json @@ -1,3 +1,18 @@ [ + "../../protos/google/monitoring/v3/alert.proto", + "../../protos/google/monitoring/v3/alert_service.proto", + "../../protos/google/monitoring/v3/common.proto", + "../../protos/google/monitoring/v3/dropped_labels.proto", + "../../protos/google/monitoring/v3/group.proto", + "../../protos/google/monitoring/v3/group_service.proto", + "../../protos/google/monitoring/v3/metric.proto", + "../../protos/google/monitoring/v3/metric_service.proto", + "../../protos/google/monitoring/v3/mutation_record.proto", + "../../protos/google/monitoring/v3/notification.proto", + "../../protos/google/monitoring/v3/notification_service.proto", + "../../protos/google/monitoring/v3/service.proto", + "../../protos/google/monitoring/v3/service_service.proto", + "../../protos/google/monitoring/v3/span_context.proto", + "../../protos/google/monitoring/v3/uptime.proto", "../../protos/google/monitoring/v3/uptime_service.proto" ] diff --git a/synth.metadata b/synth.metadata index 2eb4d0dd..7ff83528 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,27 +1,19 @@ { - "updateTime": "2020-01-31T12:25:54.656390Z", + "updateTime": "2020-02-11T08:09:54.291652Z", "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7", - "internalRef": "292450564", - "log": "7ac66d9be8a7d7de4f13566d8663978c9ee9dcd7\nAdd Dataproc Autoscaling API to V1.\n\nPiperOrigin-RevId: 292450564\n\n5d932b2c1be3a6ef487d094e3cf5c0673d0241dd\n- Improve documentation\n- Add a client_id field to StreamingPullRequest\n\nPiperOrigin-RevId: 292434036\n\neaff9fa8edec3e914995ce832b087039c5417ea7\nmonitoring: v3 publish annotations and client retry config\n\nPiperOrigin-RevId: 292425288\n\n70958bab8c5353870d31a23fb2c40305b050d3fe\nBigQuery Storage Read API v1 clients.\n\nPiperOrigin-RevId: 292407644\n\n7a15e7fe78ff4b6d5c9606a3264559e5bde341d1\nUpdate backend proto for Google Cloud Endpoints\n\nPiperOrigin-RevId: 292391607\n\n3ca2c014e24eb5111c8e7248b1e1eb833977c83d\nbazel: Add --flaky_test_attempts=3 argument to prevent CI failures caused by flaky tests\n\nPiperOrigin-RevId: 292382559\n\n9933347c1f677e81e19a844c2ef95bfceaf694fe\nbazel:Integrate latest protoc-java-resource-names-plugin changes (fix for PyYAML dependency in bazel rules)\n\nPiperOrigin-RevId: 292376626\n\nb835ab9d2f62c88561392aa26074c0b849fb0bd3\nasset: v1p2beta1 add client config annotations\n\n* remove unintentionally exposed RPCs\n* remove messages relevant to removed RPCs\n\nPiperOrigin-RevId: 292369593\n\nc1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" + "sha": "5006247aa157e59118833658084345ee59af7c09", + "internalRef": "294383128" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], @@ -31,9 +23,8 @@ "source": "googleapis", "apiName": "monitoring", "apiVersion": "v3", - "language": "nodejs", - "generator": "gapic", - "config": "google/monitoring/artman_monitoring.yaml" + "language": "typescript", + "generator": "gapic-generator-typescript" } } ] diff --git a/synth.py b/synth.py index eecaea25..47c5379e 100644 --- a/synth.py +++ b/synth.py @@ -20,31 +20,57 @@ import logging logging.basicConfig(level=logging.DEBUG) -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICMicrogenerator() version = "v3" -library = gapic.node_library( - "monitoring", version, config_path="/google/monitoring/artman_monitoring.yaml" +library = gapic.typescript_library( + "monitoring", + version, + generator_args={ + "grpc-service-config": f"google/monitoring/{version}/monitoring_grpc_service_config.json", + "package-name": f"@google-cloud/monitoring", + "main-service": f"monitoring" + }, + proto_path=f'/google/monitoring/{version}', + extra_proto_files=['google/cloud/common_resources.proto'] ) -s.copy(library, excludes=["src/index.js", "README.md", "package.json"]) + +s.copy(library, excludes=["src/index.ts", "README.md", "package.json"]) common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +templates = common_templates.node_library(source_location='build/src') s.copy(templates) # [START fix-dead-link] s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', - r"https://\1)") + 'https:\/\/cloud\.google\.com[\s\*]*http:\/\/(.*)[\s\*]*\)', + r"https://\1)") s.replace('**/doc/google/protobuf/doc_timestamp.js', - 'toISOString\]', - 'toISOString)') + 'toISOString\]', + 'toISOString)') # [END fix-dead-link] s.replace('src/**/doc/google/api/doc_distribution.js', - r"Sum\[i=1\.\.n\]\(https:\/\/cloud\.google\.com\(x_i - mean\)\^2\)", - "Sum\[i=1..n](x_1 - mean)^2") + r"Sum\[i=1\.\.n\]\(https:\/\/cloud\.google\.com\(x_i - mean\)\^2\)", + "Sum\[i=1..n](x_1 - mean)^2") + +s.replace('src/v3/*.ts', + '/monitoring/api/learn_more', + 'https://cloud.google.com/monitoring/api/learn_more') + +s.replace('src/v3/*.ts', + '/monitoring/custom-metrics', + 'https://cloud.google.com/monitoring/custom-metrics') + +s.replace('src/v3/*.ts', + '/monitoring/api/v3/sorting-and-filtering', + 'https://cloud.google.com/monitoring/api/v3/sorting-and-filtering') + +s.replace('src/v3/*.ts', + '/monitoring/api/v3/filters', + 'https://cloud.google.com/monitoring/api/v3/filters') subprocess.run(["npm", "install"]) subprocess.run(["npm", "run", "fix"]) +subprocess.run(['npx', 'compileProtos', 'src']) diff --git a/system-test/fixtures/sample/src/index.js b/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..001f06d4 --- /dev/null +++ b/system-test/fixtures/sample/src/index.js @@ -0,0 +1,32 @@ +// Copyright 2019 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 monitoring = require('@google-cloud/monitoring'); + +function main() { + const alertPolicyServiceClient = new monitoring.AlertPolicyServiceClient(); + const groupServiceClient = new monitoring.GroupServiceClient(); + const metricServiceClient = new monitoring.MetricServiceClient(); + const notificationChannelServiceClient = new monitoring.NotificationChannelServiceClient(); + const serviceMonitoringServiceClient = new monitoring.ServiceMonitoringServiceClient(); + const uptimeCheckServiceClient = new monitoring.UptimeCheckServiceClient(); +} + +main(); diff --git a/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..a493300d --- /dev/null +++ b/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,30 @@ +// Copyright 2019 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 {AlertPolicyServiceClient, GroupServiceClient, MetricServiceClient, NotificationChannelServiceClient, ServiceMonitoringServiceClient, UptimeCheckServiceClient} from '@google-cloud/monitoring'; + +function main() { + const alertPolicyServiceClient = new AlertPolicyServiceClient(); + const groupServiceClient = new GroupServiceClient(); + const metricServiceClient = new MetricServiceClient(); + const notificationChannelServiceClient = new NotificationChannelServiceClient(); + const serviceMonitoringServiceClient = new ServiceMonitoringServiceClient(); + const uptimeCheckServiceClient = new UptimeCheckServiceClient(); +} + +main(); diff --git a/system-test/install.ts b/system-test/install.ts new file mode 100644 index 00000000..c9aa74ec --- /dev/null +++ b/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 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('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/system-test/metric_service_smoke_test.js b/system-test/metrics_service_smoke_test.ts similarity index 94% rename from system-test/metric_service_smoke_test.js rename to system-test/metrics_service_smoke_test.ts index 4791222a..efd9be65 100644 --- a/system-test/metric_service_smoke_test.js +++ b/system-test/metrics_service_smoke_test.ts @@ -12,9 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -'use strict'; - -const {describe, it} = require('mocha'); +import {describe, it} from 'mocha'; describe('MetricServiceSmokeTest', () => { if (!process.env.GCLOUD_PROJECT) { @@ -34,7 +32,7 @@ describe('MetricServiceSmokeTest', () => { client .listMonitoredResourceDescriptors({name: formattedName}) - .then(responses => { + .then((responses: string[]) => { const resources = responses[0]; for (let i = 0; i < resources.length; i += 1) { console.log(resources[i]); @@ -55,7 +53,7 @@ describe('MetricServiceSmokeTest', () => { const formattedName = client.projectPath(projectId); const options = {autoPaginate: false}; - const callback = responses => { + const callback = (responses: string[]) => { // The actual resources in a response. const resources = responses[0]; // The next request if the response shows that there are more responses. @@ -89,7 +87,7 @@ describe('MetricServiceSmokeTest', () => { const formattedName = client.projectPath(projectId); client .listMonitoredResourceDescriptorsStream({name: formattedName}) - .on('data', element => { + .on('data', (element: string) => { console.log(element); }) .on('error', done) diff --git a/test/gapic-alert_policy_service-v3.ts b/test/gapic-alert_policy_service-v3.ts new file mode 100644 index 00000000..90f52dc3 --- /dev/null +++ b/test/gapic-alert_policy_service-v3.ts @@ -0,0 +1,339 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const alertpolicyserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v3.AlertPolicyServiceClient', () => { + it('has servicePath', () => { + const servicePath = + alertpolicyserviceModule.v3.AlertPolicyServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + alertpolicyserviceModule.v3.AlertPolicyServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = alertpolicyserviceModule.v3.AlertPolicyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('getAlertPolicy', () => { + it('invokes getAlertPolicy without error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetAlertPolicyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getAlertPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getAlertPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getAlertPolicy with error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetAlertPolicyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getAlertPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getAlertPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createAlertPolicy', () => { + it('invokes createAlertPolicy without error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAlertPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createAlertPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createAlertPolicy with error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateAlertPolicyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createAlertPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createAlertPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteAlertPolicy', () => { + it('invokes deleteAlertPolicy without error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteAlertPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteAlertPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteAlertPolicy with error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteAlertPolicyRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteAlertPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteAlertPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateAlertPolicy', () => { + it('invokes updateAlertPolicy without error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest = {}; + request.alertPolicy = {}; + request.alertPolicy.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateAlertPolicy = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateAlertPolicy(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateAlertPolicy with error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateAlertPolicyRequest = {}; + request.alertPolicy = {}; + request.alertPolicy.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateAlertPolicy = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateAlertPolicy(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listAlertPolicies', () => { + it('invokes listAlertPolicies without error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListAlertPoliciesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listAlertPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listAlertPolicies(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listAlertPoliciesStream', () => { + it('invokes listAlertPoliciesStream without error', done => { + const client = new alertpolicyserviceModule.v3.AlertPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListAlertPoliciesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listAlertPolicies = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listAlertPoliciesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-group_service-v3.ts b/test/gapic-group_service-v3.ts new file mode 100644 index 00000000..89a5260a --- /dev/null +++ b/test/gapic-group_service-v3.ts @@ -0,0 +1,396 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const groupserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v3.GroupServiceClient', () => { + it('has servicePath', () => { + const servicePath = groupserviceModule.v3.GroupServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = groupserviceModule.v3.GroupServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = groupserviceModule.v3.GroupServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new groupserviceModule.v3.GroupServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new groupserviceModule.v3.GroupServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('getGroup', () => { + it('invokes getGroup without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetGroupRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGroup = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGroup(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGroup with error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetGroupRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGroup = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGroup(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createGroup', () => { + it('invokes createGroup without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateGroupRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGroup = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createGroup(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createGroup with error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateGroupRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGroup = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createGroup(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateGroup', () => { + it('invokes updateGroup without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateGroupRequest = {}; + request.group = {}; + request.group.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGroup = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateGroup(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateGroup with error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateGroupRequest = {}; + request.group = {}; + request.group.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGroup = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateGroup(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteGroup', () => { + it('invokes deleteGroup without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteGroupRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGroup = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteGroup(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteGroup with error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteGroupRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGroup = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteGroup(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listGroups', () => { + it('invokes listGroups without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListGroupsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listGroups = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listGroups(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listGroupsStream', () => { + it('invokes listGroupsStream without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListGroupsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listGroups = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listGroupsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listGroupMembers', () => { + it('invokes listGroupMembers without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListGroupMembersRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listGroupMembers = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listGroupMembers(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listGroupMembersStream', () => { + it('invokes listGroupMembersStream without error', done => { + const client = new groupserviceModule.v3.GroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListGroupMembersRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listGroupMembers = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listGroupMembersStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-metric_service-v3.ts b/test/gapic-metric_service-v3.ts new file mode 100644 index 00000000..b707732b --- /dev/null +++ b/test/gapic-metric_service-v3.ts @@ -0,0 +1,510 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const metricserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v3.MetricServiceClient', () => { + it('has servicePath', () => { + const servicePath = metricserviceModule.v3.MetricServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = metricserviceModule.v3.MetricServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = metricserviceModule.v3.MetricServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new metricserviceModule.v3.MetricServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new metricserviceModule.v3.MetricServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('getMonitoredResourceDescriptor', () => { + it('invokes getMonitoredResourceDescriptor without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getMonitoredResourceDescriptor = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getMonitoredResourceDescriptor( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes getMonitoredResourceDescriptor with error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetMonitoredResourceDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getMonitoredResourceDescriptor = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getMonitoredResourceDescriptor( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getMetricDescriptor', () => { + it('invokes getMetricDescriptor without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getMetricDescriptor = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getMetricDescriptor(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getMetricDescriptor with error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetMetricDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getMetricDescriptor = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getMetricDescriptor(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createMetricDescriptor', () => { + it('invokes createMetricDescriptor without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createMetricDescriptor = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createMetricDescriptor(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createMetricDescriptor with error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateMetricDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createMetricDescriptor = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createMetricDescriptor(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteMetricDescriptor', () => { + it('invokes deleteMetricDescriptor without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteMetricDescriptor = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteMetricDescriptor(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteMetricDescriptor with error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteMetricDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteMetricDescriptor = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteMetricDescriptor(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createTimeSeries', () => { + it('invokes createTimeSeries without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createTimeSeries = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createTimeSeries(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createTimeSeries with error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateTimeSeriesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createTimeSeries = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createTimeSeries(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('listMonitoredResourceDescriptors', () => { + it('invokes listMonitoredResourceDescriptors without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listMonitoredResourceDescriptors = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listMonitoredResourceDescriptors( + request, + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + }); + describe('listMonitoredResourceDescriptorsStream', () => { + it('invokes listMonitoredResourceDescriptorsStream without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListMonitoredResourceDescriptorsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listMonitoredResourceDescriptors = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listMonitoredResourceDescriptorsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listMetricDescriptors', () => { + it('invokes listMetricDescriptors without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listMetricDescriptors = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listMetricDescriptors(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listMetricDescriptorsStream', () => { + it('invokes listMetricDescriptorsStream without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListMetricDescriptorsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listMetricDescriptors = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listMetricDescriptorsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listTimeSeries', () => { + it('invokes listTimeSeries without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListTimeSeriesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listTimeSeries = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listTimeSeries(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listTimeSeriesStream', () => { + it('invokes listTimeSeriesStream without error', done => { + const client = new metricserviceModule.v3.MetricServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListTimeSeriesRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listTimeSeries = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listTimeSeriesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-notification_channel_service-v3.ts b/test/gapic-notification_channel_service-v3.ts new file mode 100644 index 00000000..ed4961d6 --- /dev/null +++ b/test/gapic-notification_channel_service-v3.ts @@ -0,0 +1,671 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const notificationchannelserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v3.NotificationChannelServiceClient', () => { + it('has servicePath', () => { + const servicePath = + notificationchannelserviceModule.v3.NotificationChannelServiceClient + .servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + notificationchannelserviceModule.v3.NotificationChannelServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = + notificationchannelserviceModule.v3.NotificationChannelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + describe('getNotificationChannelDescriptor', () => { + it('invokes getNotificationChannelDescriptor without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationChannelDescriptor = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getNotificationChannelDescriptor( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes getNotificationChannelDescriptor with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetNotificationChannelDescriptorRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationChannelDescriptor = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getNotificationChannelDescriptor( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getNotificationChannel', () => { + it('invokes getNotificationChannel without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationChannel = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getNotificationChannel(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getNotificationChannel with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationChannel = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getNotificationChannel(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createNotificationChannel', () => { + it('invokes createNotificationChannel without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createNotificationChannel = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createNotificationChannel(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createNotificationChannel with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createNotificationChannel = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createNotificationChannel( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateNotificationChannel', () => { + it('invokes updateNotificationChannel without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest = {}; + request.notificationChannel = {}; + request.notificationChannel.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateNotificationChannel = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateNotificationChannel(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateNotificationChannel with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateNotificationChannelRequest = {}; + request.notificationChannel = {}; + request.notificationChannel.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateNotificationChannel = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateNotificationChannel( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('deleteNotificationChannel', () => { + it('invokes deleteNotificationChannel without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteNotificationChannel = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteNotificationChannel(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteNotificationChannel with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteNotificationChannel = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteNotificationChannel( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('sendNotificationChannelVerificationCode', () => { + it('invokes sendNotificationChannelVerificationCode without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.sendNotificationChannelVerificationCode = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.sendNotificationChannelVerificationCode( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes sendNotificationChannelVerificationCode with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.sendNotificationChannelVerificationCode = mockSimpleGrpcMethod( + request, + null, + error + ); + client.sendNotificationChannelVerificationCode( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getNotificationChannelVerificationCode', () => { + it('invokes getNotificationChannelVerificationCode without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationChannelVerificationCode = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getNotificationChannelVerificationCode( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes getNotificationChannelVerificationCode with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getNotificationChannelVerificationCode = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getNotificationChannelVerificationCode( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('verifyNotificationChannel', () => { + it('invokes verifyNotificationChannel without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.verifyNotificationChannel = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.verifyNotificationChannel(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes verifyNotificationChannel with error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IVerifyNotificationChannelRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.verifyNotificationChannel = mockSimpleGrpcMethod( + request, + null, + error + ); + client.verifyNotificationChannel( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('listNotificationChannelDescriptors', () => { + it('invokes listNotificationChannelDescriptors without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listNotificationChannelDescriptors = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listNotificationChannelDescriptors( + request, + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + }); + describe('listNotificationChannelDescriptorsStream', () => { + it('invokes listNotificationChannelDescriptorsStream without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListNotificationChannelDescriptorsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listNotificationChannelDescriptors = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listNotificationChannelDescriptorsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listNotificationChannels', () => { + it('invokes listNotificationChannels without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListNotificationChannelsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listNotificationChannels = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listNotificationChannels( + request, + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + }); + describe('listNotificationChannelsStream', () => { + it('invokes listNotificationChannelsStream without error', done => { + const client = new notificationchannelserviceModule.v3.NotificationChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListNotificationChannelsRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listNotificationChannels = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listNotificationChannelsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-service_monitoring_service-v3.ts b/test/gapic-service_monitoring_service-v3.ts new file mode 100644 index 00000000..d6b905d5 --- /dev/null +++ b/test/gapic-service_monitoring_service-v3.ts @@ -0,0 +1,652 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const servicemonitoringserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v3.ServiceMonitoringServiceClient', () => { + it('has servicePath', () => { + const servicePath = + servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient + .servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = + servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + describe('createService', () => { + it('invokes createService without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateServiceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createService = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createService(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createService with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateServiceRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createService = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createService(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getService', () => { + it('invokes getService without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetServiceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getService = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getService(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getService with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetServiceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getService = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getService(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('updateService', () => { + it('invokes updateService without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateServiceRequest = {}; + request.service = {}; + request.service.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateService = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateService(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateService with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateServiceRequest = {}; + request.service = {}; + request.service.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateService = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateService(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('deleteService', () => { + it('invokes deleteService without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteServiceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteService = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteService(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteService with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteServiceRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteService = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteService(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createServiceLevelObjective', () => { + it('invokes createServiceLevelObjective without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createServiceLevelObjective(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createServiceLevelObjective with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateServiceLevelObjectiveRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createServiceLevelObjective( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getServiceLevelObjective', () => { + it('invokes getServiceLevelObjective without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getServiceLevelObjective(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getServiceLevelObjective with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetServiceLevelObjectiveRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getServiceLevelObjective( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateServiceLevelObjective', () => { + it('invokes updateServiceLevelObjective without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest = {}; + request.serviceLevelObjective = {}; + request.serviceLevelObjective.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateServiceLevelObjective(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateServiceLevelObjective with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateServiceLevelObjectiveRequest = {}; + request.serviceLevelObjective = {}; + request.serviceLevelObjective.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateServiceLevelObjective( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('deleteServiceLevelObjective', () => { + it('invokes deleteServiceLevelObjective without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteServiceLevelObjective = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteServiceLevelObjective(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteServiceLevelObjective with error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteServiceLevelObjectiveRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteServiceLevelObjective = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteServiceLevelObjective( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('listServices', () => { + it('invokes listServices without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListServicesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listServices = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listServices(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listServicesStream', () => { + it('invokes listServicesStream without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListServicesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listServices = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listServicesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listServiceLevelObjectives', () => { + it('invokes listServiceLevelObjectives without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listServiceLevelObjectives = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listServiceLevelObjectives( + request, + (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + }); + describe('listServiceLevelObjectivesStream', () => { + it('invokes listServiceLevelObjectivesStream without error', done => { + const client = new servicemonitoringserviceModule.v3.ServiceMonitoringServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.monitoring.v3.IListServiceLevelObjectivesRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listServiceLevelObjectives = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listServiceLevelObjectivesStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-uptime_check_service-v3.ts b/test/gapic-uptime_check_service-v3.ts new file mode 100644 index 00000000..3266e39e --- /dev/null +++ b/test/gapic-uptime_check_service-v3.ts @@ -0,0 +1,405 @@ +// Copyright 2019 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const uptimecheckserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +describe('v3.UptimeCheckServiceClient', () => { + it('has servicePath', () => { + const servicePath = + uptimecheckserviceModule.v3.UptimeCheckServiceClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + uptimecheckserviceModule.v3.UptimeCheckServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = uptimecheckserviceModule.v3.UptimeCheckServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + fallback: true, + }); + assert(client); + }); + describe('getUptimeCheckConfig', () => { + it('invokes getUptimeCheckConfig without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getUptimeCheckConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getUptimeCheckConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getUptimeCheckConfig with error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IGetUptimeCheckConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getUptimeCheckConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getUptimeCheckConfig(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createUptimeCheckConfig', () => { + it('invokes createUptimeCheckConfig without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createUptimeCheckConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createUptimeCheckConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createUptimeCheckConfig with error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.ICreateUptimeCheckConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createUptimeCheckConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createUptimeCheckConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('updateUptimeCheckConfig', () => { + it('invokes updateUptimeCheckConfig without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest = {}; + request.uptimeCheckConfig = {}; + request.uptimeCheckConfig.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateUptimeCheckConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.updateUptimeCheckConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes updateUptimeCheckConfig with error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IUpdateUptimeCheckConfigRequest = {}; + request.uptimeCheckConfig = {}; + request.uptimeCheckConfig.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateUptimeCheckConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.updateUptimeCheckConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('deleteUptimeCheckConfig', () => { + it('invokes deleteUptimeCheckConfig without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteUptimeCheckConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.deleteUptimeCheckConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes deleteUptimeCheckConfig with error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IDeleteUptimeCheckConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteUptimeCheckConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.deleteUptimeCheckConfig( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('listUptimeCheckConfigs', () => { + it('invokes listUptimeCheckConfigs without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listUptimeCheckConfigs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listUptimeCheckConfigs(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listUptimeCheckConfigsStream', () => { + it('invokes listUptimeCheckConfigsStream without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListUptimeCheckConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listUptimeCheckConfigs = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listUptimeCheckConfigsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); + describe('listUptimeCheckIps', () => { + it('invokes listUptimeCheckIps without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest = {}; + // Mock response + const expectedResponse = {}; + // Mock Grpc layer + client._innerApiCalls.listUptimeCheckIps = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + client.listUptimeCheckIps(request, (err: FakeError, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + }); + describe('listUptimeCheckIpsStream', () => { + it('invokes listUptimeCheckIpsStream without error', done => { + const client = new uptimecheckserviceModule.v3.UptimeCheckServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.monitoring.v3.IListUptimeCheckIpsRequest = {}; + // Mock response + const expectedResponse = {response: 'data'}; + // Mock Grpc layer + client._innerApiCalls.listUptimeCheckIps = ( + actualRequest: {}, + options: {}, + callback: Callback + ) => { + assert.deepStrictEqual(actualRequest, request); + callback(null, expectedResponse); + }; + const stream = client + .listUptimeCheckIpsStream(request, {}) + .on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }) + .on('error', (err: FakeError) => { + done(err); + }); + stream.write(expectedResponse); + }); + }); +}); diff --git a/test/gapic-v3.js b/test/gapic-v3.js deleted file mode 100644 index ff6cca81..00000000 --- a/test/gapic-v3.js +++ /dev/null @@ -1,3170 +0,0 @@ -// Copyright 2020 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. - -'use strict'; - -const assert = require('assert'); -const {describe, it} = require('mocha'); - -const monitoringModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -const error = new Error(); -error.code = FAKE_STATUS_CODE; - -describe('AlertPolicyServiceClient', () => { - it('has servicePath', () => { - const servicePath = - monitoringModule.v3.AlertPolicyServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - monitoringModule.v3.AlertPolicyServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = monitoringModule.v3.AlertPolicyServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new monitoringModule.v3.AlertPolicyServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('listAlertPolicies', () => { - it('invokes listAlertPolicies without error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const alertPoliciesElement = {}; - const alertPolicies = [alertPoliciesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - alertPolicies: alertPolicies, - }; - - // Mock Grpc layer - client._innerApiCalls.listAlertPolicies = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.alertPolicies); - }; - - client.listAlertPolicies(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.alertPolicies); - done(); - }); - }); - - it('invokes listAlertPolicies with error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listAlertPolicies = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listAlertPolicies(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getAlertPolicy', () => { - it('invokes getAlertPolicy without error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.alertPolicyPath( - '[PROJECT]', - '[ALERT_POLICY]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.getAlertPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getAlertPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getAlertPolicy with error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.alertPolicyPath( - '[PROJECT]', - '[ALERT_POLICY]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getAlertPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getAlertPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createAlertPolicy', () => { - it('invokes createAlertPolicy without error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const alertPolicy = {}; - const request = { - name: formattedName, - alertPolicy: alertPolicy, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.createAlertPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createAlertPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createAlertPolicy with error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const alertPolicy = {}; - const request = { - name: formattedName, - alertPolicy: alertPolicy, - }; - - // Mock Grpc layer - client._innerApiCalls.createAlertPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createAlertPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteAlertPolicy', () => { - it('invokes deleteAlertPolicy without error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.alertPolicyPath( - '[PROJECT]', - '[ALERT_POLICY]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteAlertPolicy = mockSimpleGrpcMethod(request); - - client.deleteAlertPolicy(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteAlertPolicy with error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.alertPolicyPath( - '[PROJECT]', - '[ALERT_POLICY]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteAlertPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteAlertPolicy(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('updateAlertPolicy', () => { - it('invokes updateAlertPolicy without error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const alertPolicy = {}; - const request = { - alertPolicy: alertPolicy, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.updateAlertPolicy = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateAlertPolicy(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateAlertPolicy with error', done => { - const client = new monitoringModule.v3.AlertPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const alertPolicy = {}; - const request = { - alertPolicy: alertPolicy, - }; - - // Mock Grpc layer - client._innerApiCalls.updateAlertPolicy = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateAlertPolicy(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); -describe('GroupServiceClient', () => { - it('has servicePath', () => { - const servicePath = monitoringModule.v3.GroupServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = monitoringModule.v3.GroupServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = monitoringModule.v3.GroupServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new monitoringModule.v3.GroupServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new monitoringModule.v3.GroupServiceClient({fallback: true}); - assert(client); - }); - - describe('listGroups', () => { - it('invokes listGroups without error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const groupElement = {}; - const group = [groupElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - group: group, - }; - - // Mock Grpc layer - client._innerApiCalls.listGroups = (actualRequest, options, callback) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.group); - }; - - client.listGroups(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.group); - done(); - }); - }); - - it('invokes listGroups with error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listGroups = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listGroups(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getGroup', () => { - it('invokes getGroup without error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const parentName = 'parentName1015022848'; - const filter = 'filter-1274492040'; - const isCluster = false; - const expectedResponse = { - name: name2, - displayName: displayName, - parentName: parentName, - filter: filter, - isCluster: isCluster, - }; - - // Mock Grpc layer - client._innerApiCalls.getGroup = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getGroup(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGroup with error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getGroup = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getGroup(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createGroup', () => { - it('invokes createGroup without error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const group = {}; - const request = { - name: formattedName, - group: group, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const parentName = 'parentName1015022848'; - const filter = 'filter-1274492040'; - const isCluster = false; - const expectedResponse = { - name: name2, - displayName: displayName, - parentName: parentName, - filter: filter, - isCluster: isCluster, - }; - - // Mock Grpc layer - client._innerApiCalls.createGroup = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createGroup(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createGroup with error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const group = {}; - const request = { - name: formattedName, - group: group, - }; - - // Mock Grpc layer - client._innerApiCalls.createGroup = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createGroup(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateGroup', () => { - it('invokes updateGroup without error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const group = {}; - const request = { - group: group, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const parentName = 'parentName1015022848'; - const filter = 'filter-1274492040'; - const isCluster = false; - const expectedResponse = { - name: name, - displayName: displayName, - parentName: parentName, - filter: filter, - isCluster: isCluster, - }; - - // Mock Grpc layer - client._innerApiCalls.updateGroup = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateGroup(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateGroup with error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const group = {}; - const request = { - group: group, - }; - - // Mock Grpc layer - client._innerApiCalls.updateGroup = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateGroup(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteGroup', () => { - it('invokes deleteGroup without error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteGroup = mockSimpleGrpcMethod(request); - - client.deleteGroup(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteGroup with error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteGroup = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteGroup(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('listGroupMembers', () => { - it('invokes listGroupMembers without error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const membersElement = {}; - const members = [membersElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - members: members, - }; - - // Mock Grpc layer - client._innerApiCalls.listGroupMembers = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.members); - }; - - client.listGroupMembers(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.members); - done(); - }); - }); - - it('invokes listGroupMembers with error', done => { - const client = new monitoringModule.v3.GroupServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.groupPath('[PROJECT]', '[GROUP]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listGroupMembers = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listGroupMembers(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); -describe('MetricServiceClient', () => { - it('has servicePath', () => { - const servicePath = monitoringModule.v3.MetricServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = monitoringModule.v3.MetricServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = monitoringModule.v3.MetricServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new monitoringModule.v3.MetricServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new monitoringModule.v3.MetricServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('listMonitoredResourceDescriptors', () => { - it('invokes listMonitoredResourceDescriptors without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const resourceDescriptorsElement = {}; - const resourceDescriptors = [resourceDescriptorsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - resourceDescriptors: resourceDescriptors, - }; - - // Mock Grpc layer - client._innerApiCalls.listMonitoredResourceDescriptors = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.resourceDescriptors); - }; - - client.listMonitoredResourceDescriptors(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.resourceDescriptors); - done(); - }); - }); - - it('invokes listMonitoredResourceDescriptors with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listMonitoredResourceDescriptors = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listMonitoredResourceDescriptors(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getMonitoredResourceDescriptor', () => { - it('invokes getMonitoredResourceDescriptor without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.monitoredResourceDescriptorPath( - '[PROJECT]', - '[MONITORED_RESOURCE_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const type = 'type3575610'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - type: type, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getMonitoredResourceDescriptor = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getMonitoredResourceDescriptor(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getMonitoredResourceDescriptor with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.monitoredResourceDescriptorPath( - '[PROJECT]', - '[MONITORED_RESOURCE_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getMonitoredResourceDescriptor = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getMonitoredResourceDescriptor(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listMetricDescriptors', () => { - it('invokes listMetricDescriptors without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const metricDescriptorsElement = {}; - const metricDescriptors = [metricDescriptorsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - metricDescriptors: metricDescriptors, - }; - - // Mock Grpc layer - client._innerApiCalls.listMetricDescriptors = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.metricDescriptors); - }; - - client.listMetricDescriptors(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.metricDescriptors); - done(); - }); - }); - - it('invokes listMetricDescriptors with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listMetricDescriptors = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listMetricDescriptors(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getMetricDescriptor', () => { - it('invokes getMetricDescriptor without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.metricDescriptorPath( - '[PROJECT]', - '[METRIC_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const type = 'type3575610'; - const unit = 'unit3594628'; - const description = 'description-1724546052'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - type: type, - unit: unit, - description: description, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.getMetricDescriptor = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getMetricDescriptor(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getMetricDescriptor with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.metricDescriptorPath( - '[PROJECT]', - '[METRIC_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getMetricDescriptor = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getMetricDescriptor(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createMetricDescriptor', () => { - it('invokes createMetricDescriptor without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const metricDescriptor = {}; - const request = { - name: formattedName, - metricDescriptor: metricDescriptor, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const type = 'type3575610'; - const unit = 'unit3594628'; - const description = 'description-1724546052'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - type: type, - unit: unit, - description: description, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.createMetricDescriptor = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createMetricDescriptor(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createMetricDescriptor with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const metricDescriptor = {}; - const request = { - name: formattedName, - metricDescriptor: metricDescriptor, - }; - - // Mock Grpc layer - client._innerApiCalls.createMetricDescriptor = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createMetricDescriptor(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteMetricDescriptor', () => { - it('invokes deleteMetricDescriptor without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.metricDescriptorPath( - '[PROJECT]', - '[METRIC_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteMetricDescriptor = mockSimpleGrpcMethod( - request - ); - - client.deleteMetricDescriptor(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteMetricDescriptor with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.metricDescriptorPath( - '[PROJECT]', - '[METRIC_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteMetricDescriptor = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteMetricDescriptor(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('listTimeSeries', () => { - it('invokes listTimeSeries without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const filter = 'filter-1274492040'; - const interval = {}; - const view = 'FULL'; - const request = { - name: formattedName, - filter: filter, - interval: interval, - view: view, - }; - - // Mock response - const nextPageToken = ''; - const timeSeriesElement = {}; - const timeSeries = [timeSeriesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - timeSeries: timeSeries, - }; - - // Mock Grpc layer - client._innerApiCalls.listTimeSeries = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.timeSeries); - }; - - client.listTimeSeries(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.timeSeries); - done(); - }); - }); - - it('invokes listTimeSeries with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const filter = 'filter-1274492040'; - const interval = {}; - const view = 'FULL'; - const request = { - name: formattedName, - filter: filter, - interval: interval, - view: view, - }; - - // Mock Grpc layer - client._innerApiCalls.listTimeSeries = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listTimeSeries(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createTimeSeries', () => { - it('invokes createTimeSeries without error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const timeSeries = []; - const request = { - name: formattedName, - timeSeries: timeSeries, - }; - - // Mock Grpc layer - client._innerApiCalls.createTimeSeries = mockSimpleGrpcMethod(request); - - client.createTimeSeries(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes createTimeSeries with error', done => { - const client = new monitoringModule.v3.MetricServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const timeSeries = []; - const request = { - name: formattedName, - timeSeries: timeSeries, - }; - - // Mock Grpc layer - client._innerApiCalls.createTimeSeries = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createTimeSeries(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); -describe('NotificationChannelServiceClient', () => { - it('has servicePath', () => { - const servicePath = - monitoringModule.v3.NotificationChannelServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - monitoringModule.v3.NotificationChannelServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = monitoringModule.v3.NotificationChannelServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new monitoringModule.v3.NotificationChannelServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('listNotificationChannelDescriptors', () => { - it('invokes listNotificationChannelDescriptors without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const channelDescriptorsElement = {}; - const channelDescriptors = [channelDescriptorsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - channelDescriptors: channelDescriptors, - }; - - // Mock Grpc layer - client._innerApiCalls.listNotificationChannelDescriptors = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.channelDescriptors); - }; - - client.listNotificationChannelDescriptors(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.channelDescriptors); - done(); - }); - }); - - it('invokes listNotificationChannelDescriptors with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listNotificationChannelDescriptors = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listNotificationChannelDescriptors(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getNotificationChannelDescriptor', () => { - it('invokes getNotificationChannelDescriptor without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelDescriptorPath( - '[PROJECT]', - '[CHANNEL_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const type = 'type3575610'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - name: name2, - type: type, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getNotificationChannelDescriptor = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getNotificationChannelDescriptor(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getNotificationChannelDescriptor with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelDescriptorPath( - '[PROJECT]', - '[CHANNEL_DESCRIPTOR]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getNotificationChannelDescriptor = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getNotificationChannelDescriptor(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listNotificationChannels', () => { - it('invokes listNotificationChannels without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock response - const nextPageToken = ''; - const notificationChannelsElement = {}; - const notificationChannels = [notificationChannelsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - notificationChannels: notificationChannels, - }; - - // Mock Grpc layer - client._innerApiCalls.listNotificationChannels = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.notificationChannels); - }; - - client.listNotificationChannels(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.notificationChannels); - done(); - }); - }); - - it('invokes listNotificationChannels with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.listNotificationChannels = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listNotificationChannels(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getNotificationChannel', () => { - it('invokes getNotificationChannel without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const type = 'type3575610'; - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - type: type, - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.getNotificationChannel = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getNotificationChannel(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getNotificationChannel with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getNotificationChannel = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getNotificationChannel(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createNotificationChannel', () => { - it('invokes createNotificationChannel without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const notificationChannel = {}; - const request = { - name: formattedName, - notificationChannel: notificationChannel, - }; - - // Mock response - const type = 'type3575610'; - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - type: type, - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.createNotificationChannel = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createNotificationChannel(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createNotificationChannel with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.projectPath('[PROJECT]'); - const notificationChannel = {}; - const request = { - name: formattedName, - notificationChannel: notificationChannel, - }; - - // Mock Grpc layer - client._innerApiCalls.createNotificationChannel = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createNotificationChannel(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateNotificationChannel', () => { - it('invokes updateNotificationChannel without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const notificationChannel = {}; - const request = { - notificationChannel: notificationChannel, - }; - - // Mock response - const type = 'type3575610'; - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - type: type, - name: name, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.updateNotificationChannel = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateNotificationChannel(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateNotificationChannel with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const notificationChannel = {}; - const request = { - notificationChannel: notificationChannel, - }; - - // Mock Grpc layer - client._innerApiCalls.updateNotificationChannel = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateNotificationChannel(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteNotificationChannel', () => { - it('invokes deleteNotificationChannel without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteNotificationChannel = mockSimpleGrpcMethod( - request - ); - - client.deleteNotificationChannel(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteNotificationChannel with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteNotificationChannel = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteNotificationChannel(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('sendNotificationChannelVerificationCode', () => { - it('invokes sendNotificationChannelVerificationCode without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.sendNotificationChannelVerificationCode = mockSimpleGrpcMethod( - request - ); - - client.sendNotificationChannelVerificationCode(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes sendNotificationChannelVerificationCode with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.sendNotificationChannelVerificationCode = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.sendNotificationChannelVerificationCode(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('getNotificationChannelVerificationCode', () => { - it('invokes getNotificationChannelVerificationCode without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const code = 'code3059181'; - const expectedResponse = { - code: code, - }; - - // Mock Grpc layer - client._innerApiCalls.getNotificationChannelVerificationCode = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getNotificationChannelVerificationCode( - request, - (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - - it('invokes getNotificationChannelVerificationCode with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getNotificationChannelVerificationCode = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getNotificationChannelVerificationCode( - request, - (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - - describe('verifyNotificationChannel', () => { - it('invokes verifyNotificationChannel without error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const code = 'code3059181'; - const request = { - name: formattedName, - code: code, - }; - - // Mock response - const type = 'type3575610'; - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const description = 'description-1724546052'; - const expectedResponse = { - type: type, - name: name2, - displayName: displayName, - description: description, - }; - - // Mock Grpc layer - client._innerApiCalls.verifyNotificationChannel = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.verifyNotificationChannel(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes verifyNotificationChannel with error', done => { - const client = new monitoringModule.v3.NotificationChannelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.notificationChannelPath( - '[PROJECT]', - '[NOTIFICATION_CHANNEL]' - ); - const code = 'code3059181'; - const request = { - name: formattedName, - code: code, - }; - - // Mock Grpc layer - client._innerApiCalls.verifyNotificationChannel = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.verifyNotificationChannel(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); -describe('ServiceMonitoringServiceClient', () => { - it('has servicePath', () => { - const servicePath = - monitoringModule.v3.ServiceMonitoringServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - monitoringModule.v3.ServiceMonitoringServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = monitoringModule.v3.ServiceMonitoringServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('createService', () => { - it('invokes createService without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const service = {}; - const request = { - parent: formattedParent, - service: service, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.createService = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createService(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createService with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const service = {}; - const request = { - parent: formattedParent, - service: service, - }; - - // Mock Grpc layer - client._innerApiCalls.createService = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createService(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getService', () => { - it('invokes getService without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name2, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.getService = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getService(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getService with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getService = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getService(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listServices', () => { - it('invokes listServices without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const servicesElement = {}; - const services = [servicesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - services: services, - }; - - // Mock Grpc layer - client._innerApiCalls.listServices = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.services); - }; - - client.listServices(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.services); - done(); - }); - }); - - it('invokes listServices with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listServices = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listServices(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateService', () => { - it('invokes updateService without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const service = {}; - const request = { - service: service, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const expectedResponse = { - name: name, - displayName: displayName, - }; - - // Mock Grpc layer - client._innerApiCalls.updateService = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateService(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateService with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const service = {}; - const request = { - service: service, - }; - - // Mock Grpc layer - client._innerApiCalls.updateService = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateService(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteService', () => { - it('invokes deleteService without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteService = mockSimpleGrpcMethod(request); - - client.deleteService(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteService with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.servicePath('[PROJECT]', '[SERVICE]'); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteService = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteService(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('createServiceLevelObjective', () => { - it('invokes createServiceLevelObjective without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - const serviceLevelObjective = {}; - const request = { - parent: formattedParent, - serviceLevelObjective: serviceLevelObjective, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const goal = 317825.0; - const expectedResponse = { - name: name, - displayName: displayName, - goal: goal, - }; - - // Mock Grpc layer - client._innerApiCalls.createServiceLevelObjective = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createServiceLevelObjective(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createServiceLevelObjective with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - const serviceLevelObjective = {}; - const request = { - parent: formattedParent, - serviceLevelObjective: serviceLevelObjective, - }; - - // Mock Grpc layer - client._innerApiCalls.createServiceLevelObjective = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createServiceLevelObjective(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getServiceLevelObjective', () => { - it('invokes getServiceLevelObjective without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.serviceLevelObjectivePath( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const goal = 317825.0; - const expectedResponse = { - name: name2, - displayName: displayName, - goal: goal, - }; - - // Mock Grpc layer - client._innerApiCalls.getServiceLevelObjective = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getServiceLevelObjective(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getServiceLevelObjective with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.serviceLevelObjectivePath( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getServiceLevelObjective = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getServiceLevelObjective(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('listServiceLevelObjectives', () => { - it('invokes listServiceLevelObjectives without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const serviceLevelObjectivesElement = {}; - const serviceLevelObjectives = [serviceLevelObjectivesElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - serviceLevelObjectives: serviceLevelObjectives, - }; - - // Mock Grpc layer - client._innerApiCalls.listServiceLevelObjectives = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.serviceLevelObjectives); - }; - - client.listServiceLevelObjectives(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual( - response, - expectedResponse.serviceLevelObjectives - ); - done(); - }); - }); - - it('invokes listServiceLevelObjectives with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.servicePath('[PROJECT]', '[SERVICE]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listServiceLevelObjectives = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listServiceLevelObjectives(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateServiceLevelObjective', () => { - it('invokes updateServiceLevelObjective without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const serviceLevelObjective = {}; - const request = { - serviceLevelObjective: serviceLevelObjective, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const goal = 317825.0; - const expectedResponse = { - name: name, - displayName: displayName, - goal: goal, - }; - - // Mock Grpc layer - client._innerApiCalls.updateServiceLevelObjective = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateServiceLevelObjective(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateServiceLevelObjective with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const serviceLevelObjective = {}; - const request = { - serviceLevelObjective: serviceLevelObjective, - }; - - // Mock Grpc layer - client._innerApiCalls.updateServiceLevelObjective = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateServiceLevelObjective(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteServiceLevelObjective', () => { - it('invokes deleteServiceLevelObjective without error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.serviceLevelObjectivePath( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteServiceLevelObjective = mockSimpleGrpcMethod( - request - ); - - client.deleteServiceLevelObjective(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteServiceLevelObjective with error', done => { - const client = new monitoringModule.v3.ServiceMonitoringServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.serviceLevelObjectivePath( - '[PROJECT]', - '[SERVICE]', - '[SERVICE_LEVEL_OBJECTIVE]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteServiceLevelObjective = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteServiceLevelObjective(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); -describe('UptimeCheckServiceClient', () => { - it('has servicePath', () => { - const servicePath = - monitoringModule.v3.UptimeCheckServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - monitoringModule.v3.UptimeCheckServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = monitoringModule.v3.UptimeCheckServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no options', () => { - const client = new monitoringModule.v3.UptimeCheckServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - fallback: true, - }); - assert(client); - }); - - describe('listUptimeCheckConfigs', () => { - it('invokes listUptimeCheckConfigs without error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock response - const nextPageToken = ''; - const totalSize = 705419236; - const uptimeCheckConfigsElement = {}; - const uptimeCheckConfigs = [uptimeCheckConfigsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - totalSize: totalSize, - uptimeCheckConfigs: uptimeCheckConfigs, - }; - - // Mock Grpc layer - client._innerApiCalls.listUptimeCheckConfigs = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.uptimeCheckConfigs); - }; - - client.listUptimeCheckConfigs(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.uptimeCheckConfigs); - done(); - }); - }); - - it('invokes listUptimeCheckConfigs with error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const request = { - parent: formattedParent, - }; - - // Mock Grpc layer - client._innerApiCalls.listUptimeCheckConfigs = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listUptimeCheckConfigs(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('getUptimeCheckConfig', () => { - it('invokes getUptimeCheckConfig without error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.uptimeCheckConfigPath( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - const request = { - name: formattedName, - }; - - // Mock response - const name2 = 'name2-1052831874'; - const displayName = 'displayName1615086568'; - const isInternal = true; - const expectedResponse = { - name: name2, - displayName: displayName, - isInternal: isInternal, - }; - - // Mock Grpc layer - client._innerApiCalls.getUptimeCheckConfig = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.getUptimeCheckConfig(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getUptimeCheckConfig with error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.uptimeCheckConfigPath( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.getUptimeCheckConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.getUptimeCheckConfig(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('createUptimeCheckConfig', () => { - it('invokes createUptimeCheckConfig without error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const uptimeCheckConfig = {}; - const request = { - parent: formattedParent, - uptimeCheckConfig: uptimeCheckConfig, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const isInternal = true; - const expectedResponse = { - name: name, - displayName: displayName, - isInternal: isInternal, - }; - - // Mock Grpc layer - client._innerApiCalls.createUptimeCheckConfig = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.createUptimeCheckConfig(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createUptimeCheckConfig with error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedParent = client.projectPath('[PROJECT]'); - const uptimeCheckConfig = {}; - const request = { - parent: formattedParent, - uptimeCheckConfig: uptimeCheckConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.createUptimeCheckConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.createUptimeCheckConfig(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('updateUptimeCheckConfig', () => { - it('invokes updateUptimeCheckConfig without error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const uptimeCheckConfig = {}; - const request = { - uptimeCheckConfig: uptimeCheckConfig, - }; - - // Mock response - const name = 'name3373707'; - const displayName = 'displayName1615086568'; - const isInternal = true; - const expectedResponse = { - name: name, - displayName: displayName, - isInternal: isInternal, - }; - - // Mock Grpc layer - client._innerApiCalls.updateUptimeCheckConfig = mockSimpleGrpcMethod( - request, - expectedResponse - ); - - client.updateUptimeCheckConfig(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes updateUptimeCheckConfig with error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const uptimeCheckConfig = {}; - const request = { - uptimeCheckConfig: uptimeCheckConfig, - }; - - // Mock Grpc layer - client._innerApiCalls.updateUptimeCheckConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.updateUptimeCheckConfig(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - - describe('deleteUptimeCheckConfig', () => { - it('invokes deleteUptimeCheckConfig without error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.uptimeCheckConfigPath( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteUptimeCheckConfig = mockSimpleGrpcMethod( - request - ); - - client.deleteUptimeCheckConfig(request, err => { - assert.ifError(err); - done(); - }); - }); - - it('invokes deleteUptimeCheckConfig with error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const formattedName = client.uptimeCheckConfigPath( - '[PROJECT]', - '[UPTIME_CHECK_CONFIG]' - ); - const request = { - name: formattedName, - }; - - // Mock Grpc layer - client._innerApiCalls.deleteUptimeCheckConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.deleteUptimeCheckConfig(request, err => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - - describe('listUptimeCheckIps', () => { - it('invokes listUptimeCheckIps without error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const request = {}; - - // Mock response - const nextPageToken = ''; - const uptimeCheckIpsElement = {}; - const uptimeCheckIps = [uptimeCheckIpsElement]; - const expectedResponse = { - nextPageToken: nextPageToken, - uptimeCheckIps: uptimeCheckIps, - }; - - // Mock Grpc layer - client._innerApiCalls.listUptimeCheckIps = ( - actualRequest, - options, - callback - ) => { - assert.deepStrictEqual(actualRequest, request); - callback(null, expectedResponse.uptimeCheckIps); - }; - - client.listUptimeCheckIps(request, (err, response) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse.uptimeCheckIps); - done(); - }); - }); - - it('invokes listUptimeCheckIps with error', done => { - const client = new monitoringModule.v3.UptimeCheckServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - - // Mock request - const request = {}; - - // Mock Grpc layer - client._innerApiCalls.listUptimeCheckIps = mockSimpleGrpcMethod( - request, - null, - error - ); - - client.listUptimeCheckIps(request, (err, response) => { - assert(err instanceof Error); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); -}); - -function mockSimpleGrpcMethod(expectedRequest, response, error) { - return function(actualRequest, options, callback) { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..613d3559 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 00000000..617dc975 --- /dev/null +++ b/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/webpack.config.js b/webpack.config.js index 402b3e0e..c38f3d48 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,8 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +const path = require('path'); + module.exports = { - entry: './src/browser.js', + entry: './src/index.ts', output: { library: 'monitoring', filename: './monitoring.js', @@ -24,21 +26,37 @@ module.exports = { crypto: 'empty', }, resolve: { - extensions: ['.js', '.json'], + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], }, module: { rules: [ { - test: /node_modules[\\/]retry-request[\\/]/, - use: 'null-loader', + 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[\\/]https?-proxy-agent/, + use: 'null-loader' }, { - test: /node_modules[\\/]gtoken[\\/]/, - use: 'null-loader', + test: /node_modules[\\/]gtoken/, + use: 'null-loader' }, ], },