"use strict";
// Copyright 2024 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. **
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetricsServiceV2Client = void 0;
const jsonProtos = require("../../protos/protos.json");
/**
 * Client JSON configuration object, loaded from
 * `src/v2/metrics_service_v2_client_config.json`.
 * This file defines retry strategy and timeouts for all API methods in this library.
 */
const gapicConfig = require("./metrics_service_v2_client_config.json");
const version = require('../../../package.json').version;
/**
 *  Service for configuring logs-based metrics.
 * @class
 * @memberof v2
 */
class MetricsServiceV2Client {
    /**
     * Construct an instance of MetricsServiceV2Client.
     *
     * @param {object} [options] - The configuration object.
     * The options accepted by the constructor are described in detail
     * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
     * The common options are:
     * @param {object} [options.credentials] - Credentials object.
     * @param {string} [options.credentials.client_email]
     * @param {string} [options.credentials.private_key]
     * @param {string} [options.email] - Account email address. Required when
     *     using a .pem or .p12 keyFilename.
     * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
     *     .p12 key downloaded from the Google Developers Console. If you provide
     *     a path to a JSON file, the projectId option below is not necessary.
     *     NOTE: .pem and .p12 require you to specify options.email as well.
     * @param {number} [options.port] - The port on which to connect to
     *     the remote host.
     * @param {string} [options.projectId] - The project ID from the Google
     *     Developer's Console, e.g. 'grape-spaceship-123'. We will also check
     *     the environment variable GCLOUD_PROJECT for your project ID. If your
     *     app is running in an environment which supports
     *     {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
     *     your project ID will be detected automatically.
     * @param {string} [options.apiEndpoint] - The domain name of the
     *     API remote host.
     * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
     *     Follows the structure of {@link gapicConfig}.
     * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
     *     For more information, please check the
     *     {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
     * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
     *     need to avoid loading the default gRPC version and want to use the fallback
     *     HTTP implementation. Load only fallback version and pass it to the constructor:
     *     ```
     *     const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
     *     const client = new MetricsServiceV2Client({fallback: true}, gax);
     *     ```
     */
    constructor(opts, gaxInstance) {
        var _a, _b, _c, _d, _e;
        this._terminated = false;
        this.descriptors = {
            page: {},
            stream: {},
            longrunning: {},
            batching: {},
        };
        // Ensure that options include all the required fields.
        const staticMembers = this.constructor;
        if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
            (opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
            (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
            throw new Error('Please set either universe_domain or universeDomain, but not both.');
        }
        const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
            ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
            : undefined;
        this._universeDomain =
            (_c = (_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
        this._servicePath = 'logging.' + this._universeDomain;
        const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
        this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
        const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
        const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
        const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
        opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
        // Request numeric enum values if REST transport is used.
        opts.numericEnums = true;
        // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
        if (servicePath !== this._servicePath && !('scopes' in opts)) {
            opts['scopes'] = staticMembers.scopes;
        }
        // Load google-gax module synchronously if needed
        if (!gaxInstance) {
            gaxInstance = require('google-gax');
        }
        // Choose either gRPC or proto-over-HTTP implementation of google-gax.
        this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;
        // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
        this._gaxGrpc = new this._gaxModule.GrpcClient(opts);
        // Save options to use in initialize() method.
        this._opts = opts;
        // Save the auth object to the client, for use by other methods.
        this.auth = this._gaxGrpc.auth;
        // Set useJWTAccessWithScope on the auth object.
        this.auth.useJWTAccessWithScope = true;
        // Set defaultServicePath on the auth object.
        this.auth.defaultServicePath = this._servicePath;
        // Set the default scopes in auth client if needed.
        if (servicePath === this._servicePath) {
            this.auth.defaultScopes = staticMembers.scopes;
        }
        // Determine the client header string.
        const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
        if (typeof process === 'object' && 'versions' in process) {
            clientHeader.push(`gl-node/${process.versions.node}`);
        }
        else {
            clientHeader.push(`gl-web/${this._gaxModule.version}`);
        }
        if (!opts.fallback) {
            clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`);
        }
        else {
            clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`);
        }
        if (opts.libName && opts.libVersion) {
            clientHeader.push(`${opts.libName}/${opts.libVersion}`);
        }
        // Load the applicable protos.
        this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos);
        // This API contains "path templates"; forward-slash-separated
        // identifiers to uniquely identify resources within the API.
        // Create useful helper objects for these.
        this.pathTemplates = {
            billingAccountCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/cmekSettings'),
            billingAccountExclusionPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/exclusions/{exclusion}'),
            billingAccountLocationBucketPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}'),
            billingAccountLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}'),
            billingAccountLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}'),
            billingAccountLogPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/logs/{log}'),
            billingAccountSettingsPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/settings'),
            billingAccountSinkPathTemplate: new this._gaxModule.PathTemplate('billingAccounts/{billing_account}/sinks/{sink}'),
            folderCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/cmekSettings'),
            folderExclusionPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/exclusions/{exclusion}'),
            folderLocationBucketPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}'),
            folderLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}'),
            folderLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}'),
            folderLogPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/logs/{log}'),
            folderSettingsPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/settings'),
            folderSinkPathTemplate: new this._gaxModule.PathTemplate('folders/{folder}/sinks/{sink}'),
            logMetricPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/metrics/{metric}'),
            organizationCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/cmekSettings'),
            organizationExclusionPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/exclusions/{exclusion}'),
            organizationLocationBucketPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}'),
            organizationLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}'),
            organizationLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}'),
            organizationLogPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/logs/{log}'),
            organizationSettingsPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/settings'),
            organizationSinkPathTemplate: new this._gaxModule.PathTemplate('organizations/{organization}/sinks/{sink}'),
            projectPathTemplate: new this._gaxModule.PathTemplate('projects/{project}'),
            projectCmekSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/cmekSettings'),
            projectExclusionPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/exclusions/{exclusion}'),
            projectLocationBucketPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}'),
            projectLocationBucketLinkPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/links/{link}'),
            projectLocationBucketViewPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/locations/{location}/buckets/{bucket}/views/{view}'),
            projectLogPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/logs/{log}'),
            projectSettingsPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/settings'),
            projectSinkPathTemplate: new this._gaxModule.PathTemplate('projects/{project}/sinks/{sink}'),
        };
        // Some of the methods on this service return "paged" results,
        // (e.g. 50 results at a time, with tokens to get subsequent
        // pages). Denote the keys used for pagination and results.
        this.descriptors.page = {
            listLogMetrics: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'metrics'),
        };
        // Put together the default options sent with requests.
        this._defaults = this._gaxGrpc.constructSettings('google.logging.v2.MetricsServiceV2', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
        // Set up a dictionary of "inner API calls"; the core implementation
        // of calling the API is handled in `google-gax`, with this code
        // merely providing the destination and request information.
        this.innerApiCalls = {};
        // Add a warn function to the client constructor so it can be easily tested.
        this.warn = this._gaxModule.warn;
    }
    /**
     * Initialize the client.
     * Performs asynchronous operations (such as authentication) and prepares the client.
     * This function will be called automatically when any class method is called for the
     * first time, but if you need to initialize it before calling an actual method,
     * feel free to call initialize() directly.
     *
     * You can await on this method if you want to make sure the client is initialized.
     *
     * @returns {Promise} A promise that resolves to an authenticated service stub.
     */
    initialize() {
        // If the client stub promise is already initialized, return immediately.
        if (this.metricsServiceV2Stub) {
            return this.metricsServiceV2Stub;
        }
        // Put together the "service stub" for
        // google.logging.v2.MetricsServiceV2.
        this.metricsServiceV2Stub = this._gaxGrpc.createStub(this._opts.fallback
            ? this._protos.lookupService('google.logging.v2.MetricsServiceV2')
            : // eslint-disable-next-line @typescript-eslint/no-explicit-any
                this._protos.google.logging.v2.MetricsServiceV2, this._opts, this._providedCustomServicePath);
        // Iterate over each of the methods that the service provides
        // and create an API call method for each.
        const metricsServiceV2StubMethods = [
            'listLogMetrics',
            'getLogMetric',
            'createLogMetric',
            'updateLogMetric',
            'deleteLogMetric',
        ];
        for (const methodName of metricsServiceV2StubMethods) {
            const callPromise = this.metricsServiceV2Stub.then(stub => (...args) => {
                if (this._terminated) {
                    return Promise.reject('The client has already been closed.');
                }
                const func = stub[methodName];
                return func.apply(stub, args);
            }, (err) => () => {
                throw err;
            });
            const descriptor = this.descriptors.page[methodName] || undefined;
            const apiCall = this._gaxModule.createApiCall(callPromise, this._defaults[methodName], descriptor, this._opts.fallback);
            this.innerApiCalls[methodName] = apiCall;
        }
        return this.metricsServiceV2Stub;
    }
    /**
     * The DNS address for this API service.
     * @deprecated Use the apiEndpoint method of the client instance.
     * @returns {string} The DNS address for this service.
     */
    static get servicePath() {
        if (typeof process === 'object' &&
            typeof process.emitWarning === 'function') {
            process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
        }
        return 'logging.googleapis.com';
    }
    /**
     * The DNS address for this API service - same as servicePath.
     * @deprecated Use the apiEndpoint method of the client instance.
     * @returns {string} The DNS address for this service.
     */
    static get apiEndpoint() {
        if (typeof process === 'object' &&
            typeof process.emitWarning === 'function') {
            process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
        }
        return 'logging.googleapis.com';
    }
    /**
     * The DNS address for this API service.
     * @returns {string} The DNS address for this service.
     */
    get apiEndpoint() {
        return this._servicePath;
    }
    get universeDomain() {
        return this._universeDomain;
    }
    /**
     * The port for this API service.
     * @returns {number} The default port for this service.
     */
    static get port() {
        return 443;
    }
    /**
     * The scopes needed to make gRPC calls for every method defined
     * in this service.
     * @returns {string[]} List of default scopes.
     */
    static get scopes() {
        return [
            'https://www.googleapis.com/auth/cloud-platform',
            'https://www.googleapis.com/auth/cloud-platform.read-only',
            'https://www.googleapis.com/auth/logging.admin',
            'https://www.googleapis.com/auth/logging.read',
            'https://www.googleapis.com/auth/logging.write',
        ];
    }
    /**
     * Return the project ID used by this class.
     * @returns {Promise} A promise that resolves to string containing the project ID.
     */
    getProjectId(callback) {
        if (callback) {
            this.auth.getProjectId(callback);
            return;
        }
        return this.auth.getProjectId();
    }
    getLogMetric(request, optionsOrCallback, callback) {
        var _a;
        request = request || {};
        let options;
        if (typeof optionsOrCallback === 'function' && callback === undefined) {
            callback = optionsOrCallback;
            options = {};
        }
        else {
            options = optionsOrCallback;
        }
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                metric_name: (_a = request.metricName) !== null && _a !== void 0 ? _a : '',
            });
        this.initialize();
        return this.innerApiCalls.getLogMetric(request, options, callback);
    }
    createLogMetric(request, optionsOrCallback, callback) {
        var _a;
        request = request || {};
        let options;
        if (typeof optionsOrCallback === 'function' && callback === undefined) {
            callback = optionsOrCallback;
            options = {};
        }
        else {
            options = optionsOrCallback;
        }
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
            });
        this.initialize();
        return this.innerApiCalls.createLogMetric(request, options, callback);
    }
    updateLogMetric(request, optionsOrCallback, callback) {
        var _a;
        request = request || {};
        let options;
        if (typeof optionsOrCallback === 'function' && callback === undefined) {
            callback = optionsOrCallback;
            options = {};
        }
        else {
            options = optionsOrCallback;
        }
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                metric_name: (_a = request.metricName) !== null && _a !== void 0 ? _a : '',
            });
        this.initialize();
        return this.innerApiCalls.updateLogMetric(request, options, callback);
    }
    deleteLogMetric(request, optionsOrCallback, callback) {
        var _a;
        request = request || {};
        let options;
        if (typeof optionsOrCallback === 'function' && callback === undefined) {
            callback = optionsOrCallback;
            options = {};
        }
        else {
            options = optionsOrCallback;
        }
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                metric_name: (_a = request.metricName) !== null && _a !== void 0 ? _a : '',
            });
        this.initialize();
        return this.innerApiCalls.deleteLogMetric(request, options, callback);
    }
    listLogMetrics(request, optionsOrCallback, callback) {
        var _a;
        request = request || {};
        let options;
        if (typeof optionsOrCallback === 'function' && callback === undefined) {
            callback = optionsOrCallback;
            options = {};
        }
        else {
            options = optionsOrCallback;
        }
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
            });
        this.initialize();
        return this.innerApiCalls.listLogMetrics(request, options, callback);
    }
    /**
     * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
     * @param {Object} request
     *   The request object that will be sent.
     * @param {string} request.parent
     *   Required. The name of the project containing the metrics:
     *
     *       "projects/[PROJECT_ID]"
     * @param {string} [request.pageToken]
     *   Optional. If present, then retrieve the next batch of results from the
     *   preceding call to this method. `pageToken` must be the value of
     *   `nextPageToken` from the previous response. The values of other method
     *   parameters should be identical to those in the previous call.
     * @param {number} [request.pageSize]
     *   Optional. The maximum number of results to return from this request.
     *   Non-positive values are ignored. The presence of `nextPageToken` in the
     *   response indicates that more results might be available.
     * @param {object} [options]
     *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
     * @returns {Stream}
     *   An object stream which emits an object representing {@link protos.google.logging.v2.LogMetric|LogMetric} on 'data' event.
     *   The client library will perform auto-pagination by default: it will call the API as many
     *   times as needed. Note that it can affect your quota.
     *   We recommend using `listLogMetricsAsync()`
     *   method described below for async iteration which you can stop as needed.
     *   Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
     *   for more details and examples.
     */
    listLogMetricsStream(request, options) {
        var _a;
        request = request || {};
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
            });
        const defaultCallSettings = this._defaults['listLogMetrics'];
        const callSettings = defaultCallSettings.merge(options);
        this.initialize();
        return this.descriptors.page.listLogMetrics.createStream(this.innerApiCalls.listLogMetrics, request, callSettings);
    }
    /**
     * Equivalent to `listLogMetrics`, but returns an iterable object.
     *
     * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
     * @param {Object} request
     *   The request object that will be sent.
     * @param {string} request.parent
     *   Required. The name of the project containing the metrics:
     *
     *       "projects/[PROJECT_ID]"
     * @param {string} [request.pageToken]
     *   Optional. If present, then retrieve the next batch of results from the
     *   preceding call to this method. `pageToken` must be the value of
     *   `nextPageToken` from the previous response. The values of other method
     *   parameters should be identical to those in the previous call.
     * @param {number} [request.pageSize]
     *   Optional. The maximum number of results to return from this request.
     *   Non-positive values are ignored. The presence of `nextPageToken` in the
     *   response indicates that more results might be available.
     * @param {object} [options]
     *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
     * @returns {Object}
     *   An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
     *   When you iterate the returned iterable, each element will be an object representing
     *   {@link protos.google.logging.v2.LogMetric|LogMetric}. The API will be called under the hood as needed, once per the page,
     *   so you can stop the iteration when you don't need more results.
     *   Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
     *   for more details and examples.
     * @example <caption>include:samples/generated/v2/metrics_service_v2.list_log_metrics.js</caption>
     * region_tag:logging_v2_generated_MetricsServiceV2_ListLogMetrics_async
     */
    listLogMetricsAsync(request, options) {
        var _a;
        request = request || {};
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            this._gaxModule.routingHeader.fromParams({
                parent: (_a = request.parent) !== null && _a !== void 0 ? _a : '',
            });
        const defaultCallSettings = this._defaults['listLogMetrics'];
        const callSettings = defaultCallSettings.merge(options);
        this.initialize();
        return this.descriptors.page.listLogMetrics.asyncIterate(this.innerApiCalls['listLogMetrics'], request, callSettings);
    }
    // --------------------
    // -- Path templates --
    // --------------------
    /**
     * Return a fully-qualified billingAccountCmekSettings resource name string.
     *
     * @param {string} billing_account
     * @returns {string} Resource name string.
     */
    billingAccountCmekSettingsPath(billingAccount) {
        return this.pathTemplates.billingAccountCmekSettingsPathTemplate.render({
            billing_account: billingAccount,
        });
    }
    /**
     * Parse the billing_account from BillingAccountCmekSettings resource.
     *
     * @param {string} billingAccountCmekSettingsName
     *   A fully-qualified path representing billing_account_cmekSettings resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountCmekSettingsName(billingAccountCmekSettingsName) {
        return this.pathTemplates.billingAccountCmekSettingsPathTemplate.match(billingAccountCmekSettingsName).billing_account;
    }
    /**
     * Return a fully-qualified billingAccountExclusion resource name string.
     *
     * @param {string} billing_account
     * @param {string} exclusion
     * @returns {string} Resource name string.
     */
    billingAccountExclusionPath(billingAccount, exclusion) {
        return this.pathTemplates.billingAccountExclusionPathTemplate.render({
            billing_account: billingAccount,
            exclusion: exclusion,
        });
    }
    /**
     * Parse the billing_account from BillingAccountExclusion resource.
     *
     * @param {string} billingAccountExclusionName
     *   A fully-qualified path representing billing_account_exclusion resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountExclusionName(billingAccountExclusionName) {
        return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).billing_account;
    }
    /**
     * Parse the exclusion from BillingAccountExclusion resource.
     *
     * @param {string} billingAccountExclusionName
     *   A fully-qualified path representing billing_account_exclusion resource.
     * @returns {string} A string representing the exclusion.
     */
    matchExclusionFromBillingAccountExclusionName(billingAccountExclusionName) {
        return this.pathTemplates.billingAccountExclusionPathTemplate.match(billingAccountExclusionName).exclusion;
    }
    /**
     * Return a fully-qualified billingAccountLocationBucket resource name string.
     *
     * @param {string} billing_account
     * @param {string} location
     * @param {string} bucket
     * @returns {string} Resource name string.
     */
    billingAccountLocationBucketPath(billingAccount, location, bucket) {
        return this.pathTemplates.billingAccountLocationBucketPathTemplate.render({
            billing_account: billingAccount,
            location: location,
            bucket: bucket,
        });
    }
    /**
     * Parse the billing_account from BillingAccountLocationBucket resource.
     *
     * @param {string} billingAccountLocationBucketName
     *   A fully-qualified path representing billing_account_location_bucket resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountLocationBucketName(billingAccountLocationBucketName) {
        return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).billing_account;
    }
    /**
     * Parse the location from BillingAccountLocationBucket resource.
     *
     * @param {string} billingAccountLocationBucketName
     *   A fully-qualified path representing billing_account_location_bucket resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromBillingAccountLocationBucketName(billingAccountLocationBucketName) {
        return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).location;
    }
    /**
     * Parse the bucket from BillingAccountLocationBucket resource.
     *
     * @param {string} billingAccountLocationBucketName
     *   A fully-qualified path representing billing_account_location_bucket resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromBillingAccountLocationBucketName(billingAccountLocationBucketName) {
        return this.pathTemplates.billingAccountLocationBucketPathTemplate.match(billingAccountLocationBucketName).bucket;
    }
    /**
     * Return a fully-qualified billingAccountLocationBucketLink resource name string.
     *
     * @param {string} billing_account
     * @param {string} location
     * @param {string} bucket
     * @param {string} link
     * @returns {string} Resource name string.
     */
    billingAccountLocationBucketLinkPath(billingAccount, location, bucket, link) {
        return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.render({
            billing_account: billingAccount,
            location: location,
            bucket: bucket,
            link: link,
        });
    }
    /**
     * Parse the billing_account from BillingAccountLocationBucketLink resource.
     *
     * @param {string} billingAccountLocationBucketLinkName
     *   A fully-qualified path representing billing_account_location_bucket_link resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountLocationBucketLinkName(billingAccountLocationBucketLinkName) {
        return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match(billingAccountLocationBucketLinkName).billing_account;
    }
    /**
     * Parse the location from BillingAccountLocationBucketLink resource.
     *
     * @param {string} billingAccountLocationBucketLinkName
     *   A fully-qualified path representing billing_account_location_bucket_link resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromBillingAccountLocationBucketLinkName(billingAccountLocationBucketLinkName) {
        return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match(billingAccountLocationBucketLinkName).location;
    }
    /**
     * Parse the bucket from BillingAccountLocationBucketLink resource.
     *
     * @param {string} billingAccountLocationBucketLinkName
     *   A fully-qualified path representing billing_account_location_bucket_link resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromBillingAccountLocationBucketLinkName(billingAccountLocationBucketLinkName) {
        return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match(billingAccountLocationBucketLinkName).bucket;
    }
    /**
     * Parse the link from BillingAccountLocationBucketLink resource.
     *
     * @param {string} billingAccountLocationBucketLinkName
     *   A fully-qualified path representing billing_account_location_bucket_link resource.
     * @returns {string} A string representing the link.
     */
    matchLinkFromBillingAccountLocationBucketLinkName(billingAccountLocationBucketLinkName) {
        return this.pathTemplates.billingAccountLocationBucketLinkPathTemplate.match(billingAccountLocationBucketLinkName).link;
    }
    /**
     * Return a fully-qualified billingAccountLocationBucketView resource name string.
     *
     * @param {string} billing_account
     * @param {string} location
     * @param {string} bucket
     * @param {string} view
     * @returns {string} Resource name string.
     */
    billingAccountLocationBucketViewPath(billingAccount, location, bucket, view) {
        return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.render({
            billing_account: billingAccount,
            location: location,
            bucket: bucket,
            view: view,
        });
    }
    /**
     * Parse the billing_account from BillingAccountLocationBucketView resource.
     *
     * @param {string} billingAccountLocationBucketViewName
     *   A fully-qualified path representing billing_account_location_bucket_view resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) {
        return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).billing_account;
    }
    /**
     * Parse the location from BillingAccountLocationBucketView resource.
     *
     * @param {string} billingAccountLocationBucketViewName
     *   A fully-qualified path representing billing_account_location_bucket_view resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) {
        return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).location;
    }
    /**
     * Parse the bucket from BillingAccountLocationBucketView resource.
     *
     * @param {string} billingAccountLocationBucketViewName
     *   A fully-qualified path representing billing_account_location_bucket_view resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) {
        return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).bucket;
    }
    /**
     * Parse the view from BillingAccountLocationBucketView resource.
     *
     * @param {string} billingAccountLocationBucketViewName
     *   A fully-qualified path representing billing_account_location_bucket_view resource.
     * @returns {string} A string representing the view.
     */
    matchViewFromBillingAccountLocationBucketViewName(billingAccountLocationBucketViewName) {
        return this.pathTemplates.billingAccountLocationBucketViewPathTemplate.match(billingAccountLocationBucketViewName).view;
    }
    /**
     * Return a fully-qualified billingAccountLog resource name string.
     *
     * @param {string} billing_account
     * @param {string} log
     * @returns {string} Resource name string.
     */
    billingAccountLogPath(billingAccount, log) {
        return this.pathTemplates.billingAccountLogPathTemplate.render({
            billing_account: billingAccount,
            log: log,
        });
    }
    /**
     * Parse the billing_account from BillingAccountLog resource.
     *
     * @param {string} billingAccountLogName
     *   A fully-qualified path representing billing_account_log resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountLogName(billingAccountLogName) {
        return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).billing_account;
    }
    /**
     * Parse the log from BillingAccountLog resource.
     *
     * @param {string} billingAccountLogName
     *   A fully-qualified path representing billing_account_log resource.
     * @returns {string} A string representing the log.
     */
    matchLogFromBillingAccountLogName(billingAccountLogName) {
        return this.pathTemplates.billingAccountLogPathTemplate.match(billingAccountLogName).log;
    }
    /**
     * Return a fully-qualified billingAccountSettings resource name string.
     *
     * @param {string} billing_account
     * @returns {string} Resource name string.
     */
    billingAccountSettingsPath(billingAccount) {
        return this.pathTemplates.billingAccountSettingsPathTemplate.render({
            billing_account: billingAccount,
        });
    }
    /**
     * Parse the billing_account from BillingAccountSettings resource.
     *
     * @param {string} billingAccountSettingsName
     *   A fully-qualified path representing billing_account_settings resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountSettingsName(billingAccountSettingsName) {
        return this.pathTemplates.billingAccountSettingsPathTemplate.match(billingAccountSettingsName).billing_account;
    }
    /**
     * Return a fully-qualified billingAccountSink resource name string.
     *
     * @param {string} billing_account
     * @param {string} sink
     * @returns {string} Resource name string.
     */
    billingAccountSinkPath(billingAccount, sink) {
        return this.pathTemplates.billingAccountSinkPathTemplate.render({
            billing_account: billingAccount,
            sink: sink,
        });
    }
    /**
     * Parse the billing_account from BillingAccountSink resource.
     *
     * @param {string} billingAccountSinkName
     *   A fully-qualified path representing billing_account_sink resource.
     * @returns {string} A string representing the billing_account.
     */
    matchBillingAccountFromBillingAccountSinkName(billingAccountSinkName) {
        return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).billing_account;
    }
    /**
     * Parse the sink from BillingAccountSink resource.
     *
     * @param {string} billingAccountSinkName
     *   A fully-qualified path representing billing_account_sink resource.
     * @returns {string} A string representing the sink.
     */
    matchSinkFromBillingAccountSinkName(billingAccountSinkName) {
        return this.pathTemplates.billingAccountSinkPathTemplate.match(billingAccountSinkName).sink;
    }
    /**
     * Return a fully-qualified folderCmekSettings resource name string.
     *
     * @param {string} folder
     * @returns {string} Resource name string.
     */
    folderCmekSettingsPath(folder) {
        return this.pathTemplates.folderCmekSettingsPathTemplate.render({
            folder: folder,
        });
    }
    /**
     * Parse the folder from FolderCmekSettings resource.
     *
     * @param {string} folderCmekSettingsName
     *   A fully-qualified path representing folder_cmekSettings resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderCmekSettingsName(folderCmekSettingsName) {
        return this.pathTemplates.folderCmekSettingsPathTemplate.match(folderCmekSettingsName).folder;
    }
    /**
     * Return a fully-qualified folderExclusion resource name string.
     *
     * @param {string} folder
     * @param {string} exclusion
     * @returns {string} Resource name string.
     */
    folderExclusionPath(folder, exclusion) {
        return this.pathTemplates.folderExclusionPathTemplate.render({
            folder: folder,
            exclusion: exclusion,
        });
    }
    /**
     * Parse the folder from FolderExclusion resource.
     *
     * @param {string} folderExclusionName
     *   A fully-qualified path representing folder_exclusion resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderExclusionName(folderExclusionName) {
        return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).folder;
    }
    /**
     * Parse the exclusion from FolderExclusion resource.
     *
     * @param {string} folderExclusionName
     *   A fully-qualified path representing folder_exclusion resource.
     * @returns {string} A string representing the exclusion.
     */
    matchExclusionFromFolderExclusionName(folderExclusionName) {
        return this.pathTemplates.folderExclusionPathTemplate.match(folderExclusionName).exclusion;
    }
    /**
     * Return a fully-qualified folderLocationBucket resource name string.
     *
     * @param {string} folder
     * @param {string} location
     * @param {string} bucket
     * @returns {string} Resource name string.
     */
    folderLocationBucketPath(folder, location, bucket) {
        return this.pathTemplates.folderLocationBucketPathTemplate.render({
            folder: folder,
            location: location,
            bucket: bucket,
        });
    }
    /**
     * Parse the folder from FolderLocationBucket resource.
     *
     * @param {string} folderLocationBucketName
     *   A fully-qualified path representing folder_location_bucket resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderLocationBucketName(folderLocationBucketName) {
        return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).folder;
    }
    /**
     * Parse the location from FolderLocationBucket resource.
     *
     * @param {string} folderLocationBucketName
     *   A fully-qualified path representing folder_location_bucket resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromFolderLocationBucketName(folderLocationBucketName) {
        return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).location;
    }
    /**
     * Parse the bucket from FolderLocationBucket resource.
     *
     * @param {string} folderLocationBucketName
     *   A fully-qualified path representing folder_location_bucket resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromFolderLocationBucketName(folderLocationBucketName) {
        return this.pathTemplates.folderLocationBucketPathTemplate.match(folderLocationBucketName).bucket;
    }
    /**
     * Return a fully-qualified folderLocationBucketLink resource name string.
     *
     * @param {string} folder
     * @param {string} location
     * @param {string} bucket
     * @param {string} link
     * @returns {string} Resource name string.
     */
    folderLocationBucketLinkPath(folder, location, bucket, link) {
        return this.pathTemplates.folderLocationBucketLinkPathTemplate.render({
            folder: folder,
            location: location,
            bucket: bucket,
            link: link,
        });
    }
    /**
     * Parse the folder from FolderLocationBucketLink resource.
     *
     * @param {string} folderLocationBucketLinkName
     *   A fully-qualified path representing folder_location_bucket_link resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderLocationBucketLinkName(folderLocationBucketLinkName) {
        return this.pathTemplates.folderLocationBucketLinkPathTemplate.match(folderLocationBucketLinkName).folder;
    }
    /**
     * Parse the location from FolderLocationBucketLink resource.
     *
     * @param {string} folderLocationBucketLinkName
     *   A fully-qualified path representing folder_location_bucket_link resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromFolderLocationBucketLinkName(folderLocationBucketLinkName) {
        return this.pathTemplates.folderLocationBucketLinkPathTemplate.match(folderLocationBucketLinkName).location;
    }
    /**
     * Parse the bucket from FolderLocationBucketLink resource.
     *
     * @param {string} folderLocationBucketLinkName
     *   A fully-qualified path representing folder_location_bucket_link resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromFolderLocationBucketLinkName(folderLocationBucketLinkName) {
        return this.pathTemplates.folderLocationBucketLinkPathTemplate.match(folderLocationBucketLinkName).bucket;
    }
    /**
     * Parse the link from FolderLocationBucketLink resource.
     *
     * @param {string} folderLocationBucketLinkName
     *   A fully-qualified path representing folder_location_bucket_link resource.
     * @returns {string} A string representing the link.
     */
    matchLinkFromFolderLocationBucketLinkName(folderLocationBucketLinkName) {
        return this.pathTemplates.folderLocationBucketLinkPathTemplate.match(folderLocationBucketLinkName).link;
    }
    /**
     * Return a fully-qualified folderLocationBucketView resource name string.
     *
     * @param {string} folder
     * @param {string} location
     * @param {string} bucket
     * @param {string} view
     * @returns {string} Resource name string.
     */
    folderLocationBucketViewPath(folder, location, bucket, view) {
        return this.pathTemplates.folderLocationBucketViewPathTemplate.render({
            folder: folder,
            location: location,
            bucket: bucket,
            view: view,
        });
    }
    /**
     * Parse the folder from FolderLocationBucketView resource.
     *
     * @param {string} folderLocationBucketViewName
     *   A fully-qualified path representing folder_location_bucket_view resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderLocationBucketViewName(folderLocationBucketViewName) {
        return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).folder;
    }
    /**
     * Parse the location from FolderLocationBucketView resource.
     *
     * @param {string} folderLocationBucketViewName
     *   A fully-qualified path representing folder_location_bucket_view resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromFolderLocationBucketViewName(folderLocationBucketViewName) {
        return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).location;
    }
    /**
     * Parse the bucket from FolderLocationBucketView resource.
     *
     * @param {string} folderLocationBucketViewName
     *   A fully-qualified path representing folder_location_bucket_view resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromFolderLocationBucketViewName(folderLocationBucketViewName) {
        return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).bucket;
    }
    /**
     * Parse the view from FolderLocationBucketView resource.
     *
     * @param {string} folderLocationBucketViewName
     *   A fully-qualified path representing folder_location_bucket_view resource.
     * @returns {string} A string representing the view.
     */
    matchViewFromFolderLocationBucketViewName(folderLocationBucketViewName) {
        return this.pathTemplates.folderLocationBucketViewPathTemplate.match(folderLocationBucketViewName).view;
    }
    /**
     * Return a fully-qualified folderLog resource name string.
     *
     * @param {string} folder
     * @param {string} log
     * @returns {string} Resource name string.
     */
    folderLogPath(folder, log) {
        return this.pathTemplates.folderLogPathTemplate.render({
            folder: folder,
            log: log,
        });
    }
    /**
     * Parse the folder from FolderLog resource.
     *
     * @param {string} folderLogName
     *   A fully-qualified path representing folder_log resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderLogName(folderLogName) {
        return this.pathTemplates.folderLogPathTemplate.match(folderLogName).folder;
    }
    /**
     * Parse the log from FolderLog resource.
     *
     * @param {string} folderLogName
     *   A fully-qualified path representing folder_log resource.
     * @returns {string} A string representing the log.
     */
    matchLogFromFolderLogName(folderLogName) {
        return this.pathTemplates.folderLogPathTemplate.match(folderLogName).log;
    }
    /**
     * Return a fully-qualified folderSettings resource name string.
     *
     * @param {string} folder
     * @returns {string} Resource name string.
     */
    folderSettingsPath(folder) {
        return this.pathTemplates.folderSettingsPathTemplate.render({
            folder: folder,
        });
    }
    /**
     * Parse the folder from FolderSettings resource.
     *
     * @param {string} folderSettingsName
     *   A fully-qualified path representing folder_settings resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderSettingsName(folderSettingsName) {
        return this.pathTemplates.folderSettingsPathTemplate.match(folderSettingsName).folder;
    }
    /**
     * Return a fully-qualified folderSink resource name string.
     *
     * @param {string} folder
     * @param {string} sink
     * @returns {string} Resource name string.
     */
    folderSinkPath(folder, sink) {
        return this.pathTemplates.folderSinkPathTemplate.render({
            folder: folder,
            sink: sink,
        });
    }
    /**
     * Parse the folder from FolderSink resource.
     *
     * @param {string} folderSinkName
     *   A fully-qualified path representing folder_sink resource.
     * @returns {string} A string representing the folder.
     */
    matchFolderFromFolderSinkName(folderSinkName) {
        return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName)
            .folder;
    }
    /**
     * Parse the sink from FolderSink resource.
     *
     * @param {string} folderSinkName
     *   A fully-qualified path representing folder_sink resource.
     * @returns {string} A string representing the sink.
     */
    matchSinkFromFolderSinkName(folderSinkName) {
        return this.pathTemplates.folderSinkPathTemplate.match(folderSinkName).sink;
    }
    /**
     * Return a fully-qualified logMetric resource name string.
     *
     * @param {string} project
     * @param {string} metric
     * @returns {string} Resource name string.
     */
    logMetricPath(project, metric) {
        return this.pathTemplates.logMetricPathTemplate.render({
            project: project,
            metric: metric,
        });
    }
    /**
     * Parse the project from LogMetric resource.
     *
     * @param {string} logMetricName
     *   A fully-qualified path representing LogMetric resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromLogMetricName(logMetricName) {
        return this.pathTemplates.logMetricPathTemplate.match(logMetricName)
            .project;
    }
    /**
     * Parse the metric from LogMetric resource.
     *
     * @param {string} logMetricName
     *   A fully-qualified path representing LogMetric resource.
     * @returns {string} A string representing the metric.
     */
    matchMetricFromLogMetricName(logMetricName) {
        return this.pathTemplates.logMetricPathTemplate.match(logMetricName).metric;
    }
    /**
     * Return a fully-qualified organizationCmekSettings resource name string.
     *
     * @param {string} organization
     * @returns {string} Resource name string.
     */
    organizationCmekSettingsPath(organization) {
        return this.pathTemplates.organizationCmekSettingsPathTemplate.render({
            organization: organization,
        });
    }
    /**
     * Parse the organization from OrganizationCmekSettings resource.
     *
     * @param {string} organizationCmekSettingsName
     *   A fully-qualified path representing organization_cmekSettings resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationCmekSettingsName(organizationCmekSettingsName) {
        return this.pathTemplates.organizationCmekSettingsPathTemplate.match(organizationCmekSettingsName).organization;
    }
    /**
     * Return a fully-qualified organizationExclusion resource name string.
     *
     * @param {string} organization
     * @param {string} exclusion
     * @returns {string} Resource name string.
     */
    organizationExclusionPath(organization, exclusion) {
        return this.pathTemplates.organizationExclusionPathTemplate.render({
            organization: organization,
            exclusion: exclusion,
        });
    }
    /**
     * Parse the organization from OrganizationExclusion resource.
     *
     * @param {string} organizationExclusionName
     *   A fully-qualified path representing organization_exclusion resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationExclusionName(organizationExclusionName) {
        return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).organization;
    }
    /**
     * Parse the exclusion from OrganizationExclusion resource.
     *
     * @param {string} organizationExclusionName
     *   A fully-qualified path representing organization_exclusion resource.
     * @returns {string} A string representing the exclusion.
     */
    matchExclusionFromOrganizationExclusionName(organizationExclusionName) {
        return this.pathTemplates.organizationExclusionPathTemplate.match(organizationExclusionName).exclusion;
    }
    /**
     * Return a fully-qualified organizationLocationBucket resource name string.
     *
     * @param {string} organization
     * @param {string} location
     * @param {string} bucket
     * @returns {string} Resource name string.
     */
    organizationLocationBucketPath(organization, location, bucket) {
        return this.pathTemplates.organizationLocationBucketPathTemplate.render({
            organization: organization,
            location: location,
            bucket: bucket,
        });
    }
    /**
     * Parse the organization from OrganizationLocationBucket resource.
     *
     * @param {string} organizationLocationBucketName
     *   A fully-qualified path representing organization_location_bucket resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationLocationBucketName(organizationLocationBucketName) {
        return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).organization;
    }
    /**
     * Parse the location from OrganizationLocationBucket resource.
     *
     * @param {string} organizationLocationBucketName
     *   A fully-qualified path representing organization_location_bucket resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromOrganizationLocationBucketName(organizationLocationBucketName) {
        return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).location;
    }
    /**
     * Parse the bucket from OrganizationLocationBucket resource.
     *
     * @param {string} organizationLocationBucketName
     *   A fully-qualified path representing organization_location_bucket resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromOrganizationLocationBucketName(organizationLocationBucketName) {
        return this.pathTemplates.organizationLocationBucketPathTemplate.match(organizationLocationBucketName).bucket;
    }
    /**
     * Return a fully-qualified organizationLocationBucketLink resource name string.
     *
     * @param {string} organization
     * @param {string} location
     * @param {string} bucket
     * @param {string} link
     * @returns {string} Resource name string.
     */
    organizationLocationBucketLinkPath(organization, location, bucket, link) {
        return this.pathTemplates.organizationLocationBucketLinkPathTemplate.render({
            organization: organization,
            location: location,
            bucket: bucket,
            link: link,
        });
    }
    /**
     * Parse the organization from OrganizationLocationBucketLink resource.
     *
     * @param {string} organizationLocationBucketLinkName
     *   A fully-qualified path representing organization_location_bucket_link resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationLocationBucketLinkName(organizationLocationBucketLinkName) {
        return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match(organizationLocationBucketLinkName).organization;
    }
    /**
     * Parse the location from OrganizationLocationBucketLink resource.
     *
     * @param {string} organizationLocationBucketLinkName
     *   A fully-qualified path representing organization_location_bucket_link resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromOrganizationLocationBucketLinkName(organizationLocationBucketLinkName) {
        return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match(organizationLocationBucketLinkName).location;
    }
    /**
     * Parse the bucket from OrganizationLocationBucketLink resource.
     *
     * @param {string} organizationLocationBucketLinkName
     *   A fully-qualified path representing organization_location_bucket_link resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromOrganizationLocationBucketLinkName(organizationLocationBucketLinkName) {
        return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match(organizationLocationBucketLinkName).bucket;
    }
    /**
     * Parse the link from OrganizationLocationBucketLink resource.
     *
     * @param {string} organizationLocationBucketLinkName
     *   A fully-qualified path representing organization_location_bucket_link resource.
     * @returns {string} A string representing the link.
     */
    matchLinkFromOrganizationLocationBucketLinkName(organizationLocationBucketLinkName) {
        return this.pathTemplates.organizationLocationBucketLinkPathTemplate.match(organizationLocationBucketLinkName).link;
    }
    /**
     * Return a fully-qualified organizationLocationBucketView resource name string.
     *
     * @param {string} organization
     * @param {string} location
     * @param {string} bucket
     * @param {string} view
     * @returns {string} Resource name string.
     */
    organizationLocationBucketViewPath(organization, location, bucket, view) {
        return this.pathTemplates.organizationLocationBucketViewPathTemplate.render({
            organization: organization,
            location: location,
            bucket: bucket,
            view: view,
        });
    }
    /**
     * Parse the organization from OrganizationLocationBucketView resource.
     *
     * @param {string} organizationLocationBucketViewName
     *   A fully-qualified path representing organization_location_bucket_view resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) {
        return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).organization;
    }
    /**
     * Parse the location from OrganizationLocationBucketView resource.
     *
     * @param {string} organizationLocationBucketViewName
     *   A fully-qualified path representing organization_location_bucket_view resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) {
        return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).location;
    }
    /**
     * Parse the bucket from OrganizationLocationBucketView resource.
     *
     * @param {string} organizationLocationBucketViewName
     *   A fully-qualified path representing organization_location_bucket_view resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) {
        return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).bucket;
    }
    /**
     * Parse the view from OrganizationLocationBucketView resource.
     *
     * @param {string} organizationLocationBucketViewName
     *   A fully-qualified path representing organization_location_bucket_view resource.
     * @returns {string} A string representing the view.
     */
    matchViewFromOrganizationLocationBucketViewName(organizationLocationBucketViewName) {
        return this.pathTemplates.organizationLocationBucketViewPathTemplate.match(organizationLocationBucketViewName).view;
    }
    /**
     * Return a fully-qualified organizationLog resource name string.
     *
     * @param {string} organization
     * @param {string} log
     * @returns {string} Resource name string.
     */
    organizationLogPath(organization, log) {
        return this.pathTemplates.organizationLogPathTemplate.render({
            organization: organization,
            log: log,
        });
    }
    /**
     * Parse the organization from OrganizationLog resource.
     *
     * @param {string} organizationLogName
     *   A fully-qualified path representing organization_log resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationLogName(organizationLogName) {
        return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).organization;
    }
    /**
     * Parse the log from OrganizationLog resource.
     *
     * @param {string} organizationLogName
     *   A fully-qualified path representing organization_log resource.
     * @returns {string} A string representing the log.
     */
    matchLogFromOrganizationLogName(organizationLogName) {
        return this.pathTemplates.organizationLogPathTemplate.match(organizationLogName).log;
    }
    /**
     * Return a fully-qualified organizationSettings resource name string.
     *
     * @param {string} organization
     * @returns {string} Resource name string.
     */
    organizationSettingsPath(organization) {
        return this.pathTemplates.organizationSettingsPathTemplate.render({
            organization: organization,
        });
    }
    /**
     * Parse the organization from OrganizationSettings resource.
     *
     * @param {string} organizationSettingsName
     *   A fully-qualified path representing organization_settings resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationSettingsName(organizationSettingsName) {
        return this.pathTemplates.organizationSettingsPathTemplate.match(organizationSettingsName).organization;
    }
    /**
     * Return a fully-qualified organizationSink resource name string.
     *
     * @param {string} organization
     * @param {string} sink
     * @returns {string} Resource name string.
     */
    organizationSinkPath(organization, sink) {
        return this.pathTemplates.organizationSinkPathTemplate.render({
            organization: organization,
            sink: sink,
        });
    }
    /**
     * Parse the organization from OrganizationSink resource.
     *
     * @param {string} organizationSinkName
     *   A fully-qualified path representing organization_sink resource.
     * @returns {string} A string representing the organization.
     */
    matchOrganizationFromOrganizationSinkName(organizationSinkName) {
        return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).organization;
    }
    /**
     * Parse the sink from OrganizationSink resource.
     *
     * @param {string} organizationSinkName
     *   A fully-qualified path representing organization_sink resource.
     * @returns {string} A string representing the sink.
     */
    matchSinkFromOrganizationSinkName(organizationSinkName) {
        return this.pathTemplates.organizationSinkPathTemplate.match(organizationSinkName).sink;
    }
    /**
     * Return a fully-qualified project resource name string.
     *
     * @param {string} project
     * @returns {string} Resource name string.
     */
    projectPath(project) {
        return this.pathTemplates.projectPathTemplate.render({
            project: project,
        });
    }
    /**
     * Parse the project from Project resource.
     *
     * @param {string} projectName
     *   A fully-qualified path representing Project resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectName(projectName) {
        return this.pathTemplates.projectPathTemplate.match(projectName).project;
    }
    /**
     * Return a fully-qualified projectCmekSettings resource name string.
     *
     * @param {string} project
     * @returns {string} Resource name string.
     */
    projectCmekSettingsPath(project) {
        return this.pathTemplates.projectCmekSettingsPathTemplate.render({
            project: project,
        });
    }
    /**
     * Parse the project from ProjectCmekSettings resource.
     *
     * @param {string} projectCmekSettingsName
     *   A fully-qualified path representing project_cmekSettings resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectCmekSettingsName(projectCmekSettingsName) {
        return this.pathTemplates.projectCmekSettingsPathTemplate.match(projectCmekSettingsName).project;
    }
    /**
     * Return a fully-qualified projectExclusion resource name string.
     *
     * @param {string} project
     * @param {string} exclusion
     * @returns {string} Resource name string.
     */
    projectExclusionPath(project, exclusion) {
        return this.pathTemplates.projectExclusionPathTemplate.render({
            project: project,
            exclusion: exclusion,
        });
    }
    /**
     * Parse the project from ProjectExclusion resource.
     *
     * @param {string} projectExclusionName
     *   A fully-qualified path representing project_exclusion resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectExclusionName(projectExclusionName) {
        return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).project;
    }
    /**
     * Parse the exclusion from ProjectExclusion resource.
     *
     * @param {string} projectExclusionName
     *   A fully-qualified path representing project_exclusion resource.
     * @returns {string} A string representing the exclusion.
     */
    matchExclusionFromProjectExclusionName(projectExclusionName) {
        return this.pathTemplates.projectExclusionPathTemplate.match(projectExclusionName).exclusion;
    }
    /**
     * Return a fully-qualified projectLocationBucket resource name string.
     *
     * @param {string} project
     * @param {string} location
     * @param {string} bucket
     * @returns {string} Resource name string.
     */
    projectLocationBucketPath(project, location, bucket) {
        return this.pathTemplates.projectLocationBucketPathTemplate.render({
            project: project,
            location: location,
            bucket: bucket,
        });
    }
    /**
     * Parse the project from ProjectLocationBucket resource.
     *
     * @param {string} projectLocationBucketName
     *   A fully-qualified path representing project_location_bucket resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectLocationBucketName(projectLocationBucketName) {
        return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).project;
    }
    /**
     * Parse the location from ProjectLocationBucket resource.
     *
     * @param {string} projectLocationBucketName
     *   A fully-qualified path representing project_location_bucket resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromProjectLocationBucketName(projectLocationBucketName) {
        return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).location;
    }
    /**
     * Parse the bucket from ProjectLocationBucket resource.
     *
     * @param {string} projectLocationBucketName
     *   A fully-qualified path representing project_location_bucket resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromProjectLocationBucketName(projectLocationBucketName) {
        return this.pathTemplates.projectLocationBucketPathTemplate.match(projectLocationBucketName).bucket;
    }
    /**
     * Return a fully-qualified projectLocationBucketLink resource name string.
     *
     * @param {string} project
     * @param {string} location
     * @param {string} bucket
     * @param {string} link
     * @returns {string} Resource name string.
     */
    projectLocationBucketLinkPath(project, location, bucket, link) {
        return this.pathTemplates.projectLocationBucketLinkPathTemplate.render({
            project: project,
            location: location,
            bucket: bucket,
            link: link,
        });
    }
    /**
     * Parse the project from ProjectLocationBucketLink resource.
     *
     * @param {string} projectLocationBucketLinkName
     *   A fully-qualified path representing project_location_bucket_link resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectLocationBucketLinkName(projectLocationBucketLinkName) {
        return this.pathTemplates.projectLocationBucketLinkPathTemplate.match(projectLocationBucketLinkName).project;
    }
    /**
     * Parse the location from ProjectLocationBucketLink resource.
     *
     * @param {string} projectLocationBucketLinkName
     *   A fully-qualified path representing project_location_bucket_link resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromProjectLocationBucketLinkName(projectLocationBucketLinkName) {
        return this.pathTemplates.projectLocationBucketLinkPathTemplate.match(projectLocationBucketLinkName).location;
    }
    /**
     * Parse the bucket from ProjectLocationBucketLink resource.
     *
     * @param {string} projectLocationBucketLinkName
     *   A fully-qualified path representing project_location_bucket_link resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromProjectLocationBucketLinkName(projectLocationBucketLinkName) {
        return this.pathTemplates.projectLocationBucketLinkPathTemplate.match(projectLocationBucketLinkName).bucket;
    }
    /**
     * Parse the link from ProjectLocationBucketLink resource.
     *
     * @param {string} projectLocationBucketLinkName
     *   A fully-qualified path representing project_location_bucket_link resource.
     * @returns {string} A string representing the link.
     */
    matchLinkFromProjectLocationBucketLinkName(projectLocationBucketLinkName) {
        return this.pathTemplates.projectLocationBucketLinkPathTemplate.match(projectLocationBucketLinkName).link;
    }
    /**
     * Return a fully-qualified projectLocationBucketView resource name string.
     *
     * @param {string} project
     * @param {string} location
     * @param {string} bucket
     * @param {string} view
     * @returns {string} Resource name string.
     */
    projectLocationBucketViewPath(project, location, bucket, view) {
        return this.pathTemplates.projectLocationBucketViewPathTemplate.render({
            project: project,
            location: location,
            bucket: bucket,
            view: view,
        });
    }
    /**
     * Parse the project from ProjectLocationBucketView resource.
     *
     * @param {string} projectLocationBucketViewName
     *   A fully-qualified path representing project_location_bucket_view resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectLocationBucketViewName(projectLocationBucketViewName) {
        return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).project;
    }
    /**
     * Parse the location from ProjectLocationBucketView resource.
     *
     * @param {string} projectLocationBucketViewName
     *   A fully-qualified path representing project_location_bucket_view resource.
     * @returns {string} A string representing the location.
     */
    matchLocationFromProjectLocationBucketViewName(projectLocationBucketViewName) {
        return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).location;
    }
    /**
     * Parse the bucket from ProjectLocationBucketView resource.
     *
     * @param {string} projectLocationBucketViewName
     *   A fully-qualified path representing project_location_bucket_view resource.
     * @returns {string} A string representing the bucket.
     */
    matchBucketFromProjectLocationBucketViewName(projectLocationBucketViewName) {
        return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).bucket;
    }
    /**
     * Parse the view from ProjectLocationBucketView resource.
     *
     * @param {string} projectLocationBucketViewName
     *   A fully-qualified path representing project_location_bucket_view resource.
     * @returns {string} A string representing the view.
     */
    matchViewFromProjectLocationBucketViewName(projectLocationBucketViewName) {
        return this.pathTemplates.projectLocationBucketViewPathTemplate.match(projectLocationBucketViewName).view;
    }
    /**
     * Return a fully-qualified projectLog resource name string.
     *
     * @param {string} project
     * @param {string} log
     * @returns {string} Resource name string.
     */
    projectLogPath(project, log) {
        return this.pathTemplates.projectLogPathTemplate.render({
            project: project,
            log: log,
        });
    }
    /**
     * Parse the project from ProjectLog resource.
     *
     * @param {string} projectLogName
     *   A fully-qualified path representing project_log resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectLogName(projectLogName) {
        return this.pathTemplates.projectLogPathTemplate.match(projectLogName)
            .project;
    }
    /**
     * Parse the log from ProjectLog resource.
     *
     * @param {string} projectLogName
     *   A fully-qualified path representing project_log resource.
     * @returns {string} A string representing the log.
     */
    matchLogFromProjectLogName(projectLogName) {
        return this.pathTemplates.projectLogPathTemplate.match(projectLogName).log;
    }
    /**
     * Return a fully-qualified projectSettings resource name string.
     *
     * @param {string} project
     * @returns {string} Resource name string.
     */
    projectSettingsPath(project) {
        return this.pathTemplates.projectSettingsPathTemplate.render({
            project: project,
        });
    }
    /**
     * Parse the project from ProjectSettings resource.
     *
     * @param {string} projectSettingsName
     *   A fully-qualified path representing project_settings resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectSettingsName(projectSettingsName) {
        return this.pathTemplates.projectSettingsPathTemplate.match(projectSettingsName).project;
    }
    /**
     * Return a fully-qualified projectSink resource name string.
     *
     * @param {string} project
     * @param {string} sink
     * @returns {string} Resource name string.
     */
    projectSinkPath(project, sink) {
        return this.pathTemplates.projectSinkPathTemplate.render({
            project: project,
            sink: sink,
        });
    }
    /**
     * Parse the project from ProjectSink resource.
     *
     * @param {string} projectSinkName
     *   A fully-qualified path representing project_sink resource.
     * @returns {string} A string representing the project.
     */
    matchProjectFromProjectSinkName(projectSinkName) {
        return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName)
            .project;
    }
    /**
     * Parse the sink from ProjectSink resource.
     *
     * @param {string} projectSinkName
     *   A fully-qualified path representing project_sink resource.
     * @returns {string} A string representing the sink.
     */
    matchSinkFromProjectSinkName(projectSinkName) {
        return this.pathTemplates.projectSinkPathTemplate.match(projectSinkName)
            .sink;
    }
    /**
     * Terminate the gRPC channel and close the client.
     *
     * The client will no longer be usable and all future behavior is undefined.
     * @returns {Promise} A promise that resolves when the client is closed.
     */
    close() {
        if (this.metricsServiceV2Stub && !this._terminated) {
            return this.metricsServiceV2Stub.then(stub => {
                this._terminated = true;
                stub.close();
            });
        }
        return Promise.resolve();
    }
}
exports.MetricsServiceV2Client = MetricsServiceV2Client;
//# sourceMappingURL=metrics_service_v2_client.js.map